Skip to content

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 EXISTS before 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 ​

  1. Add or modify a migration
  2. Update seeds if needed
  3. Re-export the SQL baseline
  4. Restore into an empty database to verify consistency

Next steps ​