- Install dependencies
pip install pipenv alembic --user
pipenv install
- Start Postgres Database (might need to run this as root depending on your docker setup)
docker-compose up insights-tag-db
- Migrate the Database
pipenv shell
PYTHONPATH=. alembic upgrade head
- Start the server
pipenv run server
- Install dependencies
pip install pipenv alembic --user
pipenv install
npm install oatts mocha chakram -g
- Run generated tests
pipenv run test
-
In general exceptions should be handled via app.add_error_handler. See here
-
Follow these steps to generate a new migration
- Start a virtual env
pipenv shell
- Update database to current version
PYTHONPATH=. alembic upgrade head
- Generate new migration version from changes to db.models
PYTHONPATH=. alembic revision --autogenerate -m "Description of model changes"
-
Open db/migrations/versions/{new-script}.py and make any required manual changes
-
Run the migration
PYTHONPATH=. alembic upgrade head