summaryrefslogtreecommitdiff
path: root/makima/migrations/20260303000000_create_directive_order_groups.sql
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-03-09 16:31:31 +0000
committersoryu <soryu@soryu.co>2026-03-09 16:31:31 +0000
commite11e7225861c3063f08461ac01005f3315d41be5 (patch)
tree81c17946d8f0347c7cebf83ecd731d205983cfc7 /makima/migrations/20260303000000_create_directive_order_groups.sql
parent76566d32a88aa88e5b22e5209f9beb025ab6c299 (diff)
parentef643072234477685614ed281e34ef77e45caad4 (diff)
downloadsoryu-e11e7225861c3063f08461ac01005f3315d41be5.tar.gz
soryu-e11e7225861c3063f08461ac01005f3315d41be5.zip
fix: resolve merge conflicts with master (integrate DOG features into compact header)makima/soryu-co-soryu---makima--resolve-merge-conflicts-i-f750d00d
- Resolved conflict in OrderDetail.tsx: kept PR compact header layout with inline badges while adding DOG badge from master - DOG selector in Actions section preserved from master - orders.tsx correctly passes dogs prop to OrderDetail (auto-merged correctly) - directives.tsx auto-merged correctly with DOG props for DirectiveDetail - Frontend builds successfully with no TypeScript errors Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'makima/migrations/20260303000000_create_directive_order_groups.sql')
-rw-r--r--makima/migrations/20260303000000_create_directive_order_groups.sql19
1 files changed, 19 insertions, 0 deletions
diff --git a/makima/migrations/20260303000000_create_directive_order_groups.sql b/makima/migrations/20260303000000_create_directive_order_groups.sql
new file mode 100644
index 0000000..8a382e5
--- /dev/null
+++ b/makima/migrations/20260303000000_create_directive_order_groups.sql
@@ -0,0 +1,19 @@
+-- Directive Order Groups (DOGs): Epic-like groupings of orders within a directive.
+CREATE TABLE directive_order_groups (
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
+ directive_id UUID NOT NULL REFERENCES directives(id) ON DELETE CASCADE,
+ owner_id UUID NOT NULL REFERENCES owners(id) ON DELETE CASCADE,
+ name VARCHAR(500) NOT NULL,
+ description TEXT,
+ status VARCHAR(32) NOT NULL DEFAULT 'open'
+ CHECK (status IN ('open', 'in_progress', 'done', 'archived')),
+ created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
+ updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
+);
+
+CREATE INDEX IF NOT EXISTS idx_dog_directive_id ON directive_order_groups(directive_id);
+CREATE INDEX IF NOT EXISTS idx_dog_owner_id ON directive_order_groups(owner_id);
+
+-- Add optional dog_id to orders
+ALTER TABLE orders ADD COLUMN dog_id UUID REFERENCES directive_order_groups(id) ON DELETE SET NULL;
+CREATE INDEX IF NOT EXISTS idx_orders_dog_id ON orders(dog_id);