Technical Documentation

Backend Migration

Last Updated: October 16, 20240.6 min read

Go-migrate

Migration in go-backend works with go-migrate, install it here : https://github.com/golang-migrate/migrate/tree/master/cmd/migrate
If you have an empty db, you should first create the main dbs of the backend in your mysql :
  • game_backend
  • tracking
  • white_label_login
  • leaderboards
Then migrate and seed with :
Copy to Clipboard
and
Copy to Clipboard
If you want to MAKE migrations yourself, to modify the current state of the DB, add table etc do
Copy to Clipboard
Select the db you want to modify and type the name of your migration. Then two up and down sql files will appear in the migrations/ directory of go-backend and paste the SQL commands that will create your migration in the up file and the one that will destroy it in the down file.
Table of Contents