blob: 5793cd63029c6fa44ca2c52b0d937374c2f6ddb3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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');
|