SchemaQuench turns fragile, step-by-step scripts into safe, declarative releases-so every deployment is boring, predictable, and fast.
SchemaQuench is a state-based, opinionated database migration tool inspired by the principles of infrastructure-as-code tools like HashiCorp's Terraform. It enables you to define the desired end state of your SQL Server databases using metadata and applies these definitions to target servers, ensuring consistency and repeatability across environments. We refer to this process as quenching.
Traditional migration scripts track changes over time but can become cumbersome and error-prone, especially in complex environments. SchemaQuench offers a declarative approach, focusing on the desired final state rather than the sequence of changes. This methodology:
TemplateOrder contains all your templates in the order they need to be
quenched.
template.json to find the
correct database(s) to apply against, along with version validation and stamping scripts.
You can use Command Line Options to specify the log file location or an alternate config file.
See the SchemaQuench Walkthrough to help you get started with the tool.
Start by defining a small subset of your database objects. Gradually expand as you gain confidence, ensuring that each step is manageable and verifiable.
Say you are widening a column from VARCHAR(5) to VARCHAR(10).
On the surface, that is a simple alter table script, however, what if that column
participates in:
In that case, you have to drop those constructs, make your change and then put them back on. That is a lot of bookkeeping for a simple change. Why bother? SchemaQuench can handle all of that for you. You widen the column in the table's json, SchemaQuench handles the dependencies. For more details about the quenching process see Forge Deeper with SchemaQuench.
We now support renaming tables and columns. See defining tables for more details.