Skip to content

9.44.0

Choose a tag to compare

@jeremydmiller jeremydmiller released this 12 Oct 02:25
· 198 commits to master since this release
3ce4f52

One change: a SQL Server function's creation script can be run more than once.

Full upgrade guide: https://weasel.jasperfx.net/release-9-44

Nothing public was removed and no signature changed.

SQL Server functions survive a re-run of a creation script: #703 / #704

Weasel.SqlServer.Functions.Function rendered a bare CREATE FUNCTION, so a generated script containing a function failed on its second run with "There is already an object named ...". Every other object in a script survives a re-run, and Trigger had this exact problem first.

  • WriteCreateStatement now drops the function if it exists, then creates it, the same as Trigger.
  • New: Function.CreateStatement() renders the create alone.
  • ⚠️ FunctionDelta now compares CreateStatement() rather than Body(). Body() renders through WriteCreateStatement, so it now carries the drop, and a function read back from the database always gets the default drop statement. Comparing Body() would have reported a function declared with custom drop statements as changed on every migration. A test pins it.

A function's creation script now begins with its drop. That fails for a function referenced WITH SCHEMABINDING, which the update path, already drop-then-create, would hit anyway.