diff --git a/README.md b/README.md index b940c965549c37c39c9a89d2fe70a4de81aa0ddc..c3c646874270280e2c216a7de183521871f79d3a 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ The server will therefore return an error unless ## Configuration This app allows specification of a few -example configuration parameters. These +example configuration parameters. These parameters should be stored in a file formatted similarly to `config-example.json`, and the name of this file should be stored in the environment @@ -39,7 +39,7 @@ For instructions on building the React frontend see `<name>-webapp/README.md`. This module has been tested in the following execution environments: - As an embedded Flask application. -For example, the application could be launched as follows: + For example, the application could be launched as follows: ```bash $ export FLASK_APP=compendium_v2.app @@ -52,15 +52,15 @@ for best practices about running in production environments. ## Importing the historical data -Pip install can use the setup.py file to register the click cli commands: +Pip install can use the setup.py file to register the click cli commands: ```bash pip install --editable . -survey-publisher-v1 -survey-publisher-2022 +legacy-survey-publisher ``` To import the 2022 data to the new datamodel for prefilling the 2023 surveys: + ```bash pip install --editable . conversion @@ -69,16 +69,17 @@ conversion ## Creating a db migration after editing the sqlalchemy models ```bash -flask db migrate -m "description" +cd compendium_v2 +flask db revision --autogenerate -m "description" ``` Then go to the created migration file to make any necessary additions, for example to migrate data. Also see https://alembic.sqlalchemy.org/en/latest/autogenerate.html#what-does-autogenerate-detect-and-what-does-it-not-detect Flask-migrate sets `compare_type=True` by default. +We use alembic-postgresql-enum to support auto discovery of and applying enum changes. -Note that starting the application applies all upgrades. -This also happens when running `flask db` commands such as `flask db downgrade`, -so if you want to downgrade 2 or more versions you need to do so in one command, eg by specifying the revision number. +Note that starting the application applies all pending migrations. +Normally this also happens when running `flask db` commands such as `flask db downgrade`, but we've disabled this in our create_app function. ## Editing a newly created survey