feat: Add script to clean orphaned reference records
Instances that accumulated project managers, favorites, board memberships or board subscriptions pointing at a project or board that no longer exists had no way to find or clear them. The script reports by default and only deletes with `--apply`, which first asks whether a backup exists and refuses outright without a terminal to ask on. It removes nothing but reference rows: structural orphans such as a board without a project carry user content, and a membership whose denormalized project is stale still grants real access to an existing board, so both are reported and left alone.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
"scripts": {
|
||||
"build": "node build.js",
|
||||
"console": "dotenv sails console",
|
||||
"db:clean-orphaned-records": "node db/clean-orphaned-records.js",
|
||||
"db:create-admin-user": "node db/create-admin-user.js",
|
||||
"db:init": "node db/init.js",
|
||||
"db:migrate": "knex migrate:latest --cwd db",
|
||||
|
||||
Reference in New Issue
Block a user