Change run scripts to not do migrations

This commit is contained in:
Neil Martinsen-Burrell 2022-10-06 14:58:32 -05:00
parent 209d2b31df
commit 323f8ea4e9
No known key found for this signature in database
GPG key ID: 6A3C818CC10D0184
3 changed files with 18 additions and 13 deletions

View file

@ -10,6 +10,22 @@ cf connect-to-service getgov-unstable getgov-unstable-databse
to get a `psql` shell on the `unstable` environment's database.
## Running Migrations
When new code changes the database schema, we need to apply Django's migrations.
We can run these using CloudFoundry's tasks to run the `manage.py migrate`
command in the correct environment. For the `unstable` environment, developers
can manually run the task with
```shell
cf run-task getgov-unstable --command 'python manage.py migrate' --name migrate
```
For the `staging` environment, developers don't have credentials so we need to
run that command using Github Actions. Go to
<https://github.com/cisagov/getgov/actions/workflows/migrate.yaml> and select
the "Run workflow" button, making sure that `staging` is selected.
## Dropping and re-creating the database
For `unstable`, it might be necessary to start the database over from scratch.