fix: correct chat_histories FK to reference projects(guid) #3
Reference in New Issue
Block a user
Delete Branch "fix/chat-history-fk"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #2
Problem
chat_histories.project_idwas referencingprojects(id)which is abigserial, causing an error when trying to insert with a UUID project reference.Fix
migrations/019_fix_chat_histories_fk.sql— drops and recreates the FK constraint pointing toprojects(guid)on existing deploymentsmigrations/018_chat_histories.sql— corrected for fresh installsNo need for the fix in migrations/019_fix_chat_histories_fk.sql . I dropped the bugged table manually.
Removed migration 019 — since the table was dropped manually,
018_chat_histories.sql(now with the correctprojects(guid)FK) will recreate it cleanly on the next migration run.