-
-
Notifications
You must be signed in to change notification settings - Fork 328
Description
** What is the purpose of the extension? **
Track changes to resources that are stored in Postgres tables using the bitcrowd/carbonite project. (Only Postgres 13 and higher are supported.) See https://hexdocs.pm/carbonite/Carbonite.html for the list of benefits and how it works.
** How would it extend the DSL? **
I am open to suggestions. In my case every resource would be tracked but in the general case only certain resources should be tracked.
"track changes with carbonite"
** What it would do? **
- Would these be manual tasks?
A) Add Carbonite dependencies. See https://hexdocs.pm/carbonite/Carbonite.html#module-hex-dependency
B) Create a migration to add the carbonite schema if it doesn't already exist. Perhaps the dsl should accept an optional schema name. See https://hexdocs.pm/carbonite/Carbonite.html#module-creating-the-initial-migration
-
Create a migration to add triggers to the table for cud operations - see https://hexdocs.pm/carbonite/Carbonite.html#module-trigger-configuration
-
Alter all cud operations to create a Carbonite transaction row. See https://hexdocs.pm/carbonite/Carbonite.html#module-inserting-a-transaction
** Interaction with other features **
-
Tenants - does each tenant get its own carbonite schema?
-
Context - I want to associate current_user.id with the Carbonite transaction. However, some operations will be done anonymously
-
Archive - unclear whether anything special is needed
-
Seed data (if applicable). Ash would either insert a transaction for Carbonite or disable the validation. See https://hexdocs.pm/carbonite/Carbonite.html#module-inserting-a-transaction
-
Migrations. Similarly, if migrations alter data, Ash would either insert a transaction for Carbonite or disable the validation. See https://hexdocs.pm/carbonite/Carbonite.html#module-transactions-in-data-migrations