Skip to content
Snippets Groups Projects
Commit 637077aa authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

update readme a bit

parent dab9b7d9
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,7 @@ The server will therefore return an error unless ...@@ -24,7 +24,7 @@ The server will therefore return an error unless
## Configuration ## Configuration
This app allows specification of a few This app allows specification of a few
example configuration parameters. These example configuration parameters. These
parameters should be stored in a file formatted parameters should be stored in a file formatted
similarly to `config-example.json`, and the name similarly to `config-example.json`, and the name
of this file should be stored in the environment 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`. ...@@ -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: This module has been tested in the following execution environments:
- As an embedded Flask application. - As an embedded Flask application.
For example, the application could be launched as follows: For example, the application could be launched as follows:
```bash ```bash
$ export FLASK_APP=compendium_v2.app $ export FLASK_APP=compendium_v2.app
...@@ -52,15 +52,15 @@ for best practices about running in production environments. ...@@ -52,15 +52,15 @@ for best practices about running in production environments.
## Importing the historical data ## 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 ```bash
pip install --editable . pip install --editable .
survey-publisher-v1 legacy-survey-publisher
survey-publisher-2022
``` ```
To import the 2022 data to the new datamodel for prefilling the 2023 surveys: To import the 2022 data to the new datamodel for prefilling the 2023 surveys:
```bash ```bash
pip install --editable . pip install --editable .
conversion conversion
...@@ -69,16 +69,17 @@ conversion ...@@ -69,16 +69,17 @@ conversion
## Creating a db migration after editing the sqlalchemy models ## Creating a db migration after editing the sqlalchemy models
```bash ```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. 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 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. 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. Note that starting the application applies all pending migrations.
This also happens when running `flask db` commands such as `flask db downgrade`, Normally this also happens when running `flask db` commands such as `flask db downgrade`, but we've disabled this in our create_app function.
so if you want to downgrade 2 or more versions you need to do so in one command, eg by specifying the revision number.
## Editing a newly created survey ## Editing a newly created survey
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment