Skip to content

Commit 9e8a7f3

Browse files
committed
Turn down that racket!
1 parent 6ddc1d1 commit 9e8a7f3

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

scripts/sql-import.sh

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,28 +95,20 @@ echo "Preparing to import $FILE into database '$DATABASE' on service '$SERVICE'
9595

9696
# Wipe the database if set
9797
if [ "$WIPE" == "true" ]; then
98-
echo ""
99-
echo "Emptying $DATABASE... "
98+
lando_pink "\nEmptying $DATABASE... "
10099
lando_yellow "NOTE: See the --no-wipe flag to avoid this step!"
101100

102101
# DO db specific wiping
103102
if [[ ${POSTGRES_DB} != '' ]]; then
104103
# Drop and recreate database
105-
lando_yellow "\t\tDropping database ...\n\n"
106-
psql postgresql://$USER@$HOST:$PORT/postgres -c "DROP DATABASE IF EXISTS $DATABASE"
107-
108-
lando_green "\t\tCreating database ...\n\n"
109-
psql postgresql://$USER@$HOST:$PORT/postgres -c "CREATE DATABASE $DATABASE"
104+
psql postgresql://$USER@$HOST:$PORT/postgres -c "DROP DATABASE IF EXISTS $DATABASE" --quiet --echo-errors
105+
psql postgresql://$USER@$HOST:$PORT/postgres -c "CREATE DATABASE $DATABASE" --quiet --echo-errors
110106
else
111107
# Connection string
112108
SQLSTART="mysql -h $HOST -P $PORT -u $USER ${LANDO_EXTRA_DB_IMPORT_ARGS}"
113109

114-
lando_yellow "\t\tDropping database ...\n\n"
115-
# Drop the database
110+
# Drop and recreate database
116111
$SQLSTART -e "DROP DATABASE IF EXISTS ${DATABASE}"
117-
118-
lando_green "\t\tCreating database ...\n\n"
119-
# Create the database
120112
$SQLSTART -e "CREATE DATABASE ${DATABASE}"
121113
fi
122114
fi
@@ -146,7 +138,7 @@ fi
146138

147139
# Build DB specific import command
148140
if [[ ${POSTGRES_DB} != '' ]]; then
149-
CMD="$CMD | psql postgresql://$USER@$HOST:$PORT/$DATABASE"
141+
CMD="$CMD | psql --quiet --echo-errors postgresql://$USER@$HOST:$PORT/$DATABASE"
150142
else
151143
CMD="$CMD | mysql -h $HOST -P $PORT -u $USER ${LANDO_EXTRA_DB_IMPORT_ARGS} $DATABASE"
152144
fi

0 commit comments

Comments
 (0)