diff options
| author | soryu <soryu@soryu.co> | 2026-03-07 02:29:19 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-07 02:29:19 +0000 |
| commit | ef643072234477685614ed281e34ef77e45caad4 (patch) | |
| tree | 96562ad1b73efa0f21ea79ae571e1c8674549d31 /makima/migrations/20260303000000_create_directive_order_groups.sql | |
| parent | 0e30f1790cd3a1717dcb55ae137700de9bb0dfcb (diff) | |
| parent | ae3bc57de7a240c3c8ab15080b405e8ea3e16ccb (diff) | |
| download | soryu-ef643072234477685614ed281e34ef77e45caad4.tar.gz soryu-ef643072234477685614ed281e34ef77e45caad4.zip | |
Merge pull request #86 from soryu-co/makima/directive-soryu-co-soryu---makima-19fd3e1d-v1772803139
feat: filter contract phase orbs by type & add DOGs (directive order groups)
Diffstat (limited to 'makima/migrations/20260303000000_create_directive_order_groups.sql')
| -rw-r--r-- | makima/migrations/20260303000000_create_directive_order_groups.sql | 19 |
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); |
