Skip to main content

sqlx-migration

Create SQLx migration files with `sqlx migrate add <name>`. Use when asked to add, create, or generate a sqlx/sqlx-cli database migration.

ソース情報

リポジトリ
macro-inc/macro
ソースの最終更新活動
2026年7月11日 21:56
検出された SKILL.md の言語
英語
スター
4,599
フォーク
446

インストール方法

デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。

ソースファイルを確認

インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。

SKILL.md を表示中

SKILL.md
ソースの指示 · 読み取り専用プレビュー
name
sqlx-migration
description
Create SQLx migration files with `sqlx migrate add <name>`. Use when asked to add, create, or generate a sqlx/sqlx-cli database migration.
allowed-tools
Bash, Read, Edit, Glob, Grep
# SQLx Migration Use the SQLx CLI to create migration files instead of manually creating timestamped files. ## Instructions 1. Identify the project or crate root where SQLx migrations should live. - Prefer the directory that contains an existing `migrations/` directory. - If there are multiple crates/projects, ask the user which one unless the target is obvious. 2. Convert the requested migration description to a short snake_case name, for example `create_users_table`. 3. Run `just setup_test_envs` from the project root 4. Run the SQLx CLI from `crates/macro_db_client` folder: ```bash cargo sqlx migrate add name_of_migration ``` Replace `name_of_migration` with the actual snake_case migration name. 5. Do not manually add timestamps or hand-create migration filenames; `sqlx migrate add` generates the correct timestamped file. 6. After the command succeeds, read the generated migration file and add the requested SQL changes there. 7. If `sqlx` is not installed or not on `PATH`, stop and tell the user to install `sqlx-cli` rather than manually creating the migration file.
GitHubで見る