From eff0d844ca6e35bfbc2d5fdaa2d2f92177611f2e Mon Sep 17 00:00:00 2001 From: soryu Date: Thu, 15 Jan 2026 00:23:44 +0000 Subject: Contract type system --- makima/migrations/20250115000000_add_contract_type.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 makima/migrations/20250115000000_add_contract_type.sql (limited to 'makima/migrations') diff --git a/makima/migrations/20250115000000_add_contract_type.sql b/makima/migrations/20250115000000_add_contract_type.sql new file mode 100644 index 0000000..02d7bfd --- /dev/null +++ b/makima/migrations/20250115000000_add_contract_type.sql @@ -0,0 +1,13 @@ +-- Add contract_type column to contracts table +-- Types: 'simple' (Plan -> Execute) or 'specification' (Research -> Specify -> Plan -> Execute -> Review) + +ALTER TABLE contracts ADD COLUMN IF NOT EXISTS contract_type VARCHAR(32) NOT NULL DEFAULT 'simple'; + +-- Update existing contracts to 'simple' type (they can be manually changed if needed) +UPDATE contracts SET contract_type = 'simple' WHERE contract_type IS NULL; + +CREATE INDEX IF NOT EXISTS idx_contracts_contract_type ON contracts(contract_type); + +-- Add supervisor_task_id to contracts table if not exists +ALTER TABLE contracts ADD COLUMN IF NOT EXISTS supervisor_task_id UUID REFERENCES tasks(id) ON DELETE SET NULL; +CREATE INDEX IF NOT EXISTS idx_contracts_supervisor_task_id ON contracts(supervisor_task_id); -- cgit v1.2.3