🔨 Standardize database commands
This commit is contained in:
parent
87c944301d
commit
7fd262eaa0
2 changed files with 20 additions and 12 deletions
|
|
@ -75,12 +75,12 @@ else
|
|||
|
||||
# Execute commands for MySQL or PostgreSQL
|
||||
if [ "$DB_SYSTEM" == "mysql" ]; then
|
||||
mysql -u "$DB_ROOT_USER" -p"$DB_ROOT_PASS" -h "$DB_HOST" <<EOF
|
||||
DROP DATABASE IF EXISTS $DB_NAME;
|
||||
MYSQL_PWD="$DB_ROOT_PASS" mysql -u "$DB_ROOT_USER" -h "$DB_HOST" <<EOF
|
||||
DROP DATABASE $DB_NAME;
|
||||
EOF
|
||||
elif [ "$DB_SYSTEM" == "postgresql" ]; then
|
||||
PGPASSWORD="$DB_ROOT_PASS" psql -U "$DB_ROOT_USER" -h "$DB_HOST" <<EOF
|
||||
DROP DATABASE IF EXISTS $DB_NAME;
|
||||
DROP DATABASE $DB_NAME;
|
||||
EOF
|
||||
fi
|
||||
EXIT_CODE=$?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue