agentleFS
int2t05int2t05/engineering-skills/skills/03-design/schema-design/SKILL.md

schema-design

Skill3 starsChanged 30 days agoMITView on GitHub

Design data structures, invariants and migrations for an identified datastore. Triggers on "data model", "数据模型".

5 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use migrations.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • orangehrmSkill

    migrations

    Reference for OrangeHRM database migrations — the `installer/Migration/V{x}/Migration.php` pattern, what runs them (the installer for fresh databases, the upgrader for existing instances), the `MIGRATIONS_MAP` registry, and the helpers available inside a migration (`SchemaHelper`, `LangStringHelper`, `ConfigHelper`, `DataGroupHelper`). Use whenever the user is writing a new migration, bumping the version, debugging a failed migration, recovering a half-applied schema, asking how install vs upgrade decide which migrations to run, or asking about schema changes / lang-string updates / `hs_hr_config` writes / FK handling. **All 5.x migrations use Doctrine DBAL via `SchemaHelper` and `createQueryBuilder()` — raw SQL is the legacy V3.3.3 pattern (imported from 4.x) and not used for new work.** Permission seeding inside migrations is documented in the `authorization` skill; this skill covers the migration mechanics, not the permission model.

    Also in 3 projects that use this

The file

Files
SKILL.md

Schema Design

When to use

  • Design data structures, invariants and migrations for an identified datastore.

Not for: api-design for transport; deprecation-migration for migration execution.

Steps

  1. Identify datastore, ownership, access patterns, consistency and retention; do not assume relational storage.
  2. Model entities or documents, identifiers, constraints and indexes using actual datastore capabilities.
  3. Evaluate deletion, concurrency, uniqueness and query cost; validate performance using real query plans or representative data.
  4. Specify backfill, repeated execution, consumer impact and recovery; create a separate SCHEMA only if useful for review.

Output: Suggested paths, subject to human audit: docs/design/SCHEMA.md if useful beyond schema source.

Verify

  • Structures fit real access patterns; integrity and migration checks are explicit and performance evidence is labelled.

References

  • engineering-principles.md — shared decision boundaries, scope and verification.
  • mermaid-diagrams.md — Mermaid erDiagram syntax for entity-relationship diagrams
  • human-audit.md — document consent, readability and human review.
  • references/schema-patterns.md — normalization trade-offs, index patterns, partitioning strategies, soft-delete policies

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.