Repository navigation
db_migrations
Guide to how to perform database migrations to integrate with our ci/cd pipeline and for consistency. It can be simplified to generating a new migration and then applying that new migration.
For generating migrations there are 2 cases:
If you are
- adding columns/tables
- removing columns/tables
- renaming columns/tables
then run npm run drizzle:generate to generate a new migration
If your database change involves changing the form of data that already exists, the most likely cases would be reformatting data or changing it's data type, to do this you can do npx drizzle-kit generate --custom --name=migration-name and then put the migration in the new SQL file. In the future drizzle will support doing this with typescript and this documentation will be updated to reflect that.
For more info read here
To apply the migration please just run npm run drizzle:migrate.
A branch can be provided to you in order to test your database changes.
This is a new system, if you encounter problems or have questions reach out in the discord.
Instead, suggest a change by
creating an issue,
or
opening a pull request
with your change. See How To Contribute for more
details. These docs are automatically generated from
the docs/folder of this repository.