Skip to content

9.33.0

Choose a tag to compare

@jeremydmiller jeremydmiller released this 22 Sep 19:24
· 62 commits to master since this release
95ab23d

An exception sweep. Eight issues (#595–#602) about what Weasel says when something goes wrong, plus JasperFx 2.74.0. No migration behaves differently, and no DDL changes.

πŸ“– Full upgrade guide

Three failures change their exception type

Source-compatible, and all three keep the original exception as InnerException β€” but a catch written against the old type stops matching.

Failure Was Now
A role lacking privilege during a migration the raw PostgresException / SqlException / MySqlException / OracleException InsufficientDatabasePrivilegeException
sp_getapplock refusing the SQL Server migration lock a bare System.Exception GlobalLockUnavailableException
AssertDatabaseMatchesConfigurationAsync on drift that cannot be applied incrementally SchemaMigrationException DatabaseValidationException

If you match on a SQLSTATE β€” catch (PostgresException e) when (e.SqlState == "42501") is the common one β€” read the upgrade guide first.

Highlights

  • Permission failures are named (#598). The most common real-world migration failure used to surface as a SQLSTATE in an inner exception. InsufficientDatabasePrivilegeException names the role, the database, the refused statement, and the two remedies. Covers PostgreSQL, SQL Server, MySQL and Oracle. Introspection being privilege-filtered β€” which makes a restricted role look at an empty database β€” is now called out by db-assert, and the docs gain a Permissions section.
  • The migrator warns before it drops a table (#600). AutoCreate.All's drop-and-recreate is the only branch in the migrator that destroys data, and nothing announced it. It now warns once per object before any statement runs, naming why the change could not be applied in place. New Migrator.RefuseDestructiveChanges (default off) refuses the branch outright.
  • sp_getapplock return codes are decoded (#599), the lock timeout is configurable at last, and SQL Server gains an IGlobalLock implementation so ResourceMigrationFailureMode.ContinueOnFailures means the same thing on both providers.
  • Assert reports drift as drift (#601) even when it cannot be applied incrementally.
  • A numeric-revision ConcurrencyException always carries the UpdateRevision hint (#595) β€” one throw site, so this fixes Marten, Polecat and Fisher at once.
  • The rich per-event append gains an exception-transform hook (#596), so a dialect can translate a version conflict with the StreamAction in hand instead of parsing redacted provider error detail.
  • Six user-facing message defects (#602), and the AutoCreate documentation corrected (#597) β€” None does not throw, and CreateOrUpdate does drop columns the model no longer declares.