A minimalistic migration helper for Gorm ORM, adding schema versioning and rollback support.
Gormigrate is a minimalistic database migration helper for the Gorm ORM in Go. It adds schema versioning and rollback support to Gorm's existing migration functions, enabling developers to manage database schema changes safely and systematically. It solves the problem of tracking migration history and providing a way to revert changes when necessary.
Go developers using the Gorm ORM who need a simple, lightweight tool to manage database schema migrations with versioning and rollback capabilities.
Developers choose Gormigrate because it integrates seamlessly with Gorm, is minimalistic and easy to use, and provides essential migration features like versioning and rollback without the overhead of more complex migration frameworks.
Minimalistic database migration helper for Gorm ORM
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Directly extends Gorm's migration functions, allowing developers to use familiar Gorm APIs for schema changes, as shown in the usage examples where tx.Migrator() is called.
Adds critical versioning and rollback capabilities that Gorm lacks, with a dedicated history table to track migrations, ensuring they are applied in order and only once.
Works with any database supported by Gorm, including MySQL, PostgreSQL, and SQLite, as stated in the 'Supported databases' section, making it versatile.
Provides an InitSchema function to define the entire schema for new databases, avoiding the need to run all historical migrations, demonstrated with AutoMigrate in the README.
The README explicitly warns that Gormigrate has no built-in lock mechanism, requiring external coordination like distributed locks to prevent race conditions in concurrent setups.
Designed for small to medium projects, it lacks advanced features like CLI interfaces or migration validation, as admitted in the philosophy section recommending other tools for scaling.
Tied exclusively to Gorm ORM, so it's unsuitable for projects using other ORMs or raw SQL, limiting flexibility beyond the Gorm ecosystem.