CLARIAH / pure3dx

pure3d: the bare app
MIT License
0 stars 0 forks source link

Deleting scenes, editions, projects #6

Closed dirkroorda closed 1 year ago

dirkroorda commented 1 year ago

Deleting projects, editions, scenes involves deleting records from MongoDB and their related files and directories from the data file system.

We need to take extra care when records are linked to other records.

Records can be linked to other records in two ways:

Detail records have a link to their master record, not vice versa. We can delete detail records, but we need a policy when deleting master records:

We choose the prevent strategy.

For cross-table situations: we delete the cross record if we want to unlink two linked records. When we delete one of a pair of linked records, we automatically delete the cross-record as well.

When we place delete buttons next to projects, editions, scenes, we suppress it if there are detail records. Instead, we place a count of the types of detail records.

All this is already in place.

What needs to be done is to also delete the relevant entities on the file system. And we must enforce that a model cannot be deleted if there are still scenes in the same edition.

Also, we may not upload a model under a different file name, because that breaks the link.

dirkroorda commented 1 year ago

We have changed our thinking: there is no longer a table with scenes. Every edition has a single scene with the predictable name voyager.svx.json, and there is no need to store scene properties in an extra MongoDb record.

dirkroorda commented 1 year ago

Done