Version: dataprovidermigrate 0.9.12-beta (dotnet tool)
Repro (live prod DB, TradiSite project):
Schema YAML declares e.g.:
foreignKeys:
- columns: [org_id]
referencedTable: orgs
onDelete: Cascade
The live DB has the same FK but with ON DELETE NO ACTION (created by an older schema rev).
Actual:
Migration completed successfully
SCHEMA INTEGRITY CHECK FAILED
public.sites: foreign key FK_public.sites_org_id on delete expected Cascade but found NoAction
public.domain_configs: foreign key FK_public.domain_configs_site_id on delete expected Cascade but found NoAction
public.usage_tracking: foreign key FK_public.usage_tracking_site_id on delete expected Cascade but found NoAction
Exit code 1. Every subsequent run does exactly the same — the migrator plans zero operations for the mismatched FKs, so the tool can never converge the DB to the declared schema. The verifier knows precisely what is wrong; the planner ignores it.
Expected: the migrator should emit drop+recreate (or ALTER) of the FK with the declared referential action, so a second run passes. Detect-but-never-repair makes migrate permanently red on any DB that predates an onDelete change.
Workaround used: manual ALTER TABLE ... DROP CONSTRAINT / ADD CONSTRAINT ... ON DELETE CASCADE via psql, after which the integrity check passes.
Found while operating TradiSite prod (MelbourneDeveloper/TradiSite, spec [DB-MIGRATE-CLI-ONLY]).
Version: dataprovidermigrate 0.9.12-beta (dotnet tool)
Repro (live prod DB, TradiSite project):
Schema YAML declares e.g.:
The live DB has the same FK but with
ON DELETE NO ACTION(created by an older schema rev).Actual:
Exit code 1. Every subsequent run does exactly the same — the migrator plans zero operations for the mismatched FKs, so the tool can never converge the DB to the declared schema. The verifier knows precisely what is wrong; the planner ignores it.
Expected: the migrator should emit drop+recreate (or ALTER) of the FK with the declared referential action, so a second run passes. Detect-but-never-repair makes
migratepermanently red on any DB that predates an onDelete change.Workaround used: manual
ALTER TABLE ... DROP CONSTRAINT / ADD CONSTRAINT ... ON DELETE CASCADEvia psql, after which the integrity check passes.Found while operating TradiSite prod (MelbourneDeveloper/TradiSite, spec [DB-MIGRATE-CLI-ONLY]).