Plant-Tracer / webapp

Client and Server for web-based JavaScript app
GNU Affero General Public License v3.0
0 stars 2 forks source link

purge old deleted movies #57

Open simsong opened 1 year ago

simsong commented 1 year ago

purge the old movies that have been deleted.

sbarber2 commented 1 year ago

Does "purge old" imply that deleted movies are kept for a (specified, configurable) period of time?

simsong commented 1 year ago

Right now they are kept forever. We need to have a program that purges (removes from the database) movies that are still deleted after XXX days. This may require rethinking some of the referential integrity issues. I'm removing referential integrity from the logs table, for instance, so that we can delete users/courses/movies even if we have logged information about them.

sbarber2 commented 1 year ago

Agreed that the log table would be better off w/o referential integrity constraints.

Detecting how long a movie has been deleted. logs.timet is one way, though the selection query would have to consider the values of logs.func*, and then run the delete on movies and related tables. Adding a movies.date_modified might be a less edge-case prone approach.

simsong commented 1 year ago

Agreed. The table should have a column that automatically gets updated whenever any column in the row is modified. I normally put this in all of my tables; I will make sure this one has it.