Repository navigation
Weasel 9.25.2
Two changes that had been sitting on master since 9.25.1. Full notes: Upgrading to 9.25
⚠️ A check constraint is now refused where it used to be ignored
#488.
TableBase.CheckConstraints is on the shared base, so every provider's Table accepted a check constraint. Only PostgreSQL and SQL Server ever wrote one into the DDL. On Oracle, MySQL and SQLite the constraint sat in the model, never reached the database, and was never compared during delta detection either — so you got a table without the constraint you asked for and nothing said so.
Both entry points now throw on those three:
table.AddCheckConstraint("ck_orders_qty", "quantity > 0"); // NotSupportedException
table.CheckConstraints.Add(new TableCheckConstraint("ck", "quantity > 0")); // NotSupportedExceptionThe collection refuses as well as the method — adding to it directly is the more common spelling, and throwing from only one would have left the silent path open.
If you call either on Oracle, MySQL or SQLite you now get an exception where you previously got silence. Nothing of value is lost: the constraint was never created either way. But the failure moves from invisible to loud, which is the point of the change, and it is a runtime exception that did not exist before.
All three engines do support check constraints — Weasel does not emit them there yet. The message says so and points at the issue, rather than implying the engine cannot do it.
This is the rule #449 settled, applied to the one place it had been missed. It was missed because the property lives on TableBase rather than on each provider's own type, so there was no per-provider surface to audit.
Oracle deltas share one implementation
#492.
Six Oracle object types — views, triggers, stored procedures, packages, synonyms and functions — had each written out the same delta class after hitting the same failure separately. They now share OracleReplaceDelta. 209 lines removed, 40 added.
No behaviour change, and nothing to do on upgrade. Five of the six replaced classes were internal; the public Weasel.Oracle.Functions.FunctionDelta stays and delegates to the shared rule.
The rule itself is worth stating correctly, because the shorthand was wrong. It is not "one statement per delta" — a package legitimately emits its specification, a /, and then its body, and the migrator runs two commands. It is do not prefix anything to the create: Oracle has no DROP … IF EXISTS before 23c, so every drop is an anonymous PL/SQL block, and one written immediately before a CREATE OR REPLACE reaches ODP.NET as a block followed by DDL in a single command — PLS-00103.
Upgrading
Everything in 9.25.0 and 9.25.1 still applies. If you are coming from 9.24, read those first — 9.25.1 in particular, which fixes a regression that refuses to create tables 9.24 accepted.