From fb336e78d6da25b2faca73b677113dcb08320e65 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Thu, 7 Mar 2019 01:17:47 +0000 Subject: [PATCH] lib/postgres/update.sh --- lib/postgres/update.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/postgres/update.sh b/lib/postgres/update.sh index a94bfb11..d90c0446 100755 --- a/lib/postgres/update.sh +++ b/lib/postgres/update.sh @@ -5,5 +5,9 @@ cd "$(dirname "$0")" DB=${1:?Db name missing} psql "$DB" -Atc '\dt' | grep '^public|' | cut -d'|' -f2 | while read t; do - grep -vE '^DROP|--' $t.sql 2>/dev/null -done | psql "$DB" -q + + [ -r "$t.sql" ] || continue + echo "SELECT 'Update $t' as Comment;" + grep -vE '^DROP' "$t.sql" + +done | PGOPTIONS='--client-min-messages=warning' psql "$DB" -qAt -- 2.47.3