-
Notifications
You must be signed in to change notification settings - Fork 4
Migrations
Tahmid Ahmed edited this page Oct 24, 2025
·
3 revisions
To migrate your local database using your root .env, you can simply run:
just migrateNote
Versioned migrations are applied to all databases
- Versioned migrations will only run once.
- You can use these migrations to define tables, schemas, columns (otherwise known as DDL) OR define insertions/updates/deletes of certain columns (otherwise known as DML).
If you need to generate mock data that does not need to be in production, please look at the docs on repeatable migrations.
V00{number}__{description}.SQL
- Name must be prefixed with a
V. - Version numbers must be sequential and unique.
- Version numbers must be 4 digits wide. You may pad the left-side with 0s until you reach that goal.
- Double underscores (__) separate the version from the description
- Use underscores (_) instead of spaces in descriptions
- Files must have
.sql(or.SQL) extension
V0005__Add_user_table.SQL
V0642__Insert_new_tag_enums.SQL
V9999__Delete_user_table.SQLNote
Repeatable migrations are only applied to local & CI databases.
Repeatable migrations are NOT applied to the production & staging database.
- Instead of being run just once, repeatable migrations are (re-)applied to a database on migrate every time their checksum changes.
- Our main use for repeatable migrations are to generate mock data to use locally and in our CI database, but is not needed for our production or staging database.
- Name must be prefixed with an
R__Mock - Version numbers must be sequential and unique
- Use underscores (_) instead of spaces in descriptions
- Files must have
.sql(or.SQL) extension
R__Mock_V0005_Insert_mock_users.SQL
R__Mock_V0011_Add_old_leaderboards.SQL
R__Mock_V9999_Delete_old_mock_users_and_insert_new_users.SQL- Home
- Setup
- Developer Commands
- Secrets
- Technical Docs
- Feature Docs
- CI Commands
- Contributing
- Codebloom ↗
- Codebloom - Swagger Documentation ↗
- Codebloom - Staging ↗
- Codebloom - Staging - Swagger Documentation ↗
- Codebloom - Local - Swagger Documentation ↗
- Codebloom - Local - Prometheus Metrics ↗
- Grafana Dashboard - Separate domain
- Public Taskboard (Read-only) ↗