Understand the terminology behind state-based database migrations
A database deployment approach where you define the desired end-state of your schema, and the tool automatically calculates and applies the necessary changes.
How it works: You describe what your database should look like (declarative), not how to change it (imperative). SchemaSmith compares your definition to the actual database and generates the required DDL.
What it gives you:
The folder structure that organizes your database metadata: a Product definition at the root, one or more Templates underneath, and tables stored as JSON files with programmable objects as SQL scripts.
Contains:
A collection of templates with validation rules and deployment ordering. Defines how multiple database schemas are deployed together.
Contains:
A reusable metadata definition representing a database schema. One template can be applied to multiple databases.
Use case: You have 50 customer databases with identical structure. Define one template, and SchemaQuench applies it to all 50 databases in parallel.
Think of a template as a "class" and each database as an "instance" of that class.
Learn MoreThe process of extracting an existing database schema into metadata files. SchemaTongs performs casting.
Terminology:
The forge metaphor: Just as a blacksmith casts molten metal into a mold, SchemaTongs "casts" your database structure into structured metadata files.
Learn MoreThe process of applying metadata to target databases, generating and executing required DDL changes. SchemaQuench performs quenching.
Terminology:
The forge metaphor: Just as a blacksmith quenches hot metal to harden it, SchemaQuench "quenches" your metadata into a hardened, production-ready database.
Learn MoreSQL scripts that run before or after template updates. Used for tasks that can't be handled by automatic schema comparison.
Common uses:
When a database's actual state differs from the defined metadata. Drift occurs when changes are made directly to a database outside of the normal deployment process.
SchemaSmith handles drift by:
Variables that are replaced at deployment time, allowing environment-specific configuration without changing the metadata itself.
Example: Use {{DatabaseName}} in scripts, and it gets replaced with the actual database name during quenching.
Token types:
A dry-run mode that performs the full deployment logic — validation, token replacement, DDL generation, dependency resolution — without executing any changes against the database.
Use cases:
CLI tool that extracts (casts) existing database schemas into metadata files.
CLI tool that deploys (quenches) metadata to databases, generating required DDL.
| Term | Definition | Related |
|---|---|---|
| State-Based Migration | Define desired end-state; tool calculates and applies the diff | Declarative vs Imperative |
| Schema Packages | Folder structure organizing database metadata: Product, Templates, Tables as JSON, SQL scripts | Schema Packages |
| Product | Collection of templates with deployment config and ordering | Products & Templates |
| Template | Reusable database definition applied to multiple databases | Products & Templates |
| Casting | Extracting existing schema into metadata files (SchemaTongs) | SchemaTongs |
| Quenching | Applying metadata to target databases (SchemaQuench) | SchemaQuench |
| Migration Scripts | SQL scripts that run before/after template updates | Migration Scripts |
| Drift | When database state differs from defined metadata | Database Schema Drift |
| Script Tokens | Variables replaced at deployment time for environment config | Script Tokens |
| SchemaTongs | CLI tool that extracts database schemas to metadata | Walkthrough |
| SchemaQuench | CLI tool that deploys metadata to databases | Walkthrough |
| DataTongs | CLI tool that exports seed data as synchronization scripts | Walkthrough |
| WhatIf Mode | Dry-run deployment preview without executing changes | CI/CD Integration |
Last reviewed May 2026 by the SchemaSmith Team.