Agent skill

Dev Schema Upgrade SQL

by yyw-code in yyw-code/MallBase

MallBase 数据库真相源、正式字段与升级 SQL 规则;修改 backend/install/data/schema 或 demo seed、新增/改名字段、移除运行时字段探测,或用户明确要求已有库升级、本地 upgrade SQL、发布迁移和 SimpleSqlMigrationService 时使用。

MITAuto-check passedDatabases

Install Dev Schema Upgrade SQL

skills CLI
$ npx skills add yyw-code/MallBase --skill dev-schema-upgrade-sql -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install yyw-code/MallBase dev-schema-upgrade-sql --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/yyw-code/MallBase.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.codex/skills/thinkPHP/dev-schema-upgrade-sql .claude/skills/dev-schema-upgrade-sql && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
dev-schema-upgrade-sql
GitHub stars
106
Token cost
~544 tokens
SKILL.md length
134 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

MallBase 数据库真相源、正式字段与升级 SQL 规则;修改 backend/install/data/schema 或 demo seed、新增/改名字段、移除运行时字段探测,或用户明确要求已有库升级、本地 upgrade SQL、发布迁移和 SimpleSqlMigrationService 时使用。

  • Works in 3 steps: 全新安装的表结构和初始配置以… → 修改字段或 seed 时先更新真相源,并同步 Controller… → schema/*.sql 面向全新安装,可能包含 DROP…
  • Tasks that involve SQL
  • SKILL.md covers 真相源, 正式字段, 已有库边界 and 自检
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Dev Schema Upgrade SQL is an agent skill from yyw-code/MallBase. MallBase 数据库真相源、正式字段与升级 SQL 规则;修改 backend/install/data/schema 或 demo seed、新增/改名字段、移除运行时字段探测,或用户明确要求已有库升级、本地 upgrade SQL、发布迁移和 SimpleSqlMigrationService 时使用。

Its SKILL.md is about 540 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Databases, covering SQL. It works with SQL, PHP and MySQL. The repository describes itself as: MallBase 是一个基于 PHP 的商城型业务基础框架,围绕 用户、商品、订单、权限 四个最核心的商业模块,提供一套清晰、稳定、可扩展的业务结构基线。 它不是一个功能齐全的电商系统,也不是通用 Web 框架,而是一个专注于“商城核心模型”的业务底座,用于快速构建和演进各类商业应用。 The licence is MIT.

When your agent uses it

  • Tasks that involve SQL

Example prompts

  • “/dev-schema-upgrade-sql”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. 全新安装的表结构和初始配置以 backend/install/data/schema/*.sql 为真相源;演示数据放在 backend/install/data/demo/*.sql。
  2. 修改字段或 seed 时先更新真相源,并同步 Controller 参数、Validate 场景、Model、Service、前端类型和测试中实际受影响的契约。
  3. schema/*.sql 面向全新安装,可能包含 DROP TABLE;不要把整份安装 schema 直接用于已有业务库。

What it can do on your machine

Read from SKILL.md and the folder at commit 3f10589. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Dev Schema Upgrade SQL loads about 544 tokens when it runs. Until then it costs about 45 tokens; SKILL.md has 134 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~45
When it runs · the whole SKILL.md, loaded when a task matches
~544

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from yyw-code/MallBase at commit 3f10589, republished under its MIT licence (© yyw-code). 134 words, ~544 tokens.

Download SKILL.mdSave it as .claude/skills/dev-schema-upgrade-sql/SKILL.md (or your agent's skills folder).
name
dev-schema-upgrade-sql
description
MallBase 数据库真相源、正式字段与升级 SQL 规则;修改 backend/install/data/schema 或 demo seed、新增/改名字段、移除运行时字段探测,或用户明确要求已有库升级、本地 upgrade SQL、发布迁移和 SimpleSqlMigrationService 时使用。

Schema、正式字段与升级 SQL

真相源

  1. 全新安装的表结构和初始配置以 backend/install/data/schema/*.sql 为真相源;演示数据放在 backend/install/data/demo/*.sql。
  2. 修改字段或 seed 时先更新真相源,并同步 Controller 参数、Validate 场景、Model、Service、前端类型和测试中实际受影响的契约。
  3. schema/*.sql 面向全新安装,可能包含 DROP TABLE;不要把整份安装 schema 直接用于已有业务库。

正式字段

字段结构定型后,业务代码直接依赖正式 schema。不要为了绕过未执行迁移而增加以下长期兼容:

  • SHOW COLUMNS、DESCRIBE 或 information_schema 运行时探测。
  • has*Column()、filter*Data() 一类按列存在性静默丢字段。
  • “有新字段就写,没有就降级”的双轨持久化。

若真实数据库缺字段,修复部署或迁移,不在请求链路隐藏结构不一致。仅输入/输出归一化且不探测数据库结构的协议兼容可以保留,并应有清晰边界。

已有库边界

只有用户明确要求“已有库升级”“升级 SQL”“测试服/线上迁移”或等价目标时,才规划和生成增量 SQL。普通功能、schema、seed 或 UI 任务不要主动扩大到已有库升级,也不要把它列成默认风险项。

本地手工 SQL

backend/install/data/upgrade/ 是 .gitignore 中的本地运维目录,不是发布迁移真相源:

  1. 仅在用户明确要求本地或指定环境升级 SQL 时创建。
  2. 使用 YYYY_MM_DD_<summary>.sql 一类可识别名称。
  3. 写成可安全重复执行的目标 MySQL SQL;建表、加列、加索引和 seed 都要使用目标版本支持的合法幂等方式,并在对应 MySQL 版本验证。
  4. 不提交该目录,不把它与正式发布迁移混为一谈。
发布升级迁移

backend/app/service/upgrade/SimpleSqlMigrationService.php 执行发布流程已经暂存到升级根目录的迁移:

  • 每个迁移必须同时提供 migrations/<migrationId>/up.sql 和 migrations/<migrationId>/down.sql,运行时路径分别位于 upgrade/staging/<jobId>/migrations/<migrationId>/。
  • Agent 逐条传入 migration_id、版本及 up/down 描述;每个描述都精确包含 path、staging_path、SHA-256 和文件大小。不保留旧的单 SQL 兼容入口。
  • 服务在执行正向 SQL 前先完整校验 up/down 两个文件,并在 upgrade/run/simple-migrations.json 记录正向语句级检查点。
  • 当前自动数据库回滚恢复升级前的 database.sql 快照,不执行 down SQL; down 文件是签名发布包中的可逆性审查证据,不能替代数据库快照。
  • 多条语句用独占行 -- mallbase:statement-breakpoint 分隔;每段只能是一条 SQL。
  • up.sql、down.sql 单文件不得超过 16 MiB;Platform、Agent 与 PHP 必须使用同一上限。
  • 不在迁移文件中使用 DELIMITER、SOURCE、LOAD DATA LOCAL 或自行控制 BEGIN/COMMIT/ROLLBACK/AUTOCOMMIT。
  • 迁移语句仍应可安全重试,不能依赖本地 backend/install/data/upgrade/ 被发布系统自动发现。

只有任务明确涉及发布包或升级平台时,才把变更接入这条发布迁移链路。

自检

  • 全新安装 schema 已包含最终结构。
  • 请求链路没有运行时字段探测或静默丢字段。
  • 已有库 SQL 确实来自用户明确要求。
  • 本地手工 SQL 与发布迁移的来源、路径和提交边界没有混用。
  • 发布迁移同时存在 up/down,且两个描述的路径、摘要和大小都经过校验。
  • SQL 已在目标 MySQL 版本验证语法与幂等性。

© yyw-code, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .codex/skills/thinkPHP/dev-schema-upgrade-sql of yyw-code/MallBase.

Open the folder on GitHubat commit 3f10589

Compare with similar skills

Dev Schema Upgrade SQL next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Dev Schema Upgrade SQL compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dev Schema Upgrade SQL this skillyyw-code/MallBase106—~544Automated safety check: PassMIT
SQL Database Support for pRESTprest/prest4.6k—~1.6kAutomated safety check: PassMIT
Chdb SQLvemetric/vemetric3941 repos~1.2kAutomated safety check: PassApache-2.0
Sql2erystemsrx/sql_to_ER188—~1.1kAutomated safety check: PassAGPL-3.0
Squixeduardofuncao/squix273—~784Automated safety check: PassMIT
Golang Databaseunxed/f42402 repos~2.9kAutomated safety check: PassMIT

Similar skills

  • Guides classifying, gap-analyzing and scaffolding support for a new SQL database in pREST, from Postgres-compatible variants to entirely new dialects.

    4.6k GitHub stars~1.6k tokensUpdated 2 days ago
    DatabasesAuto-check passed
  • Chdb SQL

    vemetric/vemetric

    A skill your agent uses when the user wants to run SQL — especially analytical SQL — on local files (parquet/csv/json), URLs, S3 paths, or remote databases (Postgres, MySQL, MongoDB, ClickHouse…

    394 GitHub starsUsed in 1 repo~1.2k tokens
    DatabasesAuto-check passed
  • Sql2er

    ystemsrx/sql_to_ER

    A skill your agent uses when the user wants a Chen-model ER diagram from SQL CREATE TABLE statements or DBML, wants to rearrange or clean up an existing sql2er state, wants a skeleton-only overview…

    188 GitHub stars~1.1k tokensUpdated 7 days ago
    DatabasesAuto-check passed
  • Squix

    eduardofuncao/squix

    Run SQL queries across databases (Postgres, MySQL, SQLite, etc.) via the squix CLI.

    273 GitHub stars~784 tokensUpdated 15 days ago
    DatabasesAuto-check passed
  • Comprehensive guide for Go database access — parameterized queries, struct scanning, NULLable columns, transactions, isolation levels, SELECT FOR UPDATE, connection pool, batch processing, context…

    240 GitHub starsUsed in 2 repos~2.9k tokens
    DatabasesAuto-check passed
  • Database Migrations SQL Migrations

    rmyndharis/antigravity-skills

    SQL database migrations with zero-downtime strategies for PostgreSQL, MySQL, SQL Server

    1.7k GitHub starsUsed in 2 repos~577 tokens
    DatabasesAuto-check: notes

More from yyw-code/MallBase

All 12 skills in this repo
  • MallBase 支付与退款回调安全规则;修改 backend/route/notify.php、PayNotifyController、NotifyService、WechatPaymentResultService、mbpaymentlog,或处理微信/其它渠道 webhook 的验签、解密、防重放、金额校验、幂等、事务与 HTTP 应答时使用。

    106 GitHub stars~495 tokensUpdated 2 mo ago
    Auto-check passed
  • Route Permission System

    yyw-code/MallBase

    MallBase ThinkPHP 后台路由与权限元数据规则;新增或调整 backend/route/api/admin 路由、System 权限码、菜单元数据、/:id 路径参数、共享 permission 或 sync:permissions 同步时使用。

    106 GitHub stars~499 tokensUpdated 2 mo ago
    Auto-check passed
  • Upload Component First

    yyw-code/MallBase

    MallBase Vben Admin 上传组件与字段契约规则;实现图片、视频或文件上传,以及处理 FileInfo 回填和提交值时使用。

    106 GitHub stars~553 tokensUpdated 2 mo ago
    Auto-check passed
  • Architecture Layering

    yyw-code/MallBase

    MallBase ThinkPHP 后端分层、Swoole Service 无状态与 IDE 泛型规则;开发或重构 backend/app 下的 Controller、Service、Model,调整 BaseController/BaseService、service()/model() 调用、构造注入或协程安全状态时使用。

    106 GitHub stars~391 tokensUpdated 2 mo ago
    Auto-check passed
  • E2E Webantd Realapi

    yyw-code/MallBase

    MallBase Vben Admin 局部格式化与真实后端 E2E 收口规则;修改、测试或回归 web-antd 代码时使用。

    106 GitHub stars~308 tokensUpdated 2 mo ago
    Auto-check passed
  • List Query Sync

    yyw-code/MallBase

    MallBase ThinkPHP 列表查询与分页返回规则;实现或调整 Service 的 buildListQuery、分页 list/total、动态筛选、关联查询、统计、导出或 compact('total', 'list') 返回时使用。

    106 GitHub stars~395 tokensUpdated 2 mo ago
    Auto-check passed

Works with

Categories

Questions about Dev Schema Upgrade SQL

What does Dev Schema Upgrade SQL do?

MallBase 数据库真相源、正式字段与升级 SQL 规则;修改 backend/install/data/schema 或 demo seed、新增/改名字段、移除运行时字段探测,或用户明确要求已有库升级、本地 upgrade SQL、发布迁移和 SimpleSqlMigrationService 时使用。. Dev Schema Upgrade SQL is an agent skill from yyw-code/MallBase.

When should I use Dev Schema Upgrade SQL?

Dev Schema Upgrade SQL fits situations like: tasks that involve SQL.

How do I install Dev Schema Upgrade SQL in Claude Code?

Run `npx skills add yyw-code/MallBase --skill dev-schema-upgrade-sql -a claude-code`. Or copy the skill folder (.codex/skills/thinkPHP/dev-schema-upgrade-sql in yyw-code/MallBase) into .claude/skills/dev-schema-upgrade-sql in your project. Claude Code loads it when a task matches its description.

How do I install Dev Schema Upgrade SQL in Codex?

Run `npx skills add yyw-code/MallBase --skill dev-schema-upgrade-sql -a codex`. Or copy the skill folder (.codex/skills/thinkPHP/dev-schema-upgrade-sql in yyw-code/MallBase) into .agents/skills/dev-schema-upgrade-sql in your project. Codex loads it when a task matches its description.

Can I use Dev Schema Upgrade SQL in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add yyw-code/MallBase --skill dev-schema-upgrade-sql -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dev-schema-upgrade-sql, .gemini/skills/dev-schema-upgrade-sql, .github/skills/dev-schema-upgrade-sql and .opencode/skills/dev-schema-upgrade-sql in your project.

What does Dev Schema Upgrade SQL need to run?

SKILL.md names no scripts, command-line tools or credentials: Dev Schema Upgrade SQL is instructions for the agent only.

Does Dev Schema Upgrade SQL access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Dev Schema Upgrade SQL safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Dev Schema Upgrade SQL use?

Dev Schema Upgrade SQL is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Dev Schema Upgrade SQL use?

About 544 tokens (SKILL.md is roughly 2.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Dev Schema Upgrade SQL?

Skills that share tags, products or a category with Dev Schema Upgrade SQL: SQL Database Support for pREST (prest/prest, 4.6k stars), Chdb SQL (vemetric/vemetric, 394 stars), Sql2er (ystemsrx/sql_to_ER, 188 stars) and Squix (eduardofuncao/squix, 273 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Dev Schema Upgrade SQL?

yyw-code (a GitHub user) maintains it in yyw-code/MallBase, which has 106 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on August 3, 2026.

Source: yyw-code/MallBase on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.