Update entrypoint.sh
This commit is contained in:
@@ -22,12 +22,17 @@ until PGPASSWORD=$POSTGRES_PASSWORD psql -h db -U $POSTGRES_USER -d $POSTGRES_DB
|
||||
done
|
||||
echo "PostgreSQL is up - executing command"
|
||||
|
||||
# Remove existing migrations and create fresh ones
|
||||
echo "Setting up fresh database migrations..."
|
||||
rm -rf migrations
|
||||
# Run migrations if they exist, otherwise initialize them
|
||||
echo "Checking database migrations..."
|
||||
if [ -d "migrations" ]; then
|
||||
echo "Running existing migrations..."
|
||||
flask db upgrade
|
||||
else
|
||||
echo "Initializing new migrations..."
|
||||
flask db init
|
||||
flask db migrate -m "Initial migration"
|
||||
flask db upgrade
|
||||
fi
|
||||
|
||||
# Create default site settings if they don't exist
|
||||
echo "Creating default site settings..."
|
||||
|
||||
Reference in New Issue
Block a user