diff options
Diffstat (limited to 'makima/migrations')
| -rw-r--r-- | makima/migrations/20250115000000_add_contract_type.sql | 13 |
1 files changed, 13 insertions, 0 deletions
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); |
