Ask a question which template to use.

Description of the problem: We have a requirement to store a temporary snapshot of the object temporarily in the database until a certain period of time until all processes confirming the data are completed. After completion of all statements, the data should be permanently stored in the actual table.

Example:

  • Consider an object called User. One way to create a user is through the Create Account Process.
  • "Create an account" should capture all the user information and save it in a temporary table in the database.
  • The data should be used by the "account approval process" to initiate the verification process.
  • After the verification is completed successfully, the user data will be saved in the actual table.

Question: Where to store user data entered during the "Create Account Process". In addition, user data must be editable before the verification process is completed.

+3
source share
2 answers

I would usually have one table with an "Approved" table. Most queries will only retrieve rows where this flag is true. For instance. you can create an "ApprovedUsers" view as

SELECT ... FROM Users WHERE Approved = 1

(where ... are all columns except the Approved column).

. , , "ApprovedUsers", .

+9

. , , , , .

0

Source: https://habr.com/ru/post/1737596/


All Articles