Skip to content

Commit

Permalink
Document how to re-init DB
Browse files Browse the repository at this point in the history
  • Loading branch information
mfisher87 committed Jul 26, 2023
1 parent 2830e0b commit 1abf46f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions doc/db.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Database


It's expected that you'll set up a DB separately from the app. The app uses a proxy
container to enable it to talk to an external DB through the hostname `db`.


## Data model

The data model is managed by SQLAlchemy. The model is at
`usaon-vta-survey/models/tables.py`


### Changes to the data model

We haven't started working on data migrations yet.

For now, it's expected that the database will be re-initialized completely to apply
changes.

To do that:

```
./scripts/invoke_in_container.sh db.init
```

> :warning: Don't forget to set USAON_VTA_SURVEY_VERSION envvar to match the running
> container (`source VERSION.env`), or a new container will be pulled.

0 comments on commit 1abf46f

Please sign in to comment.