VForWaTer / metacatalog

Modular metadata management platform for environmental data.
https://vforwater.github.io/metacatalog
GNU General Public License v3.0
4 stars 1 forks source link

Functionallity to remove an Entry (with all of its traces) #170

Open AlexDo1 opened 3 years ago

AlexDo1 commented 3 years ago

A function to remove an entry from metacatalog with all its traces and relationships (datasource, data, details, ...) would be very handy.

It is up for discussion what should be deleted and what should be kept in metacatalog (like author, variable, keywords, license, EntryGroup).

mmaelicke commented 3 years ago

I think this should be rather easy. There are different approaches how we can delete data, i.e.: https://docs.sqlalchemy.org/en/14/tutorial/orm_data_manipulation.html#orm-enabled-delete-statements or simply adding Model instances to the session's session.delete method. Nevertheless, there are different things we need to take care of:

AlexDo1 commented 2 years ago

The functionality to delete entries would still be useful, I can work on that if you think the same @mmaelicke.

mmaelicke commented 2 years ago

Yeah that would be great. There are some dependencies on a entry. Not all of them can be solved by CASCADE statements, which should be added to the sqlalchemy models.

mmaelicke commented 2 years ago

And maybe we do not delete, but archive data (and metadata). So mark as deleted to exclude from future queries. The delete logic would then only delete, if the entry was already marked as deleted. This would make recoveries possible.