Carbonite.Migrations (Carbonite v0.3.1) 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 Carbonite audit trail from the database but keeps the schema.
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_prefix
is the name of the schema the table lives incarbonite_prefix
is the schema of the audit trail, defaults to"carbonite_default"
primary_key_columns
is a list of columns that form the primary key of the table(defaults to `["id"]`, set to `[]` to disable)
excluded_columns
is a list of columns to exclude from change capturesfiltered_columns
is a list of columns that appear as '[FILTERED]' in the datamode
is either:capture
or:ignore
and defines the default behaviour of the trigger
Specs
drop_schema([schema_option()]) :: :ok
Removes a Carbonite audit trail from the database.
Options
carbonite_prefix
defines the audit trail's schema, defaults to"carbonite_default"
Specs
drop_tables([schema_option()]) :: :ok
Removes a Carbonite audit trail from the database but keeps the schema.
Options
carbonite_prefix
defines 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_prefix
is the name of the schema the table lives incarbonite_prefix
is the schema of the audit trail, defaults to"carbonite_default"
Specs
install_schema([schema_option()]) :: :ok
Installs a Carbonite audit trail.
Options
carbonite_prefix
defines 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_prefix
is the name of the schema the table lives incarbonite_prefix
is the schema of the audit trail, defaults to"carbonite_default"
primary_key_columns
is a list of columns that form the primary key of the table(defaults to `["id"]`, set to `[]` to disable)
excluded_columns
is a list of columns to exclude from change capturesfiltered_columns
is a list of columns that appear as '[FILTERED]' in the data