fix(db): move clan_members table definition before data migrations (#82) - #127
Conversation
Code Review ✅ Approved 1 resolved / 1 findingsReorders schema definitions and constraints in api/schema.sql to execute before dependent data migrations, addressing the psql meta-command driver compatibility issue. No issues found. ✅ 1 resolved✅ Bug: psql meta-command \set breaks driver-based migration
OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Important Your trial ends in 7 days — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more. Was this helpful? React with 👍 / 👎 | Gitar |
Closes #82
Summary of Changes
Reorders table creations and constraints in
api/schema.sqlso thatclan_members, foreign keys, and indexes are created before executing data migration queries that queryclan_members.Features & Deliverables
CREATE TABLE IF NOT EXISTS clan_members,ALTER TABLE characters ADD COLUMN IF NOT EXISTS clan_id, constraints, and indexes before the member compatibility alignment cleanup CTEs.\set ON_ERROR_STOP onat the beginning ofapi/schema.sqlto prevent schema execution from silently continuing if errors occur.IF NOT EXISTS/DROP CONSTRAINT IF EXISTSguards.