summaryrefslogtreecommitdiff
path: root/makima/migrations
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-01-15 00:23:44 +0000
committersoryu <soryu@soryu.co>2026-01-15 00:23:47 +0000
commiteff0d844ca6e35bfbc2d5fdaa2d2f92177611f2e (patch)
tree90d87d6daf9dd78c31e4b816bb1d282db73821dd /makima/migrations
parent87044a747b47bd83249d61a45842c7f7b2eae56d (diff)
downloadsoryu-eff0d844ca6e35bfbc2d5fdaa2d2f92177611f2e.tar.gz
soryu-eff0d844ca6e35bfbc2d5fdaa2d2f92177611f2e.zip
Contract type system
Diffstat (limited to 'makima/migrations')
-rw-r--r--makima/migrations/20250115000000_add_contract_type.sql13
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);