Database migration
A numbered file that changes the schema in one step, applied by a tool that records which files have run. Every environment reaches the same schema by running the same files in the same order.
Minimal example
db/migrations/
0001_restaurants.up.sql
0001_restaurants.down.sqlLearn this concept
Lesson 2.2 · Versioned migrations with golang-migrateUsed in exercises
Exercise 2.3 · Write the restaurant and menu migrations Exercise 2.7 · Seed 50 restaurants and one full menu Exercise 2.17 · GET /v1/restaurants: open status Exercise 2.19 · Restaurant list integration suite Exercise 2.24 · GET /v1/restaurants: search by name Exercise 2.26 · GET /v1/restaurants: sort by distance Exercise 3.3 · POST /v1/auth/*: signup, login and refresh Exercise 3.6 · Migration 0006: order tablesRelatedgolang-migrate