summaryrefslogtreecommitdiff
path: root/makima/migrations
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-01-25 02:19:01 +0000
committersoryu <soryu@soryu.co>2026-01-25 02:19:01 +0000
commita4c5e9a601b49d08e5ef3d7a36cdd29372ce2003 (patch)
tree061a880c6ea2cd3bee2fa80137a2e7e3bf3ec6fb /makima/migrations
parent1f223e55be79805bb1061213db4351925bc0b368 (diff)
parent2003544969e5b7248ecd242b5cec50b324fa751b (diff)
downloadsoryu-makima/files-under-contracts-combined.tar.gz
soryu-makima/files-under-contracts-combined.zip
Merge origin/master into makima/files-under-contracts-combined - resolve import conflictsmakima/files-under-contracts-combined
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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;