Carbonite.Migrations (Carbonite v0.2.0) View Source
Functions to setup Carbonite audit trails in your migrations.
Link to this section Summary
Functions
Alters a triggers configuration for a given table.
Removes a Carbonite audit trail from the database.
Removes a change capture trigger from a table.
Installs a Carbonite audit trail.
Installs a change capture trigger on a table.
Link to this section Types
Specs
column_name() :: binary()
Specs
Specs
schema_option() :: {:carbonite_prefix, prefix()}
Specs
Specs
trigger_config_option() ::
{:primary_key_columns, [column_name()]}
| {:excluded_columns, [column_name()]}
| {:mode, :capture | :ignore}
Specs
Link to this section Functions
Specs
configure_trigger(table_name(), [trigger_option() | trigger_config_option()]) :: :ok
Alters a triggers configuration for a given table.
You need to specify all desired options each time you call this function, as the previous configuration will be replaced.
Options
table_prefixis the name of the schema the table lives incarbonite_prefixis the schema of the audit trail, defaults to"carbonite_default"primary_key_columnsis a list of columns that form the primary key of the table(defaults to `["id"]`, set to `[]` to disable)excluded_columnsis a list of columns to exclude from change capturesfiltered_columnsis a list of columns that appear as '[FILTERED]' in the datamodeis either:captureor:ignoreand defines the default behaviour of the trigger
Specs
drop_schema([schema_option()]) :: :ok
Removes a Carbonite audit trail from the database.
Options
prefixdefines the audit trail's schema, defaults to"carbonite_default"
Specs
drop_trigger(table_name(), [trigger_option()]) :: :ok
Removes a change capture trigger from a table.
Options
table_prefixis the name of the schema the table lives incarbonite_prefixis the schema of the audit trail, defaults to"carbonite_default"
Specs
install_schema([schema_option()]) :: :ok
Installs a Carbonite audit trail.
Options
carbonite_prefixdefines the audit trail's schema, defaults to"carbonite_default"
Specs
install_trigger(table_name(), [trigger_option() | trigger_config_option()]) :: :ok
Installs a change capture trigger on a table.
Options
table_prefixis the name of the schema the table lives incarbonite_prefixis the schema of the audit trail, defaults to"carbonite_default"primary_key_columnsis a list of columns that form the primary key of the table(defaults to `["id"]`, set to `[]` to disable)excluded_columnsis a list of columns to exclude from change capturesfiltered_columnsis a list of columns that appear as '[FILTERED]' in the data