From b0030323a799c711a35e51a812d7ff44a09b5aae Mon Sep 17 00:00:00 2001 From: dtookey Date: Wed, 6 Apr 2022 16:23:57 -0400 Subject: [PATCH] better way of handling gluing *.sql scripts together in import.sh --- src/bash/import.sh | 2 +- src/sql/0-run-first/sanitize.sql | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bash/import.sh b/src/bash/import.sh index 8d9d6a6..c74255a 100644 --- a/src/bash/import.sh +++ b/src/bash/import.sh @@ -4,7 +4,7 @@ HOME=/home/clarity SECRET=$(sed -n 1p ${HOME}/c) cd ${HOME}/clarity-vitals/ || exit -cat ./src/sql/0-run-first/*.sql | mysql -u"${USER}" -p"${SECRET}" projects +awk 'FNR==1{print ""}1' ${HOME}/clarity-vitals/src/sql/0-run-first/*.sql | mysql -u"${USER}" -p"${SECRET}" projects #just for dev. we'll use this as the proverbial scarf left on the flower pot cd ${HOME} || exit diff --git a/src/sql/0-run-first/sanitize.sql b/src/sql/0-run-first/sanitize.sql index 2ba68dd..00b6624 100644 --- a/src/sql/0-run-first/sanitize.sql +++ b/src/sql/0-run-first/sanitize.sql @@ -1,5 +1,4 @@ DROP TABLE tokens; -- noinspection SqlWithoutWhere -UPDATE users SET hash = ''; - +UPDATE users SET hash = ''; \ No newline at end of file