| 1 | -- What security keeps by a work item's number also keeps the item's id and |
| 2 | -- workspace, from `work.migrated` (g1t #57): a repository transferred to |
| 3 | -- another workspace still finds the item it had, never the new |
| 4 | -- workspace's item of the same number. |
| 5 | ALTER TABLE updates ADD COLUMN item_id TEXT; |
| 6 | ALTER TABLE updates ADD COLUMN item_workspace TEXT; |
| 7 | ALTER TABLE update_pulls ADD COLUMN item_id TEXT; |
| 8 | ALTER TABLE update_pulls ADD COLUMN item_workspace TEXT; |
| 9 | ALTER TABLE upgrades ADD COLUMN item_id TEXT; |
| 10 | ALTER TABLE upgrades ADD COLUMN item_workspace TEXT; |
| 11 | ALTER TABLE code_alerts ADD COLUMN item_id TEXT; |
| 12 | ALTER TABLE code_alerts ADD COLUMN item_workspace TEXT; |
| 13 | ALTER TABLE alert_fixes ADD COLUMN item_id TEXT; |
| 14 | ALTER TABLE alert_fixes ADD COLUMN item_workspace TEXT; |
| 15 | -- Pages already applied rewrote the numbers without the ids: the cron's |
| 16 | -- catch-up reads the whole map again, and each page fills in the ids of |
| 17 | -- rows already on their new numbers (store.rs `WORK_MIGRATED`). |
| 18 | UPDATE work_catch_up SET cursor = NULL, page = 0, done_at = NULL WHERE name = 'work.migrated'; |