go-migration

Design and implement PostgreSQL schema and data migrations for Go applications.

Updated Dec 31, 2025
One-click install
npx skills add https://github.com/victorzhuk/go-ent --skill go-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-migration
Source: https://github.com/victorzhuk/go-ent/tree/main/pkg/skills/go/go-migration
Command: npx skills add https://github.com/victorzhuk/go-ent --skill go-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the creation and management of database migrations for Go applications, ensuring safe and consistent schema evolution.

Core Features & Use Cases

  • Database Schema Evolution: Design and implement additive, backward-compatible schema changes.
  • Data Migration: Handle complex data transformations using SQL or Go.
  • Idempotent & Reversible Migrations: Focus on safety with strategies for rollback and non-reversible operations.
  • Use Case: Safely update your PostgreSQL database schema by adding new tables, columns, or modifying existing ones with minimal downtime and a clear rollback plan.

Quick Start

Use the go-migration skill to generate a SQL migration file for adding a new 'users' table with 'id' and 'email' columns.

Frequently Asked Questions about go-migration

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

FAQPage Schema
How do I create reversible PostgreSQL schema migrations in Go?

Reversible PostgreSQL schema migrations in Go are designed with clear rollback strategies to undo additive changes. This approach ensures safe database schema evolution by handling both the forward migration and the rollback logic for non-reversible operations.

What is the best way to handle data transformations during a database migration?

Data transformations during a database migration are handled using either SQL or Go code directly within the migration files. This allows you to safely migrate and transform complex data structures while maintaining backward compatibility.

Can I write idempotent database migrations for a Go application?

Idempotent database migrations for Go applications can be designed to run safely multiple times without causing duplicate schema changes or data corruption. This focuses on safety by ensuring repeated execution yields the same database state.

How do database migrations manage backward-compatible schema changes?

Database migrations manage backward-compatible schema changes by focusing on additive operations, such as adding new tables or columns, rather than destructive modifications. This ensures minimal downtime and maintains application stability during the transition.

What are the limitations of non-reversible database migrations?

Non-reversible database migrations involve operations that cannot be undone, requiring clear rollback strategies to mitigate risks. When a direct reversal is impossible, the migration design provides alternative compensating actions or explicit documentation to handle the schema state safely.