🔨 Standardize database commands

This commit is contained in:
Manuel Cillero 2024-04-03 15:14:57 +02:00
parent 87c944301d
commit 7fd262eaa0
2 changed files with 20 additions and 12 deletions

View file

@ -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=$?