Add user fixtures

This commit is contained in:
Seamus Johnston 2022-10-12 11:46:45 -05:00
parent 72e92c9b54
commit 3e4279ace4
No known key found for this signature in database
GPG key ID: 2F21225985069105
5 changed files with 98 additions and 2 deletions

View file

@ -21,11 +21,27 @@ can manually run the task with
cf run-task getgov-unstable --command 'python manage.py migrate' --name migrate
```
Optionally, load data from fixtures as well
```shell
cf run-task getgov-unstable --wait --command 'python manage.py loaddata registrar/fixtures/*' --name loaddata
```
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.
## Getting data for fixtures
To run the `dumpdata` command, you'll need to ssh to a running container. `cf run-task` is useless for this, as you will not be able to see the output.
```shell
cf ssh getgov-unstable
/tmp/lifecycle/shell # this configures your environment
./manage.py dumpdata
```
## Dropping and re-creating the database
For `unstable`, it might be necessary to start the database over from scratch.