Create a new sequentially numbered database migration with up/down SQL files
Install
npx skills add https://github.com/ruvnet/ruflo --skill migrate-createSKILL.md
Migrate Create
Generate a new database migration with sequential numbering and up/down SQL file pair.
When to use
When you need to create a new database migration for schema changes such as creating tables, adding columns, creating indexes, or modifying constraints.
Steps
- Determine next number -- use
Globto scan the migrations directory for existing migration files and find the highest number, then increment by 1 (zero-pad to 3 digits) - Select template -- based on the
<name>, choose the appropriate SQL template:- Names starting with
create_-> CREATE TABLE template - Names starting with
add_-> ALTER TABLE ADD COLUMN template - Names starting with
drop_-> DROP with safety checks - Names containing
index-> CREATE INDEX template - Other -> generic migration template with placeholder comments
- Names starting with
- Generate up migration -- write
NNN_<name>.up.sqlwith the appropriate SQL using IF NOT EXISTS for idempotency - Generate down migration -- write
NNN_<name>.down.sqlwith the reverse operation using IF EXISTS - Search past patterns -- call
mcp__plugin_ruflo-core_ruflo__agentdb_pattern-search(ReasoningBank-routed; don't pass anamespaceargument — pattern-* tools ignore it). - Store metadata -- call
mcp__plugin_ruflo-core_ruflo__memory_store --namespace migrationsto record the migration with number, name, status (pending), and file paths. Thememory_*tool family routes by namespace;agentdb_hierarchical-*does NOT (it routes by tierworking|episodic|semantic), so usememory_*here. See ruflo-agentdb ADR-0001 §"Namespace convention". - Report -- display: migration number, file paths created, template used, any similar past migrations found
CLI alternative
npx @claude-flow/cli@latest memory store --namespace migrations --key "migration-NNN_NAME" --value '{"number": NNN, "name": "NAME", "status": "pending"}'
Related skills
azure-kustomicrosoft605KQuery and analyze data in Azure Data Explorer (Kusto/ADX) using KQL for log analytics, telemetry, and time series analysis. WHEN: KQL queries, Kusto database queries, Azure Data Explorer, ADX clusters, log analytics, time series data, IoT telemetry, anomaly detection.supabase-postgres-best-practicessupabase421KPostgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pg_cron, pgmq), vector/semantic search (pgvector), and restoring dumps (pg_restore) or imporprisma-database-setupprisma321KGuides for configuring Prisma with different database providers (PostgreSQL, MySQL, SQLite, MongoDB, etc.). Use when setting up a new project, changing databases, or troubleshooting connection issues. Triggers on "configure postgres", "connect to mysql", "setup mongodb", "sqlite setup".prisma-client-apiprisma320KPrisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".