Deepsource Python issues

This commit is contained in:
Michał Gdula 2023-06-24 21:47:13 +00:00
parent e0fc37d48a
commit 4d912d314c
10 changed files with 162 additions and 156 deletions

View file

@ -1,15 +1,15 @@
#!/bin/sh
# Wait for database to start
until pg_isready -d $DB_NAME -h $DB_HOST -U $DB_USER
until pg_isready -d "$DB_NAME" -h "$DB_HOST" -U "$DB_USER"
do
echo "Waiting for database to start... (5s)"
sleep 5
echo "Waiting for database to start... (3s)"
sleep 3
done
echo "Database is ready!"
# Check if migrastions folder exists
# Check if migrations folder exists
if [ ! -d "/data/storage/migrations" ];
then
echo "Creating tables..."
@ -17,7 +17,7 @@ then
fi
# Check if there are any changes to the database
if ! $(flask --app server db check | grep -q "No changes in schema detected.");
if ! flask --app server db check | grep "No changes in schema detected.";
then
echo "Database changes detected! Migrating..."
flask --app server db migrate