add-migration

Generate Flyway SQL migration scripts with Kotlin data models and ResultSet mappers.

Updated Jun 26, 2022
One-click install
npx skills add https://github.com/evengul/mc-org --skill add-migration-evengul
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-migration
Source: https://github.com/evengul/mc-org/tree/main/.claude/skills/add-migration
Command: npx skills add https://github.com/evengul/mc-org --skill add-migration-evengul

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a structured template and guidance for creating new database migrations using Flyway within the MC-ORG project, ensuring consistency and best practices.

Core Features & Use Cases

  • Migration Versioning: Guides on determining the correct version number for new migrations.
  • SQL Script Generation: Provides templates for common SQL operations like creating tables, adding columns, and adding indexes.
  • Kotlin Model & Mapper: Includes templates for creating corresponding Kotlin data models and ResultSet mappers.
  • Use Case: When adding a new feature that requires database schema changes, use this Skill to generate the necessary SQL migration file, Kotlin model, and mapper.

Quick Start

Use the add-migration skill to create a new SQL migration file for adding a user preferences table.

Frequently Asked Questions about add-migration

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

FAQPage Schema
How do I create a Flyway database migration script in a Kotlin/Ktor application?

To create a Flyway database migration script, you generate a versioned SQL file containing table creation, column alteration, and constraint definitions, alongside corresponding Kotlin data models and ResultSet mappers for schema evolution.

What is the best way to manage database schema changes for a Kotlin project using Flyway?

Managing database schema changes with Flyway involves applying structured, version-controlled SQL migration scripts that standardize operations like adding indexes, ensuring consistent schema evolution across your Kotlin application.

How does Flyway migration versioning work when adding new SQL scripts?

Flyway migration versioning works by assigning correct sequential version numbers to new SQL migration scripts, which dictates the exact order Flyway applies schema changes to the database during application startup.

Do I need to write Kotlin data models and mappers manually when adding a database table?

You do not need to write Kotlin data models and mappers manually from scratch; this Skill provides templates for generating corresponding Kotlin data models and ResultSet mappers alongside your new SQL table migration.

Can I use this approach to alter columns and add indexes in an existing SQL database?

Yes, you can use this approach to alter columns and add indexes in an existing SQL database by generating Flyway migration scripts equipped with templates specifically designed for these common SQL operations.