Skip to content

docs: add DB schema reference documentation#162

Open
kthoms wants to merge 2 commits into
mainfrom
db-schema
Open

docs: add DB schema reference documentation#162
kthoms wants to merge 2 commits into
mainfrom
db-schema

Conversation

@kthoms

@kthoms kthoms commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Adds a chapter "DB schema" as reference documentation with detailed description of each domain and table.

Screenshot 59 Screenshot 58

Copilot AI review requested due to automatic review settings July 6, 2026 20:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new “Database Schema Reference” documentation set for Operaton schema v7.24 (including an ER diagram source and per-domain reference pages), and adds supporting Mermaid rendering tooling/scripts plus related “superpowers” design/plan documents.

Changes:

  • Added DB schema reference docs under docs/documentation/reference/db-schema/ (index + domain pages) and an ER diagram source (schema.mermaid).
  • Added Mermaid initialization scripts and Mermaid-related dependencies intended to enable Mermaid rendering in Docusaurus.
  • Added/updated “superpowers” specs and implementation plans for DB schema reference docs and automated version updates.

Reviewed changes

Copilot reviewed 17 out of 22 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
static/mermaid-init.js Adds a client-side script to convert language-mermaid code blocks into rendered Mermaid diagrams.
src/mermaid-loader.js Adds a client-side Mermaid initializer/re-initializer intended for SPA navigation.
package.json Adds Mermaid + Docusaurus Mermaid theme dependencies.
docusaurus.config.ts Minor formatting changes; relevant location to wire Mermaid theme/loading.
docs/superpowers/specs/2026-06-09-db-schema-reference-design.md Adds an approved design spec for modular DB schema reference docs.
docs/superpowers/specs/2026-05-29-automated-version-updates-design.md Adds an approved design spec for automated doc version updates.
docs/superpowers/plans/2026-06-09-db-schema-reference-implementation.md Adds a detailed implementation plan for the DB schema reference docs.
docs/superpowers/plans/2026-05-29-automated-version-updates.md Adds a detailed implementation plan for automated version updates.
docs/documentation/reference/db-schema/schema.mermaid Adds the Mermaid ER diagram source for the schema.
docs/documentation/reference/db-schema/index.md Adds the DB schema reference landing page, quick reference, and diagram link.
docs/documentation/reference/db-schema/general.md Adds documentation for ACT_GE_* tables.
docs/documentation/reference/db-schema/repository.md Adds documentation for ACT_RE_* tables.
docs/documentation/reference/db-schema/runtime.md Adds documentation for ACT_RU_* tables, indexes, and example queries.
docs/documentation/reference/db-schema/history.md Adds documentation for ACT_HI_* tables.
docs/documentation/reference/db-schema/identity.md Adds documentation for ACT_ID_* tables.
.devenv/scripts/schema-theme.css Adds CSS to theme the rendered Mermaid ER diagram by domain.
.devenv/scripts/render-schema.sh Adds a helper script to render schema.mermaid to SVG/PNG using npx mermaid-cli.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/mermaid-loader.js
Comment on lines +5 to +9
window.mermaid.initialize({
startOnLoad: true,
theme: 'default',
securityLevel: 'loose',
});
Comment thread src/mermaid-loader.js
Comment on lines +1 to +3
// Initialize Mermaid diagrams when the page loads
if (typeof window !== 'undefined') {
const initMermaid = () => {
Comment thread static/mermaid-init.js

function waitForMermaid(attempts) {
if (typeof window.mermaid !== 'undefined') {
window.mermaid.initialize({ startOnLoad: false, theme: 'default', securityLevel: 'loose' });
Comment thread static/mermaid-init.js
Comment on lines +1 to +4
// Mermaid initialization for Docusaurus
// Docusaurus renders mermaid blocks as <pre><code class="language-mermaid">,
// but Mermaid.js expects <div class="mermaid">. This script converts them.
(function () {
Comment thread package.json
Comment on lines 20 to 22
"@docusaurus/preset-classic": "3.10.1",
"@docusaurus/theme-mermaid": "^3.10.1",
"@mdx-js/react": "^3.1.1",
| HANDLER_TYPE_ | VARCHAR(255) | NULL | Handler class/type |
| HANDLER_CFG_ | VARCHAR(4000) | NULL | Handler configuration |
| DEPLOYMENT_ID_ | VARCHAR(64) | NULL | Associated deployment |
| SUSPENSION_STATE_ | INTEGER | NOT NULL DEFAULT 1 | `1`=active, `0`=suspended |
@@ -0,0 +1,117 @@
Rem# Design: Automated Version Updates on Operaton Release
Comment on lines +10 to +12
## Architecture
3
Three parts:
Comment on lines +96 to +99
**Files:**
- Create: `docs/reference/db-schema/_schema-analysis.txt` (temporary working file)
- Source: `/Users/kthoms/Development/git/operaton/operaton/engine/src/main/resources/org/operaton/bpm/engine/db/create/`

Comment on lines +102 to +105
Run:
```bash
cat /Users/kthoms/Development/git/operaton/operaton/engine/src/main/resources/org/operaton/bpm/engine/db/create/activiti.postgres.create.engine.sql | grep "^create table" | sed 's/create table //' | sed 's/ (.*//' | sort
```
Replace mmdc Mermaid renderer with Graphviz pipeline:
- Add mermaid-to-dot.py: converts schema.mermaid to schema.dot
- schema.dot: subgraph cluster per domain (GE/RE/RU/HI/ID) with dotted
  color-coded borders, splines=ortho for rectangular edge routing,
  HTML-table entity nodes with PK/FK badges, self-referential edges dashed
- Update render-schema.sh: python3 → mermaid-to-dot.py → dot → SVG/PNG
- Regenerate schema.svg (582 KB vs 2 MB with mmdc)

schema.mermaid is kept unchanged for GitHub inline preview.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants