feat: bootstrap dongba (schema, contract, docs, plan) #41

Merged
forgejo_admin merged 7 commits from feat/bootstrap into master 2026-11-16 05:01:25 -05:00
Owner

Bootstraps dongba: database, API contract, docs, plan and agent guide. Issues #1–#40 track everything that follows.

Database (db/)

  • 18 core tables, 6 associative tables (M:N) and 7 dictionaries, all in BCNF
  • UUIDv7 keys in BINARY(16); the SQL is portable across MariaDB 11 and MySQL 8.4
  • 11 views (8 back PDF reports) and 28 transactional procedures (EXIT HANDLER → ROLLBACK; RESIGNAL)
  • Triggers enforce invariants (last owner, folder tree, job state machine) and write the activity feed and notifications
  • Render queue on FOR UPDATE SKIP LOCKED with worker leases
  • Demo seed fills every table through the same procedures the api will call
  • db/build.sh bundles it all into db/dongba.sql (course deliverable, Workbench import)
  • Already applied on the server: dongba (schema only) and dongba_test (schema and demo data)

Contract — openapi.yaml v0 covering identity, projects, files, revisions, sharing, teams, review, rendering, templates and reports. Passes redocly lint.

Docs — architecture, data model (mermaid ER per domain, cardinalities, BCNF argument, views, procedures, triggers, Workbench steps), operations, development, reference, design, AI usage log. Compiled to docs-html/ with tern.

Process — PLAN.md (milestones, dependency graph, board, issue conventions, decisions) and CLAUDE.md (coordination channel #40, Forgejo API with kanban moves, workflow, DB/backend/frontend rules, headless Chrome UI verification, docs standard, AI disclosure).

Verification

  • Full schema and seed loaded on a throwaway MariaDB 11.4; every view queried
  • Guards checked: last-owner removal, role checks, job transitions, path traversal (and its rollback), share-link role cap
  • Mermaid diagrams render in headless Chrome (5 ER, 1 state)
  • Not yet run on MySQL 8.4; CI (#2) and the test suite (#6) cover that

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q7bU4Kec4w6pVqigbajupv

Bootstraps dongba: database, API contract, docs, plan and agent guide. Issues #1–#40 track everything that follows. **Database (`db/`)** - 18 core tables, 6 associative tables (M:N) and 7 dictionaries, all in BCNF - UUIDv7 keys in `BINARY(16)`; the SQL is portable across MariaDB 11 and MySQL 8.4 - 11 views (8 back PDF reports) and 28 transactional procedures (`EXIT HANDLER → ROLLBACK; RESIGNAL`) - Triggers enforce invariants (last owner, folder tree, job state machine) and write the activity feed and notifications - Render queue on `FOR UPDATE SKIP LOCKED` with worker leases - Demo seed fills every table through the same procedures the api will call - `db/build.sh` bundles it all into `db/dongba.sql` (course deliverable, Workbench import) - Already applied on the server: `dongba` (schema only) and `dongba_test` (schema and demo data) **Contract** — `openapi.yaml` v0 covering identity, projects, files, revisions, sharing, teams, review, rendering, templates and reports. Passes redocly lint. **Docs** — architecture, data model (mermaid ER per domain, cardinalities, BCNF argument, views, procedures, triggers, Workbench steps), operations, development, reference, design, AI usage log. Compiled to `docs-html/` with tern. **Process** — PLAN.md (milestones, dependency graph, board, issue conventions, decisions) and CLAUDE.md (coordination channel #40, Forgejo API with kanban moves, workflow, DB/backend/frontend rules, headless Chrome UI verification, docs standard, AI disclosure). **Verification** - Full schema and seed loaded on a throwaway MariaDB 11.4; every view queried - Guards checked: last-owner removal, role checks, job transitions, path traversal (and its rollback), share-link role cap - Mermaid diagrams render in headless Chrome (5 ER, 1 state) - Not yet run on MySQL 8.4; CI (#2) and the test suite (#6) cover that 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Q7bU4Kec4w6pVqigbajupv
18 core tables, 6 associative tables and 7 dictionaries in BCNF with
UUIDv7 keys, portable across MariaDB 11 and MySQL 8.4. Writes go through
transactional stored procedures; the render queue uses SKIP LOCKED with
worker leases. db/build.sh bundles everything into db/dongba.sql.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7bU4Kec4w6pVqigbajupv
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7bU4Kec4w6pVqigbajupv
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7bU4Kec4w6pVqigbajupv
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7bU4Kec4w6pVqigbajupv
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7bU4Kec4w6pVqigbajupv
Author
Owner

Follow-up: the schema and seed now also load cleanly on MySQL 8.4.11. Two fixes landed: v_file_paths casts paths to utf8mb4 with an explicit collation, so it no longer depends on the client charset or the server's default collation. db/dongba.sql also starts with SET NAMES utf8mb4. The views on the server (dongba, dongba_test) are updated.

Follow-up: the schema and seed now also load cleanly on **MySQL 8.4.11**. Two fixes landed: `v_file_paths` casts paths to `utf8mb4` with an explicit collation, so it no longer depends on the client charset or the server's default collation. `db/dongba.sql` also starts with `SET NAMES utf8mb4`. The views on the server (`dongba`, `dongba_test`) are updated.
forgejo_admin deleted branch feat/bootstrap 2026-11-16 05:01:25 -05:00
Sign in to join this conversation.
No description provided.