database-schema-validator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDatabase Schema Validator Skill
数据库Schema验证Skill
This skill ensures that all SQL files provided by the user comply with our strict database standards.
该Skill可确保用户提供的所有SQL文件符合我们严格的数据库标准。
Policies Enforced
强制执行的规范
- Safety: No statements.
DROP TABLE - Naming: All tables must use .
snake_case - Structure: Every table must have an column as PRIMARY KEY.
id
- 安全规范:禁止使用语句。
DROP TABLE - 命名规范:所有表必须使用命名法。
snake_case - 结构规范:每张表必须包含一个列作为主键。
id
Instructions
操作步骤
-
Do not read the file manually to check for errors. The rules are complex and easily missed by eye.
-
Run the Validation Script: Use thetool to execute the python script provided in the
run_commandfolder against the user's file.scripts/bashpython scripts/validate_schema.py <path_to_user_file> -
Interpret Output:
- If the script returns exit code 0: Tell the user the schema looks good.
- If the script returns exit code 1: Report the specific error messages printed by the script to the user and suggest fixes.
-
请勿手动读取文件检查错误。规则较为复杂,人工检查容易遗漏问题。
-
运行验证脚本: 使用工具执行
run_command文件夹中提供的Python脚本,对用户的文件进行验证。scripts/bashpython scripts/validate_schema.py <path_to_user_file> -
解读输出结果:
- 如果脚本返回退出码0:告知用户该Schema验证通过。
- 如果脚本返回退出码1:将脚本输出的具体错误信息反馈给用户,并给出修复建议。