54360d6f3b
Workflow run 26564909645 failed: migration 2026_05_27_120000_create_project_routing_snapshots_table hit 'SET ROLE crm_migrator' failure (pgsql conn = crm_app_user, not member of crm_migrator). Failed SET ROLE poisoned transaction → subsequent CREATE TABLE failed SQLSTATE[25P02]. Fix in deploy.yml: New step 'Pre-apply partitioned migrations via postgres superuser' runs CREATE TABLE + indexes + RLS + GRANTs + partitions + system_settings insert via sudo -u postgres psql, then marks migration as ran in migrations table. Idempotent (checks both migrations table AND information_schema). Established prod pattern (memory: paused_at migration 26.05). Side fix in tools/enforce-override-limit.test.mjs: CLI e2e tests used 'node tools/enforce-override-limit.mjs' without cwd, failed when vitest ran from app/. Added cwd: projectRoot via fileURLToPath(import.meta.url). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>