Skip to content

Manage database

Kirill Ponomarev edited this page Apr 7, 2023 · 3 revisions

Recreate database

Note: after executing this command all data will be lost.
Execute following command in "flask" container terminal:
flask --app manage:app recreate_db

Database migration

Execute following command in "flask" container terminal:
flask --app manage:app db migrate

Upgrade database schema

Execute following command in "flask" container terminal:
flask --app manage:app db upgrade

Downgrade database schema

Execute following command in "flask" container terminal:
flask --app manage:app db downgrade

P.S If want to run this commands outside of the container then use:

For production configuration:
docker-compose -f docker-compose-prod.yml exec {container_name} {command}

For development configuration:
docker-compose exec {container_name} {command}

Clone this wiki locally