Environment overlays can declare schema again. Database objects declared in *.env.<name>.sql will now join the project alongside the base files, restoring the v4 behavior.
apply and destroy capture the live schema before planning. Before the plan step of apply and destroy, the state is now refreshed. This helps capture drift and also bootstraps the state before a first apply, which is particularly helpful when using the ephemeral store. Replaying a saved plan with --plan-file is unaffected, since its statements were fixed when the plan was written.
Multi-line doc comments indent correctly. Every line of a --- doc comment on a column or setting now takes the member indent, rather than only the first.
A state payload with no captured schema is rejected. Reading one now fails as an unreadable payload, instead of throwing an NRE.
Lockfiles are updated additively. Pinning package version now no-longer clobbers packages that weren’t in the updated list, so initializing plugins for one environment won’t remove pins for a different environment.
Full dependency graph support. Updated to NSchema.Core 5.6.0, which refactors the linearizer to be built entirely from the dependency graph.
Fixed
Imported SQL Server projects read back. Inherits NSchema.Core 5.5.1: multi-statement routine definitions and view bodies survive the import round trip via dollar-quoted bodies, and trailing line comments no longer swallow the closing tokens.
Engine-native SQL bodies no longer show as permanent drift. Inherited from NSchema.Core 5.5.0, hand-written and database-written provider-native SQL (things like view bodies or trigger definitions) are now stored in the state so they can be diffed like-for-like.
Aggregate support.CREATE AGGREGATE is part of the language (inherited from NSchema.Core 5.4.0).
Plugin restore honors your project’s NuGet configuration. Plugin resolution and restore now run under the project directory, so a NuGet.Config beside the project applies as expected.
Fixed
Functions that call each other now apply in the right order. Inherited from NSchema.Core 5.4: a routine’s definition is scanned for the routines it calls and the objects it reads, and creates are ordered so a callee precedes its caller.
Plugin restore works inside a repository using central package management. Only your NuGet configuration reaches the restore now; a Directory.Packages.props (or Directory.Build.props) further up the tree no longer breaks it with NU1008.
A create is a create. Built on NSchema.Core 5.3: a plan that believes it is creating a routine or view now renders a plain CREATE, so colliding with an object the plan didn’t know about fails loudly instead of being silently overwritten; the in-place forms render only when the plan knows it is replacing.
Fixed
Rebuilding a schema whose functions reference its tables. Routines are now created after the tables they may reference, so applying an imported schema with SQL-language functions (e.g. Pagila) no longer fails with a missing relation.
Plans verify type references. Inherited from NSchema.Core 5.2.0, a plan now checks that every type the project references will exist once it applies.
Fixed
Schema-qualified engine types no longer block planning. Applying an imported project that referenced engine types (e.g. Postgres’s pg_catalog.tsvector) previously failed with an error demanding a declaration nobody could write.
Implicit schemas are now ignored. Schemas owned by the database (dbo, public, main, etc.) will now be ignored during import and planning.
Fixed
Plugin dependencies are not shared correctly. All plugin dependencies will now be correctly loaded from their own dependency closure where the CLI does not have its own version of an assembly.
--destructive-actions argument is ignored. Policy enforcement overrides like --destructive-actions and --data-hazards weren’t being respected due to a bug in Core. This is fixed after updating to 5.0.1.