migration.sql and migration.md are generated artifacts.
- Raw input schemas:
schemas/{database}/*.sql - Declarative rules:
spec.yaml - Generator:
generate_migration.py - Optional shard-key reference SQL for distributed tables (configured in
spec.yaml) - Parity special-cases are defined directly in
spec.yamlundercolumns.definition_overrides
python generate_migration.pyThis rewrites:
migration.sqlmigration.md
python generate_migration.py --check--check exits non-zero if committed files differ from generated output.
python dump_schemas.py --host localhost --port 8123Writes source DDL files into schemas/.
Rules are applied in this order:
- Exact table overrides (
rules.tablesstyle maps inspec.yaml) - Pattern/group rules (database/table family rules)
- Global defaults
In other words: table-specific settings always win over generic settings.
Given identical schemas/ and spec.yaml, the generator must produce byte-identical output files.