# docker/mysql/init

Auto-run by the `db` service's `docker-entrypoint-initdb.d` mount (files execute
in filename order on first container start, against an empty data volume).

- `000_schema.sql` — reconstructed base schema (see its header comment). Not
  present anywhere else in the repo; reverse-engineered from `app/Models`,
  `app/Controllers` and `app/Services` for local dev only.
- `001`–`018` — verbatim copies of `scripts/*.sql`, renumbered into the order
  they must apply in (dependency order, not filename order — e.g. the
  `student_status_reasons` table must exist before the encoding fix that
  updates its rows). `scripts/` remains the source of truth per `CLAUDE.md`'s
  no-migration-framework convention; if you change one there, copy the change
  here too (or re-copy the file) so local dev stays in sync.
- `999_seed.sql` — minimal fixture data (one row per role, one group/lesson/
  payment) so the app is click-testable after `docker compose up`.

To re-seed from scratch: `docker compose down -v` (drops the `db_data`
volume) then `docker compose up -d db redis app` again.
