All skills
macro-inc avatar

/sqlx-migration

@9169593
by Macromacro-inc/macro4.5k stars
435

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

Use this Skill: https://skilld.dev/gh/macro-inc/macro/sqlx-migration

This session only. Nothing lands on disk.

SKILL.md

≈39 tokens always: the name and description. ≈277 when used: this file.

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:

    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.

Source: SKILL.md on GitHub

No alerts28d3 checks · Risk SAFE
  • Gen Agent Trust Hub28d

    The skill provides a workflow for creating database migrations using the SQLx CLI. It uses standard development tools like cargo and just to manage the migration process within the macro-inc project structure. A minor risk is noted regarding indirect prompt injection since user-provided input is used in shell commands, though the instruction to format input as snake_case serves as a basic security measure.

  • Socket28d

    No alerts

  • Snyk28d

    Risk: LOW · No issues

Signed by skilld at 9169593. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 3 months ago
What it can do
Runs commands Reads files Edits files
All 5 allowed tools
BashReadEditGlobGrep

README badge

README badge for macro-inc/macro/sqlx-migration