Apply Migrations
DevOps & Securityapply-migrationsApply Migrations is an Agent Skill for devops & security published in the c9s/bbgo repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Apply pending database migrations (rockhopper up)
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/c9s/bbgo/blob/HEAD/.claude/skills/apply-migrations/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/apply-migrations, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Apply pending migrations using rockhopper.
Steps
- If
$ARGUMENTSis provided, use it as the config file path. Otherwise, find allrockhopper_*.yamlconfig files and ask the user which one to use. - Run:
rockhopper --config <config_file> up - Report the result.
Handling out-of-order migrations
If up fails with an "out-of-order migrations detected" error, it means a pending migration has a lower version than one that is already applied (common after merging parallel branches). Do not blindly re-run with --allow-out-of-order. Instead:
- Show the user the offending migration(s) from the error.
- Explain the two options:
- Renumber the new migration above the latest applied version (safe default — keeps history linear).
- Apply in place with
rockhopper --config <config_file> up --allow-out-of-order, only if the older migration is independent of the newer ones.
- Ask the user which they prefer before proceeding.
Environment variable overrides
If the user needs to override the DSN or driver, remind them they can set:
ROCKHOPPER_DRIVER- database driver nameROCKHOPPER_DIALECT- SQL dialect nameROCKHOPPER_DSN- data source name connection string