Files
CatoandClaude 3e68dcb9aa fix(db): the migration chain replays onto an empty database as committed (#192)
0032_chilly_shatterstar re-added six columns that 0029_team_participation
already added (invitations/memberships.permission_preset,
users.location/languages/skills/availability_type), so a fresh install that
applies the files as written stopped at 0032. Those six statements now read
ADD COLUMN IF NOT EXISTS; the definitions in 0029 and 0032 are identical,
so nothing is lost by skipping them.

Safe on production: the deploy's applier (loki apply-schema.sh) already
rewrites every ADD COLUMN to ADD COLUMN IF NOT EXISTS before running a
file, so the SQL it would run for 0032 is byte-identical before and after
this change (same sha256), and it never re-runs a tag already in
_deploy_schema_history anyway. Drizzle's own migrator compares only the
journal timestamp, which is unchanged.

scripts/ci/apply-migrations.sh drops its ADD COLUMN rewrite and applies
the committed files verbatim, so CI now catches a migration that only
replays with help.


Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 12:16:42 +01:00
..