Migrations
Covers migration authoring, seed data and the SQL baseline relationship.
Migration conventions
- Files are timestamp-named and registered in
bootstrap/migrations.go - Migrations must be idempotent; repeated execution is safe
- Use
DROP CONSTRAINT IF EXISTSbefore adding constraints - With dirty data, add constraints as
NOT VALID, clean up, then validate
Seed data
Seeders run after migrations to initialize accounts, roles, capability codes and dictionaries. Seeds initialize state only and carry no business data.
SQL baseline
deploy/sql/missmeow_admin_baseline.sql is a snapshot of schema and seed data for fast setup and verification. It must stay consistent with migrations and seeders:
- 43 tables
- 20 business migrations
- 7 seed files, 8 seeders
Change workflow
- Add or modify a migration
- Update seeds if needed
- Re-export the SQL baseline
- Restore into an empty database to verify consistency
