M
M
MOWS2015-12-04 09:43:47
MySQL
MOWS, 2015-12-04 09:43:47

How to guarantee the immutability of the data in the table if there is a FK?

There is a table of user requests and you need to somehow guarantee the immutability of the data after inserting it into the table so that no one can change the data. Here you can make the signature a hash, but the problem is that this table has FK for directories (i.e. if someone changes the directory, then the hash will be the same)
Is it reasonable in this situation to store values ​​​​instead of id directories most get rid of FK?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rsa97, 2015-12-04
@Rsa97

A simple, but data-increasing method is copying values ​​from reference books into an application at the time of its creation.
A more complicated way is to add additional tables-registers to the directories that store changes in the directories (time, id_in_the_ directory, value) and take the values ​​from the register at the time of the request.

A
Andrey Burov, 2015-12-04
@BuriK666

dev.mysql.com/doc/refman/5.7/en/create-table-forei...
ON DELETE RESTRICT
ON UPDATE RESTRICT
And still it is possible to select from the user access to record in this table.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question