View Source
Unreleased
[0.6.0] - 2022-10-12
New migration patches: 5
Added
- Optional tracking of previous data in changes. Set the
store_changed_fromtrigger option.
Changed
- Added
@schema_prefix "carbonite_default"on all schemas. This will enable the manual usage ofRepo.insert/2& friends on transactions without specifying a prefix, when using the default carbonite prefix.
[0.5.0] - 2022-02-25
New migration patches: 4
Switch to normal identity column on transactions
- The
idcolumn ontransactionshas been replaced with an ordinary autoincrementing integer PK, filled from a sequence. Next to it a newxact_idcolumn continues to store the transaction id (frompg_current_xact_id). Both values used together ensure that, first theidis monotonically increasing and survives a backup restore (see issue #45), and second thechangesrecords can still only be inserted within the same transaction.
Added
Carbonite.Migrations.insert_migration_transaction/1and its macro friend,insert_migration_transaction_after_begin, help with data migrations.Carbonite.fetch_changesreturns the changes of the current (ongoing) transaction.
[0.4.0] - 2021-11-07
New migration patches: 2, 3
Switch to top-level API with repo param
Carbonite.override_mode/2(kept a wrapper inCarbonite.Multi)Carbonite.insert_transaction/3(kept a wrapper inCarbonite.Multi)Carbonite.process/4(previouslyCarbonite.Outbox.process/3with major changes)Carbonite.purge/2(previouslyCarbonite.Outbox.purge/1with major changes)
Big outbox overhaul
- Split into query / processing
- Simplify processing
- No more transaction
- New capabilities: memo, halting, chunking
Migration versioning
- Explicit for now with
Carbonite.Migrations.up(non_neg_integer()) Carbonite.Migrations.install_schema/1is nowCarbonite.Migrations.up/2Carbonite.Migrations.put_trigger_option/4to ensure old migrations continue to work- At the same time removed long configuration statement from
Carbonite.Migrations.install_trigger/1, so this does not need to be versioned and continues to work - Mix task for generating the "initial" migration
Other Changes
- Optionally derive Jason.Encoder for
Carbonite.TransactionandCarbonite.Change - Made all prefix options binary-only (no atom) as
Ecto.Query.put_query_prefix/2only accepts strings
[0.3.1] - 2021-10-23
Added
table_prefixoption toQuery.changes/2allows to override schema prefix of given recordQuery.transactions/1query selects all transactions
[0.3.0] - 2021-10-22
Added
Carbonite.Migrations.drop_tables/1allows to drop the carbonite audit trail without removing the schema
Changed
- Renamed the option that can be passed to
Carbonite.Migrations.drop_schema/1fromprefixtocarbonite_prefix - Changed
Carbonite.Migrations.drop_schema/1to also drop the tables - Made
Carbonite.Multi.insert_transaction/3ignore conflictingINSERTs within the same transaction - Also, changed
Carbonite.Multi.insert_transaction/3to always reloads all fields from the database after insertion, immediately returning the JSONinifiedmetapayload
Fixed
- Fixed ignore mode when
override_transaction_idis NULL
[0.2.1] - 2021-10-10
Fixed
- Fixed broken documentation
[0.2.0] - 2021-10-10
Added
- Store primary key(s) on changes table and index them
- Add
Carbonite.Querymodulecurrent_transaction/2allows to fetch the ongoing transaction (for sandbox tests)changes/2allows to fetch the changes of an invidual source record
- Update Postgrex to 0.15.11 and drop local
Xid8type - Add
modefield to trigger (capture or ignore) - Add "override mode" reversing the
modeoption for the current transaction to enable/disable capturing on demand (e.g. in tests) - Add filtered columns
Changed
- Moved top-level functions to nested modules
TransactionandMulti - Made
table_pkbeNULLwhenprimary_key_columnsis an empty array - Default
primary_key_columnsto["id"] - Renamed
prefixoption tocarbonite_prefixoninstall_schema/2for consistency
[0.1.0] - 2021-09-01
- Initial release.