schema-designer
Install
mayros skill install schema-designer
mayros skill install [email protected]
Database normalization, DDL generation, ERD diagrams
README
@apilium/schema-designer
Design relational database schemas with normalization analysis, constraint definitions, DDL generation for PostgreSQL and MySQL, and ERD diagrams in Mermaid syntax.
Installation
mayros skill install @apilium/schema-designer
Usage
Schema Design
Ask Mayros to design a database schema:
Design a schema for an e-commerce platform with users, products, orders, and line items.
The skill produces DDL statements for both PostgreSQL and MySQL, including tables, constraints, indexes, and triggers.
DDL Generation
Generates production-ready DDL with:
PRIMARY KEY(identity columns for PostgreSQL, AUTO_INCREMENT for MySQL)FOREIGN KEYwith appropriateON DELETEactions (CASCADE, SET NULL, RESTRICT)UNIQUE,CHECK,NOT NULL, andDEFAULTconstraints- B-tree, GIN, partial, and covering indexes
Normalization Assessment
The skill analyzes schemas against normal forms:
- 1NF: atomic values, no repeating groups
- 2NF: no partial dependencies on composite keys
- 3NF: no transitive dependencies
- BCNF: every determinant is a candidate key
It also advises when denormalization is appropriate (read-heavy workloads, reporting, caching).
ERD Diagrams
Generates Mermaid entity-relationship diagrams with table columns, primary keys, foreign keys, and relationship cardinality.
Common Patterns
Includes templates for soft delete, audit timestamps, polymorphic associations, self-referential trees, and many-to-many junction tables.
Semantic Predicates
| Predicate | Description |
|-----------|-------------|
| schema:designed | Asserted after producing a schema design |
| schema:normalization_issue | Asserted for each normalization violation |
| schema:design_context | Query for schema evolution history |
License
MIT
Versions
Comments
Sign in to leave a comment.
Loading comments...