stacks-migrations

Manage versioned database migrations and apply them via the Buddy CLI.

622|17|Updated Apr 26, 2022
One-click install
npx skills add https://github.com/stacksjs/stacks --skill stacks-migrations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stacks-migrations
Source: https://github.com/stacksjs/stacks/tree/main/.claude/skills/stacks-migrations
Command: npx skills add https://github.com/stacksjs/stacks --skill stacks-migrations

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing database schema changes across development, staging, and production can be error-prone without versioned migrations. This skill provides a workflow for creating migration files, running pending migrations, performing a fresh reset, and seeding data.

Core Features & Use Cases

  • Create timestamped migrations with buddy make:migration.
  • Apply and diff migrations with buddy migrate and buddy migrate --diff.
  • Fresh migrations (drop + recreate) and seeding with buddy migrate:fresh and buddy migrate:fresh --seed.
  • Access to 96+ built-in migrations for core, content, commerce, and system tables.
  • Generate migrations from model diffs via buddy generate:migrations.

Quick Start

Run buddy migrate to apply pending migrations and keep your database schema in sync.

Frequently Asked Questions about stacks-migrations

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

FAQPage Schema
How do I automate database schema changes across development and production environments?

Database schema changes are automated by managing timestamped migration files and applying them via the Buddy CLI, ensuring synchronized version control across development, testing, and production workflows. You run buddy migrate to apply pending schema updates.

How do I generate database migrations from model diffs?

Database migrations are generated from model diffs by running the buddy generate:migrations command. This automatically creates the necessary timestamped migration files to bring your schema in sync with your updated application models.

What is the best way to reset a database with fresh migrations and seed data?

Fresh database resets are performed using the buddy migrate:fresh command, which drops and recreates your tables. Adding the --seed flag immediately populates the newly created schema with your seeded data.

Can I use built-in database migrations for core, commerce, and system tables?

Yes, the system includes access to over 96 built-in migrations covering core, content, commerce, and system tables. These pre-built migrations provide immediate schema management for standard application requirements.

How do I diff SQL changes in pending database migrations?

SQL changes in pending migrations are diffed by running buddy migrate --diff. This command applies pending migrations while simultaneously displaying the SQL differences being executed against your database.

When do I need versioned migration files for my database schema?

Versioned migration files are needed when managing database schema changes across development, staging, and production environments to prevent errors. They provide a reliable workflow for creating, applying, and tracking structural database updates.