implementation-lokstra-create-migrations

Create auto-versioned SQL migration files via the Lokstra CLI.

8|1|Updated Jun 21, 2025
One-click install
npx skills add https://github.com/primadi/lokstra --skill implementation-lokstra-create-migrations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: implementation-lokstra-create-migrations
Source: https://github.com/primadi/lokstra/tree/main/.github/skills/implementation-lokstra-create-migrations
Command: npx skills add https://github.com/primadi/lokstra --skill implementation-lokstra-create-migrations

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps automate the creation of SQL migration files to evolve database schemas, generating both .up.sql and .down.sql files using the Lokstra CLI. It supports single and multi-database configurations guided by a migration.yaml setup.

Core Features & Use Cases

  • Auto-versioned migrations: Create ordered up/down scripts that track schema changes over time.
  • Multi-database friendly: Manage migrations for multiple pools with per-folder migration.yaml configuration.
  • CLI-driven workflow: Integrates with lokstra migration commands to apply, rollback, and status migrations.

Quick Start

Use the lokstra CLI to generate and manage migrations within your project’s migrations directory. lokstra migration create create_users_table lokstra migration up lokstra migration status

Frequently Asked Questions about implementation-lokstra-create-migrations

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

FAQPage Schema
How do I generate SQL migration files for multiple database schemas?

To generate SQL migration files for multiple database schemas, create migrations within a dedicated directory and configure db pools, descriptions, and folder toggles using a migration.yaml file. The tool outputs auto-versioned .up.sql and .down.sql scripts for each schema change.

How does the lokstra CLI handle database migration versioning and rollback?

The lokstra CLI handles database migration versioning by automatically assigning ordered versions to generated up and down scripts. You apply changes with `lokstra migration up`, check state with `lokstra migration status`, and reverse changes using the corresponding down scripts.

Can I manage migrations for separate database pools using a single configuration file?

Yes, you can manage migrations for separate database pools using a per-folder migration.yaml configuration file. This setup allows you to define and organize db pools, set custom descriptions, and enable or disable specific migration folders independently.

What do I need to set up before creating SQL migrations with the lokstra CLI?

Before creating SQL migrations with the lokstra CLI, you need a designated migrations directory in your project and an optional migration.yaml configuration file to manage multi-database setups, db pools, descriptions, and folder activation states.

What is the best way to track and apply ordered schema changes across different databases?

The best way to track and apply ordered schema changes across different databases is using auto-versioned up and down SQL scripts managed by a CLI. This ensures consistent, reversible migrations that track schema evolution over time across multiple db pools.