diff options
Diffstat (limited to 'makima/migrations')
| -rw-r--r-- | makima/migrations/20260215100000_add_directive_goal_history.sql | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/makima/migrations/20260215100000_add_directive_goal_history.sql b/makima/migrations/20260215100000_add_directive_goal_history.sql new file mode 100644 index 0000000..1636110 --- /dev/null +++ b/makima/migrations/20260215100000_add_directive_goal_history.sql @@ -0,0 +1,9 @@ +CREATE TABLE directive_goal_history ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + directive_id UUID NOT NULL REFERENCES directives(id) ON DELETE CASCADE, + goal TEXT NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +CREATE INDEX idx_directive_goal_history_directive_id ON directive_goal_history(directive_id); +CREATE INDEX idx_directive_goal_history_created_at ON directive_goal_history(directive_id, created_at DESC); |
