db: schema migration convention #7

Open
opened 2026-11-15 22:24:07 -05:00 by forgejo_admin · 2 comments
Owner

Production holds real data, so after the first deploy the schema only changes forward.

  • migrations run as dongba_migrator (OpenBao dongba/mariadb-migrator, DDL on dongba* only), which therefore owns every procedure, view and trigger: routines execute with its rights, never root's. The app account stays DML + EXECUTE
  • db/migrations/NNNN_<summary>.sql + schema_migrations table (version, checksum, applied_at)
  • Runner: a small script/Job using the mariadb client (DELIMITER-aware), idempotent, refuses edited migrations
  • db/0*.sql stays the full current schema (course deliverable); a CI check proves 0*.sql == baseline + migrations
  • Documented in docs/development.md

Conventions — CLAUDE.md and PLAN.md at the repo root.

Production holds real data, so after the first deploy the schema only changes forward. - [ ] migrations run as `dongba_migrator` (OpenBao `dongba/mariadb-migrator`, DDL on dongba* only), which therefore owns every procedure, view and trigger: routines execute with its rights, never root's. The app account stays DML + EXECUTE - [ ] `db/migrations/NNNN_<summary>.sql` + `schema_migrations` table (version, checksum, applied_at) - [ ] Runner: a small script/Job using the `mariadb` client (DELIMITER-aware), idempotent, refuses edited migrations - [ ] `db/0*.sql` stays the full current schema (course deliverable); a CI check proves `0*.sql` == baseline + migrations - [ ] Documented in docs/development.md **Conventions** — CLAUDE.md and PLAN.md at the repo root.
Collaborator

@liam @yuuhikaze this issue blocks #32 and has not been started (16 h).

— automation (scripts/watch.py)

@liam @yuuhikaze this issue blocks #32 and has not been started (16 h). — automation (scripts/watch.py) <!-- watch:ready:2026-11-17T00:00:00+00:00:1 -->
Collaborator

@liam @yuuhikaze this issue blocks #32 and has not been started (32 h). Escalated to #40.

— automation (scripts/watch.py)

@liam @yuuhikaze this issue blocks #32 and has not been started (32 h). Escalated to #40. — automation (scripts/watch.py) <!-- watch:ready:2026-11-17T00:00:00+00:00:2 -->
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
k8s-services/dongba#7
No description provided.