summaryrefslogtreecommitdiff
path: root/makima/migrations
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-01-24 18:11:41 +0000
committersoryu <soryu@soryu.co>2026-01-24 18:11:41 +0000
commit792d12df6b1b1bc4f327cbe8e71e7986c67e98f6 (patch)
tree5fb72a12a6f1903a6294d42d933c0be5f5e50095 /makima/migrations
parent4ea35373c08ca7c212dbc7739901168ee4b30753 (diff)
downloadsoryu-792d12df6b1b1bc4f327cbe8e71e7986c67e98f6.tar.gz
soryu-792d12df6b1b1bc4f327cbe8e71e7986c67e98f6.zip
Fix history and add retries to makima CLI
Diffstat (limited to 'makima/migrations')
-rw-r--r--makima/migrations/20250124000000_fix_history_events_owner_fk.sql12
1 files changed, 12 insertions, 0 deletions
diff --git a/makima/migrations/20250124000000_fix_history_events_owner_fk.sql b/makima/migrations/20250124000000_fix_history_events_owner_fk.sql
new file mode 100644
index 0000000..1f97779
--- /dev/null
+++ b/makima/migrations/20250124000000_fix_history_events_owner_fk.sql
@@ -0,0 +1,12 @@
+-- Fix history_events owner_id foreign key
+-- The owner_id should reference owners(id), not users(id)
+-- This was causing all history event inserts to fail silently
+
+-- Drop the incorrect foreign key constraint
+ALTER TABLE history_events
+ DROP CONSTRAINT IF EXISTS history_events_owner_id_fkey;
+
+-- Add the correct foreign key constraint referencing owners
+ALTER TABLE history_events
+ ADD CONSTRAINT history_events_owner_id_fkey
+ FOREIGN KEY (owner_id) REFERENCES owners(id) ON DELETE CASCADE;