Repository navigation
9.45.0
Two fixes for migrations that did the wrong thing to an existing database.
Full upgrade guide: https://weasel.jasperfx.net/release-9-45
Nothing public was removed and no signature changed, but three behaviours did; see the guide's "What changes for you".
db-patch drop files leave untouched schemas alone: #706 / #708
WriteMigrationFileAsync wrote CREATE SCHEMA and, in the drop file, drop schema if exists ... CASCADE for every schema the application knows about. Running that drop file as a rollback destroyed schemas the patch never touched.
- The patch creates only the schemas of the objects it changes (new
SchemaMigration.ChangedSchemas). ⚠️ The drop file never drops a schema. It rolls back each object the patch touched.
Adding and removing primary keys on existing tables: #707 / #708
Reported from Wolverine (JasperFx/wolverine#4989), whose SQL Server queue tables switch between a clustered primary key and a clustered IDENTITY column.
⚠️ PrimaryKeyNameis empty for a table without primary key columns, unless set explicitly.- SQL Server can add an
IDENTITYcolumn to an existing table, drops a removed primary key before creating the new clustered index, and makes a new key's columnsNOT NULLfirst. - Removing a primary key no longer writes
add CONSTRAINT ... PRIMARY KEY ()(SQL Server, PostgreSQL, Oracle). ⚠️ Adding a primary key to an existing table reportsPrimaryKeyDifference.Create, and the migration now actually adds it. It used to be a table-levelCreatethat wrote onlyCREATE TABLE IF NOT EXISTS(SQL Server, PostgreSQL, Oracle).