M
M
m0ody2015-07-09 13:33:18
Django
m0ody, 2015-07-09 13:33:18

How to implement custom action cancellation?

The application is a table with a large number of rows. The user controls the data from this table (deletion, transfer to groups, etc.).
Sometimes it happens that the user made a mistake and deleted the wrong data or transferred the data to the wrong group.
I would like to be able to undo the last action. What is the best way to do this? Create a duplicate table and copy the current data into it and then only do the action? But if there is a lot of data in the table, then this business will be long?
Maybe there are mechanisms for organizing this in the DBMS itself (postgresql)?
I'll describe the details:
You don’t need to store for a long time - two minutes is enough. The table is complex, with a large number of links and with a large number of fields. The search takes place in almost all fields with complex logic. The data is still in the region of 25k, but growth is expected up to 1kk.
Another problem is that this table is used by other tables (foreign key) and the data in these other tables is also deleted when deleted in the main one.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
entermix, 2015-07-09
@m0ody

You can simply mark posts as deleted

R
Rikcon, 2015-07-09
@Rikcon

Maybe transactions will help you?

S
sim3x, 2015-07-09
@sim3x

Maybe there are mechanisms for organizing this in the DBMS itself (postgresql)?

There are transactions in the database, but they are not for this kind of tasks - they are for consistency

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question