From 9ea12a67fad3069c7f26ff150de6038d738baaf0 Mon Sep 17 00:00:00 2001 From: Okinea Dev Date: Tue, 17 Dec 2024 12:48:52 +0200 Subject: [PATCH] feat: create migration script --- scripts/migrate.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 scripts/migrate.sh diff --git a/scripts/migrate.sh b/scripts/migrate.sh new file mode 100755 index 00000000..c44248c1 --- /dev/null +++ b/scripts/migrate.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +docker-compose -f docker-compose.back.yaml up --build + +echo "Installing Poetry globally..." +curl -sSL https://install.python-poetry.org | python3 - + +echo "Installing all dependencies for \"data_handler\" with Poetry..." +poetry install + +echo "Activating ..." +poetry shell + +echo "Applying latest existing migrations..." +poetry run alembic -c web_app/alembic.ini upgrade head + +echo "Generating new migration..." +poetry run alembic -c web_app/alembic.ini revision --autogenerate -m "Migration" \ No newline at end of file