golang-migrate
A migration tool for Go projects with a CLI and a library. It applies numbered up and down SQL files and records the current version and a dirty flag in a schema_migrations table.
Minimal example
migrate create -ext sql -dir db/migrations -seq restaurants
migrate -path db/migrations -database "mysql://root:dev@tcp(127.0.0.1:3306)/zomato" upLearn this concept
Lesson 2.2 · Versioned migrations with golang-migrateUsed in exercises
Exercise 2.3 · Write the restaurant and menu migrations Exercise 2.24 · GET /v1/restaurants: search by namePrerequisite conceptsDatabase migration
RelatedDatabase migration