N
N
Nightmare0582021-12-25 17:49:20
Java
Nightmare058, 2021-12-25 17:49:20

How to properly organize the storage of records change history?

Good evening I'm
interested in how to organize the storage of the history of changes to records in the database, according to the type of what is done here on Habré.
If there is an article on this topic, I will be glad to read it.
I myself have so far realized that it should be one to many, but technically the process is lame
. Maybe I didn’t take something into account

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Roo, 2021-12-25
@xez

An easy way is to opt out of update and delete.
insert only.
It will also be necessary to add a column with the date, in which the current time will be automatically put down.

U
User700, 2021-12-25
@User700

See triggers (in DBMS). You can execute commands to insert (INSERT) information into event log tables during DELETE, INSERT, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question