Skip to content

Commit

Permalink
Update script.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco authored Sep 10, 2024
1 parent 24b1f65 commit 4cce4f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ elif [[ $ACTION = "Create" ]] || [[ $ACTION = "Recreate" ]]; then
echo "Branch database name exists as a primary database. To prevent wiping out a primary db, No Database Created."
exit 1
elif [[ "$dbExists" = *"f"* ]] || [[ $ACTION = "Recreate" ]]; then
echo "$ACTION '$DATABASE' database from a copy of '$SOURCE_DB' database..."
echo "$ACTION '$DATABASE' database, a copy of '$SOURCE_DB' database..."
psql -h $DBHOST -U $DBUSERNAME -d postgres -c "SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = '$DATABASE';"
dropdb --if-exists -h $DBHOST -U $DBUSERNAME $DATABASE
createdb --owner=dev_role -h $DBHOST -U $DBUSERNAME $DATABASE --template=template0 --lc-collate=en_US.utf8 --lc-ctype=en_US.utf8 --encoding=UTF-8
Expand All @@ -70,4 +70,4 @@ elif [[ $ACTION = "Create" ]] || [[ $ACTION = "Recreate" ]]; then

echo "Database created."
fi
fi
fi

0 comments on commit 4cce4f7

Please sign in to comment.