Skip to content

9.39.0

Choose a tag to compare

@jeremydmiller jeremydmiller released this 04 Oct 12:22
· 16 commits to master since this release
1b38923

An eighth provider — Weasel.Firebird, for Firebird 3, 4 and 5 — and a SQL Server migration fix for anyone who has seen Invalid column name out of an apply.

Full notes: https://weasel.jasperfx.net/release-9-39

⚠️ SQL Server: adding a column and an expression over it failed, and rolled nothing back

#668, reported by @peejayess through Wolverine.

SQL Server compiles a whole batch before running any of it and binds column names at compile time, so a CREATE INDEX … WHERE ([expires] IS NOT NULL) in the same batch as the ALTER TABLE … ADD expires failed with error 207 — and the ALTER never ran either.

The line is expression versus name list, not indexes: a filtered index's predicate, a check constraint and a computed column all failed, while an index's key columns, its INCLUDE list and a foreign key's columns always worked. A plain index on a new column was fine, which is what hid this. Two of the three failing cases were beyond the original report.

SQL Server: a rollback now undoes check-constraint changes

#670.

WriteRollback had no check-constraint handling at all, so a rolled-back migration left an added constraint in place and a replaced expression permanently replaced. If you have rolled one back, the table is not what your model says and no delta will tell you — an undeclared actual constraint is filtered out of the comparison. Read sys.check_constraints.

New: Weasel.Firebird

#666, contributed by @lahma — Firebird 3, 4 and 5 at parity with Weasel.MySql, with EF Core support and CI on all three majors.

dotnet add package Weasel.Firebird

Two new Core hooks came with it, both virtual with the previous behaviour as the default: Migrator.FingerprintTableName and Migrator.OrderRollbacks.

Upgrading

One change in rendered output: a SQL Server table delta that changes a column now carries GO batch separators. Weasel's executors and sqlcmd both split on them, so the normal path is unaffected. If you hand TableDelta.WriteUpdate output to a single SqlCommand yourself, split it first with SqlServerBatchSplitter.Split(sql) — the same adjustment stored procedure DDL needed in 9.35.

Coming from 9.37 or earlier? 9.38.0 shipped to NuGet without notes; its page is now written at https://weasel.jasperfx.net/release-9-38 and it carries a deliberate change to what an Oracle migration reports about identity columns.