MySQL Database Design Assistant
Paste the following prompt into your AI chat to install this skill:
Please install @user_1a9d72e6/mysql-design according to https://skillhub.cn/install/skillhub.md.
About this skill
Problem
MySQL table designs often suffer from inconsistent naming, arbitrary data types, and weak indexing. This skill targets the design step between business documentation and executable DDL, helping engineers turn entities, fields, status codes, and constraints into a reviewable CREATE TABLE script.
How it works
The workflow is practical rather than generic:
- Use
ReadorGlobto inspect.mdbusiness-rule files and extract entities, fields, enums, status codes, and relationships. - Analyze existing
.sqlfiles to understand legacy schemas and compatibility risks. - Apply naming and type rules, such as lowercase identifiers,
VARCHAR,DECIMAL(M,2),DATETIME, andTINYINT(1). - Design primary keys, unique business keys, and indexes for high-frequency queries, following the leftmost prefix rule.
- Generate MySQL DDL with column comments,
utf8mb4,InnoDB, and no foreign keys, leaving consistency to the application layer.
Boundaries
It is most useful for new table design, schema review, and DDL cleanup on MySQL 5.7/8.0. It does not replace data migration, load testing, or full sharding strategy. If the business-rule document is incomplete, the generated design may miss fields or constraints.
Use Cases
- Turn a procurement contract requirements document into a MySQL DDL draft with standardized names and field types.
- Review legacy .sql scripts, decide compatibility constraints, and add unique or high-frequency query indexes.
- Convert order, status, and amount business rules into annotated CREATE TABLE statements using utf8mb4 and InnoDB.
- Prepare a data review packet by mapping status codes and defaults to CHAR(2), DECIMAL, and NOT NULL rules.
Best For
- Backend engineers building transaction tables need schema drafts from requirement docs before review.
- Legacy system maintainers need compatible changes, added indexes, and column comments without breaking old tables.
- Architects reviewing data models need consistent amount, status, and time fields to reduce rework.
- Backend developers taking over procurement or order modules need scattered business rules converted into executable DDL.
Related Skills
Creates themed learning sites by generating flashcards, lessons, quizzes, index, and progress pages into a deployable website.
End-to-end mathematical optimization modeling with Gurobi and Python, covering data validation, code generation, solving, result analysis, and iterative revision.
Executes an Eversheet Web CDP login using externally supplied baseUrl, username, and password, then verifies the page reaches a logged-in home state.
Clarify product goals, user flows, pages, data, and permissions, then output an implementation-ready development prompt and lightweight spec.