Files
move-data-nas/internal/db/migrations/0007_schema_migrations_checksum.sql
darroyo f5d3ecfbf3 db: fix migration for existing schema_migrations without checksum column
- Add 0007 migration to ALTER TABLE adding checksum column
- Make migration runner INSERT conditional: if checksum col exists, use it; otherwise omit
- Handles existing databases (no checksum col) and fresh installs (has checksum col) correctly
2026-07-19 22:18:06 -04:00

8 lines
400 B
SQL

-- Migration 0007: Add checksum column to schema_migrations.
-- This migration is idempotent and safe to re-run.
-- For existing databases (pre-1.0.54): ALTER TABLE adds the checksum column.
-- For fresh databases (1.0.54+): 0001_init.sql now creates the table with checksum column.
-- This migration handles the upgrade path only.
ALTER TABLE schema_migrations ADD COLUMN checksum TEXT DEFAULT '';