Commit graph

6 commits

Author SHA1 Message Date
David Mehren
f606a7825f refactor(migrations): move cleanup code into migration
We cannot execute the cleanup script as a subprocess with sqlite,
as we now wrap the migrations in a SAVEPOINT, which blocks a second
process.

This moves the cleanup code into the migration file, so it can be
executed in-process.

Signed-off-by: David Mehren <git@herrmehren.de>
2022-11-06 22:24:48 +01:00
Erik Michelson
e0f729e014
Fixed eslint errors (whitespaces)
Signed-off-by: Erik Michelson <erik@liltv.de>
2020-03-21 23:27:00 +01:00
Sheogorath
f42304c967
Clean up all foreign-key constraints
This patch cleans up the remaining possible foreign-key constraint. This
case seem to appear, when notes are deleted, but due to missing database
contraints not their authroships.

This function should clean that up as well and complete the preparation
for the new db contraints.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2020-03-21 21:05:52 +01:00
Sheogorath
41b13e71b6
Reduce requested arguments on cleanup
In order to prevent OOM situations due to large databases, this patch
should reduce the amount of data requested from the database
drastically.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2020-03-21 19:30:44 +01:00
Sheogorath
4884292b68
fixup! Add fix for missing deletion of notes on user-deletion request 2020-03-21 18:13:20 +01:00
Sheogorath
a9d98d4b52
Add fix for missing deletion of notes on user-deletion request
Depending on how the system was setup, this bug lead to keep user's data
around even after a successful deletion of user'S account. This patch
will make sure the missing database constraints are implemented and
missed out deletions are executed.

This bug was introduced to insufficent testing after implementing the
feature initially. It was well tested, using the app process itself, but
the migrations where missed out. I'm currently not sure, if there was
also a change in how sequelize handles cassaded deletion, since I'm
unter the impression that before switching to sequelize 5, this feature
has worked. But I haven't verified this.

No matter what, the cleanup process is rather straight forward and will
be invoked on migration, but can also be done manually using the new
`bin/cleanup` script.

This change will result in a release 1.6.1.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2020-03-21 16:14:43 +01:00