Skip to content

9.35.1

Choose a tag to compare

@jeremydmiller jeremydmiller released this 27 Sep 12:02
· 48 commits to master since this release
08997cf

The EF Core set: #627, #628 and #629.

📄 Upgrading to 9.35.1

⚠️ Read before upgrading if you use ComplexProperty with a Weasel-managed EF Core migration

Check those tables on your current version first — this is a bug that has already run.

A table-split ComplexProperty (one without ToJson()) was not mapped at all, on 9.35.0 and every earlier version carrying the EF bridge. Against a table EF Core itself created, a CreateOrUpdate migration emitted drop column total_amount. With PascalCase column names that failed with 42703 and aborted the migration, which is how this was found. With lowercase column names — what UseSnakeCaseNamingConvention() or an explicit HasColumnName produces — it succeeded, and the data is gone.

On a fresh database, the same gap created the table without those columns, and the first EF insert failed with 42703.

Every Weasel-managed EF migration path runs through this mapper, including Wolverine's UseEntityFrameworkCoreWolverineManagedMigrations() and its tenanted DbContext builders.

A behaviour change, in a patch release

A migration for an EF-derived table no longer drops columns, indexes or foreign keys that the EF model does not declare. That is the fix for #629 — the mapper has known translation gaps (TPC, entity splitting, temporal period columns, Npgsql enums), and reading an untranslated column as a removed one made every one of them a data-loss branch.

If you relied on a removed EF property taking its column with it, set EfSchemaMappingCustomization.AllowDrops = true. Tables you define in Weasel directly are unaffected.

Also in this release

  • PostgreSQL: a drop-column statement now names the identifier the catalog holds, instead of folding it to lowercase and failing with 42703 against a quoted PascalCase column (#627).
  • A ToJson() container column is no longer typed jsonb on every provider — SQL Server gets nvarchar(max), MySQL and SQLite TEXT, Oracle CLOB (Migrator.DefaultJsonColumnType).

New public API

ITable.AddOnlyMigrations, EfSchemaMappingCustomization.AllowDrops, ISchemaObjectDeltaWithWithheldDrops, IMigrationLogger.WithheldDrop, AddOnlyMigration, Migrator.DefaultJsonColumnType. All described in the upgrade guide.