create-table
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "create-table" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-9315af3622107e0f664798aaf9c0219f0b4b4dfd4d8546333dd54d3a59deaabf. Verify the upstream source and version against https://skillhub.cn/skills/user_a52900dd/create-table before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Generate MySQL CREATE TABLE DDL statements following the company's MySQL database design specifications.
Introduction source: third_party · user_a52900dd · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Generate MySQL CREATE TABLE DDL statements following the company's MySQL Database Design Specifications.
- Audience
- When the user asks to create a table, generate a DDL, or define a table structure.
- Inputs and outputs
- Output only the DDL statement followed by a brief explanation of design choices. Use this template:
- Testing
- Not tested
Browse files
Frontmatter
name: create-table
description: Generate MySQL CREATE TABLE DDL statements following the company's MySQL Database Design Specifications.When to use
When the user asks to create a table, generate a DDL, or define a table structure.
Rules (all mandatory unless marked as suggestion)
Naming
- Table and column names must be within 32 characters.
- Table names: only letters, digits, and underscores, all lowercase.
- Table names must be module-prefixed (e.g.,
sz_for 师资系统,qd_for 渠道系统). Ask for the module prefix if not provided.
Table-level
- Must explicitly specify
CHARSET=utf8mb4. - Must explicitly specify
ENGINE=InnoDB(default unless otherwise specified). - Must have
COMMENTon the table.
Primary Key
- Must have
idas primary key, typeint UNSIGNED NOT NULL AUTO_INCREMENT, with comment '主键ID'. - Primary key name must start with
pk_. - Primary key values must never be updated (enforce in application logic).
- Business identifiers (e.g.,
user_id,order_id) must NOT be the primary key; use indexes or unique indexes instead.
Columns
- All columns must be
NOT NULLwith appropriateDEFAULTvalues. - All columns must have
COMMENT. - Use
utf8mb4charset for all string columns.
Type Selection
- Auto-increment column: use
int. - Status/type fields with few distinct values: use
tinyintorsmallint. - Do NOT use
ENUMorSET; usetinyintorsmallintinstead. - Text data: prefer
varcharoverchar. Max ~2000 characters for varchar. - Time fields: prefer
datetime.timestamprange is limited (1970-2038). Alternatively, useintwithunix_timestamp()/from_unixtime().
Audit Fields (for core tables like user, money-related)
- Must have
created_atDATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP. - Must have
updated_atDATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP.
Indexes
- Primary key:
id int auto_increment(enforced above). - Primary key names start with
pk_, unique keys withuniq_, ordinary indexes withidx_. All lowercase. - Index type must be
BTREE(default for InnoDB). - Maximum 8 indexes per table.
- Prefer composite indexes with highest cardinality column first.
- No redundant indexes (e.g., if
KEY(a,b)exists,KEY(a)is redundant).
Soft Delete
- Recommend adding
is_deletedtinyint UNSIGNED NOT NULL DEFAULT 0 for tables that need soft delete.
Audit Columns (recommended for all tables)
created_byint UNSIGNED NOT NULL DEFAULT 0updated_byint UNSIGNED NOT NULL DEFAULT 0
Output Format
Output only the DDL statement followed by a brief explanation of design choices. Use this template:
CREATE TABLE `table_name` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
-- other columns...
`is_deleted` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否被软删除',
`created_by` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_by` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新人',
`updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`),
-- indexes...
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='table comment';
Reference Example
CREATE TABLE `qd_trigger_sub_object_type_conf` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`sub_object_type` int NOT NULL DEFAULT 0 COMMENT '触达对象类型',
`sub_object_type_name` varchar(32) NOT NULL DEFAULT '' COMMENT '触达对象类型名',
`skills` text COMMENT '触达对象执行技能',
`attachment` varchar(255) NOT NULL DEFAULT '{}' COMMENT '附加参数值',
`config_label` varchar(32) NOT NULL DEFAULT '' COMMENT '页面label配置',
`variable_id` int not null default 0 comment '变量id',
`is_deleted` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否被软删除',
`created_by` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_by` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新人',
`updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `idx_sub_object_type` (`sub_object_type`),
UNIQUE KEY `uniq_sub_object_type` (`sub_object_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='触达子对象类型配置表';Current listing version
1.0.0
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 面向开发者的高频刚需工具,解决企业 DDL 规范一致性问题
- 显著提升数据库设计效率,降低规范落地成本
Highlights
- 触发词覆盖完整:create table / generate DDL / define table structure
- 边界清晰,不易与其他 Skill 重叠
Highlights
- 结构清晰完整:分模块详述命名/表级/主键/字段/类型/审计/索引等规范
- 提供完整输出模板和参考示例,便于直接执行
Highlights
- 覆盖 MySQL 建表关键约束:字符集/引擎/主键/索引数量等
- 类型选择建议合理,避免 ENUM/SET 等易错用法
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.