Description
Upgrading from v0.18.0 (or any earlier release) to v0.19.0 fails on startup with:
Error: Migration failed: applied migration V6__routines is different than filesystem one V6__routines
Root Cause
PR #1151 modified the already-applied V6__routines.sql migration in place, changing:
-- v0.18.0 (sha 36f63cb, 2930 bytes)
notify_user TEXT NOT NULL DEFAULT 'default',
to:
-- v0.19.0 (sha 9697251, 2903 bytes)
notify_user TEXT,
The PR also correctly added V13__owner_scope_notify_targets.sql to handle the schema change incrementally for existing databases. However, because V6 was also modified, refinery's checksum validation rejects the upgrade before V13 can run.
The PR body acknowledges this under Database Impact:
Adds migrations/V13__owner_scope_notify_targets.sql and updates fresh-schema migrations/V6__routines.sql so routines.notify_user can be NULL.
This works for fresh installs but breaks every existing PostgreSQL database upgrading to v0.19.0.
Steps to Reproduce
- Install IronClaw v0.18.0 (or earlier) with PostgreSQL backend
- Run it at least once so migrations V1–V12 are applied
- Replace the binary with v0.19.0
- Start IronClaw — fails immediately with the checksum error
Expected Behavior
Upgrade from v0.18.0 to v0.19.0 should apply V13 incrementally without touching the checksum of already-applied migrations.
Suggested Fix
Revert V6__routines.sql to its v0.18.0 content (sha 36f63cb). The V13__owner_scope_notify_targets.sql migration already handles the schema change correctly for both existing and fresh databases (since ALTER COLUMN DROP NOT NULL is a no-op if the column is already nullable).
Environment
- IronClaw v0.18.0 → v0.19.0 upgrade
- PostgreSQL 16 + pgvector 0.8.0
- Platform: aarch64 Linux (NVIDIA DGX Spark)
- Database backend: PostgreSQL (refinery migrations)
Description
Upgrading from v0.18.0 (or any earlier release) to v0.19.0 fails on startup with:
Root Cause
PR #1151 modified the already-applied
V6__routines.sqlmigration in place, changing:to:
The PR also correctly added
V13__owner_scope_notify_targets.sqlto handle the schema change incrementally for existing databases. However, because V6 was also modified, refinery's checksum validation rejects the upgrade before V13 can run.The PR body acknowledges this under Database Impact:
This works for fresh installs but breaks every existing PostgreSQL database upgrading to v0.19.0.
Steps to Reproduce
Expected Behavior
Upgrade from v0.18.0 to v0.19.0 should apply V13 incrementally without touching the checksum of already-applied migrations.
Suggested Fix
Revert
V6__routines.sqlto its v0.18.0 content (sha36f63cb). TheV13__owner_scope_notify_targets.sqlmigration already handles the schema change correctly for both existing and fresh databases (sinceALTER COLUMN DROP NOT NULLis a no-op if the column is already nullable).Environment