-
-
Notifications
You must be signed in to change notification settings - Fork 30
Performing Production DB Migration
We use Kubernetes (k8s) to orchestrate our infrastructure. In production this means if you need to interact with the application you need to setup the k8s cli.
By following those instructions you will have access to the Django console.
The first step for every DB migration is to create a migration file by running the following in your local development environment:
$ python manage.py makemigrations
This command scans the project for any changes made to the database Models since the last migrations
and generates a migration file within the application's /migrations/
directory.
Then commit the migration file, merge it into master, and wait for the cluster to update. This allows the Django CLI recognize that there is a current Django migration that can be performed.
Using the kubectl console you can now run the migration
python manage.py migrate