gorm-migration

Automate GORM migrations to sync models with database schema.

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/liurida/gorm-development-skill --skill gorm-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gorm-migration
Source: https://github.com/liurida/gorm-development-skill/tree/main/migration
Command: npx skills add https://github.com/liurida/gorm-development-skill --skill gorm-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Managing database schema changes can be error-prone and time-consuming. This Skill guides you through using GORM migrations to keep your models and schema aligned, reducing drift and manual rework.

Core Features & Use Cases

  • Auto Migration: apply model changes to the database, creating or updating tables, columns, and indexes while explaining caveats.
  • Migrator Interface: examples of fine-grained control over table and column operations such as CreateTable, HasTable, DropTable, and RenameTable.
  • Best Practices: guidance on when AutoMigrate is appropriate, and how to avoid destructive changes in production environments.

Quick Start

Define your GORM models and run AutoMigrate to initialize or update the database schema.

Frequently Asked Questions about gorm-migration

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

FAQPage Schema
How do I automate GORM migrations to sync models with the database schema?

To automate GORM migrations, you define your GORM models and run AutoMigrate to initialize or update the database schema, creating or updating tables, columns, and indexes while keeping models in sync.

What's the best way to handle fine-grained table operations in GORM?

For fine-grained control over database schema changes in GORM, use the Migrator interface to execute specific table and column operations such as CreateTable, HasTable, DropTable, and RenameTable.

When should I avoid using AutoMigrate for database schema changes?

You should avoid using AutoMigrate for database schema changes in production environments when destructive changes are possible, relying instead on rollback-friendly migration patterns to ensure safe upgrade paths.

Does GORM support rollback-friendly migration patterns across environments?

Yes, GORM supports rollback-friendly migration patterns across environments by guiding safe usage of AutoMigrate and the Migrator API, ensuring development and operations teams avoid destructive schema changes.

Why does database schema drift occur when using GORM?

Database schema drift occurs when GORM models are not properly aligned with the database, but automating GORM migrations solves this by applying model changes to keep models and the schema synchronized.