Hello Takada,
If the built-in change log history is not sufficient for your needs, you can of course build your own. For this you would create relations for everything you would want to log (let´s call them log relations
). These relations would contain the attributes you care about from the corresponding, original relations (data relations
), as well as timestamps, usernames, etc.
You would then need an insert/update/delete trigger function on the data relations
that you want to log. Inside the trigger backend function, you could create 1 record (INSERT INTO) in your corresponding log relation
for every change event - including username, timestamps and so on.
Example for 1 relation, called purchase
:
purchase
(data relation) has 3 attributes: Date, price, product
purchase_log
(log relation) has 6 attributes: Date, price, product, change_type (created/updated/deleted), login_id, timestamp
Trigger on purchase
creates 1 record on purchase_log
for every change that occurred.