Home > Software engineering >  Update the database table design
Update the database table design

Time:10-02

Would like to ask bosses how to design a database table

ABCDE several tables, ABCDE several tables every time update, is not really the update, to wait for an administrator to audit, through the update again, not by will remain the same, so, should design a review table F again, every time I update the data in this table, the state of the design is approved the status field, then ABCDE several table to create a F table id to associate the table, after approval, again from F to take out the data in the table to update other tables?

But if such a design, how through F table to find the record of ABCDE, if stored an id to F table at the same time, how to know which table is id again? Or need another field to put the table name, through code to judge what form?

CodePudding user response:

Can also be in a table, status field defaults to not audit, only the administrator to modify this field,

CodePudding user response:

This scene I think logically is more suitable for using transactions/rollback for from you the meaning of the logical truth is the expression of "has been submitted for review" rather than "has been updated, log for possible rollback" another transaction isolation level can be adjusted according to your specific needs adjustment log simulation if you still need to deal with possible isolation level problems ah,,
Back to your specific questions as A - E each table design A ATmp/BTmp... Table structure and AB, exactly the same can be rolled back the Update is written to the temporary table and then do a index entry table put concrete operating time/timeline node, operation, submit/audit state, which in the table to Update transaction involves the change which columns
  • Related