{"repo":"go-gormigrate/gormigrate","free":true,"listed":false,"github":"https://github.com/go-gormigrate/gormigrate","clone":"git clone https://github.com/go-gormigrate/gormigrate.git","description":"Minimalistic database migration helper for Gorm ORM","language":"Go","stars":1172,"topics":["go","gorm","schema","migrations","schema-migrations","database","db"],"license":"MIT","category":"databases-storage","readme_excerpt":"Gormigrate Gormigrate is a minimalistic migration helper for Gorm. Gorm already has useful migrate functions, just misses proper schema versioning and migration rollback support. IMPORTANT: If you need support to Gorm v1 (which uses github.com/jinzhu/gorm as its import path), please import Gormigrate by using the gopkg.in/gormigrate.v1 import path. The current Gorm version (v2) is supported by using the github.com/go-gormigrate/gormigrate/v2 import path as described in the documentation below. Supported databases It supports any of the databases Gorm supports: - MySQL - MariaDB - PostgreSQL - SQLite - Microsoft SQL Server - TiDB - Clickhouse Usage Having a separate function for initializing the schema If you have a lot of migrations, it can be a pain to run all them, as example, when you are deploying a new instance of the app, in a clean database. To prevent this, you can set a function that will run if no migration was run before (in a new clean database). Remember to create everything here, all tables, foreign keys and what more you need in your app. Options This is the options struct, in case you don't want the defaults: Who is Gormigrate for? Gormigrate was born to be a simple and minimalistic migration tool for small projects that uses Gorm. You may want to take a look at more advanced solutions like golang-migrate/migrate if you plan to scale. Be aware that Gormigrate has no builtin lock mechanism, so if you're running it automatically and have a distributed setup (i.e","default_branch":null,"files":null,"tree":[],"storefront":"/r/go-gormigrate","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/go-gormigrate/gormigrate/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}