-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #349 from vitaliypopel/feature/migrations-script
feature: migrations script
- Loading branch information
Showing
3 changed files
with
31 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
if [ "$(basename $(dirname $(pwd)))/$(basename $(pwd))" != "derisk-research/apps" ]; then | ||
echo "Current path to run this script should be in the \"derisk-research/apps\" directory" | ||
exit 1 | ||
fi | ||
|
||
echo "Running DB in Docker container..." | ||
docker-compose -f ../devops/dev/docker-compose.db.yaml --env-file data_handler/.env.dev up -d --remove-orphans | ||
|
||
echo "Installing Poetry globally..." | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
|
||
echo "Installing all dependencies for \"data_handler\" with Poetry..." | ||
poetry -C data_handler install | ||
|
||
echo "Activating environment..." | ||
poetry -C data_handler shell | ||
|
||
echo "Applying latest existing migrations..." | ||
poetry -C data_handler run alembic -c data_handler/alembic.ini upgrade head | ||
|
||
echo "Generating new migration..." | ||
poetry -C data_handler run alembic -c data_handler/alembic.ini revision --autogenerate -m "Migration" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.