db-migration

Generate and apply UP and DOWN database migrations for EF Core and raw SQL.

Updated Nov 7, 2025
One-click install
npx skills add https://github.com/phoenicisf/forex-analyzer --skill db-migration-phoenicisf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-migration
Source: https://github.com/phoenicisf/forex-analyzer/tree/main/.agents/skills/db-migration
Command: npx skills add https://github.com/phoenicisf/forex-analyzer --skill db-migration-phoenicisf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Create and run database migrations safely with UP + DOWN scripts. Use this skill whenever a schema change is needed — adding tables, columns, indexes, constraints, or seed data. Works with EF Core (C# API) and raw SQL. Trigger on "migration", "schema change", "add column", "alter table", "database update", "new table".

Core Features & Use Cases

  • Generate UP and DOWN migration scripts for EF Core and raw SQL migrations.
  • Enforce idempotent migrations and safe rollback with conditional checks.
  • Validate migrations locally before applying to staging or production.

Quick Start

Create an EF Core migration or a raw SQL migration file, then apply it to your local database and verify the changes.

Frequently Asked Questions about db-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely apply database schema changes and ensure I can roll them back?

To safely apply database schema changes, generate paired UP and DOWN migration scripts that enforce idempotent execution and explicit rollback logic. This allows you to apply structural changes and safely revert them if deployment fails.

What is the best way to handle EF Core migrations in a CI pipeline?

Handling EF Core migrations in a CI pipeline involves generating migration scripts and running validation steps before deployment. This ensures schema changes are verified locally and applied safely across staging and production environments.

Does this database migration approach work with raw SQL scripts or only EF Core?

This database migration approach works with both raw SQL scripts and EF Core C# APIs. You can generate and apply safe UP and DOWN migrations for table, column, index, and constraint changes across both workflows.

How do I make my SQL migrations idempotent and prevent duplicate execution?

Making SQL migrations idempotent involves adding conditional checks to your scripts before applying schema changes. This ensures migrations only execute necessary alterations and can run multiple times without causing errors.

When do I need to use explicit rollback logic for database updates?

You need explicit rollback logic when applying database updates to evolving schemas in development or production. It provides a safe DOWN script to revert table, column, or seed data changes if a deployment introduces unexpected errors.