| 1 | ALTER TABLE runner_assignments ADD COLUMN protocol_version integer NOT NULL DEFAULT 1; |
| 2 | UPDATE supervised_trials SET revoked_at=CURRENT_TIMESTAMP WHERE revoked_at IS NULL; |
| 3 | UPDATE isolation_acknowledgements SET revoked_at=CURRENT_TIMESTAMP WHERE revoked_at IS NULL; |
| 4 | INSERT INTO connection_invalidations(connection_id,revision,reason,at) |
| 5 | SELECT id,revision,'direct_launch_cutover',CURRENT_TIMESTAMP FROM connections; |
| 6 | UPDATE connections SET revision=revision+1,reports_json='[]'; |
| 7 | UPDATE connection_choices SET revision=revision+1; |
| 8 | UPDATE runner_assignments SET state='fenced',revision=revision+1 WHERE state!='contained'; |
| 9 | UPDATE steps SET fence=fence+1 WHERE id IN (SELECT step_id FROM attempts WHERE containment='pending'); |
| 10 | UPDATE attempts SET state='stopping',stop_requested=CURRENT_TIMESTAMP WHERE containment='pending'; |
| 11 | UPDATE jobs SET state='waiting',wait='uncertain_external_outcome',revision=revision+1 WHERE state NOT IN ('succeeded','failed','cancelled') OR id IN (SELECT job_id FROM attempts WHERE containment='pending'); |
| 12 | UPDATE task_outboxes SET state='reconcile' WHERE task_id IN (SELECT id FROM tasks WHERE state NOT IN ('merged','failed','cancelled','waiting_merge') OR job_id IN (SELECT job_id FROM attempts WHERE containment='pending')); |
| 13 | UPDATE tasks SET state='waiting',wait_code='task.wait.reconcile',revision=revision+1 WHERE state NOT IN ('merged','failed','cancelled','waiting_merge') OR job_id IN (SELECT job_id FROM attempts WHERE containment='pending'); |
| 14 | INSERT INTO audit_events(actor,kind,record_id,at) |
| 15 | VALUES('system','system.migration.direct_launch','equipo/0018_direct_launch',CURRENT_TIMESTAMP); |
| 16 | |