summaryrefslogtreecommitdiff
path: root/makima/migrations/20260501000000_archive_existing_contracts.sql
diff options
context:
space:
mode:
Diffstat (limited to 'makima/migrations/20260501000000_archive_existing_contracts.sql')
-rw-r--r--makima/migrations/20260501000000_archive_existing_contracts.sql18
1 files changed, 18 insertions, 0 deletions
diff --git a/makima/migrations/20260501000000_archive_existing_contracts.sql b/makima/migrations/20260501000000_archive_existing_contracts.sql
new file mode 100644
index 0000000..5793cd6
--- /dev/null
+++ b/makima/migrations/20260501000000_archive_existing_contracts.sql
@@ -0,0 +1,18 @@
+-- One-shot migration to archive every legacy contract.
+--
+-- Background: the document-mode directive UI is becoming the single surface
+-- for makima. The standalone contracts system is being phased out (see Phase
+-- 4/5 work in the roadmap). New contract creation paths still exist for
+-- internal directive-step use (`directive_steps.contract_type`), but
+-- end-user-visible standalone contracts are no longer produced and should
+-- read as historical from now on.
+--
+-- This migration flips every existing contract to `archived` so the legacy
+-- /contracts list collapses to "everything is archived" instead of mixing
+-- live and archival data. New rows can still be created (e.g. by directive
+-- orchestration's contract-backed steps) and will start in their normal
+-- status — this only affects pre-existing data.
+UPDATE contracts
+SET status = 'archived',
+ updated_at = NOW()
+WHERE status NOT IN ('archived');