From c526aebc02c29530d7d286de178cd1dc1ba8c3cb Mon Sep 17 00:00:00 2001 From: Aron Novak Date: Thu, 7 Mar 2024 19:30:17 +0100 Subject: [PATCH] make it easier to spot schema + fixture errors (#1928) --- lib/IHP/Makefile.dist | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/IHP/Makefile.dist b/lib/IHP/Makefile.dist index 6a3ca2890..ec3bd6f14 100644 --- a/lib/IHP/Makefile.dist +++ b/lib/IHP/Makefile.dist @@ -114,10 +114,10 @@ psql: ## Connects to the running postgresql server @psql -h $$PWD/build/db -d app db: Application/Schema.sql Application/Fixtures.sql ## Creates a new database with the current Schema and imports Fixtures.sql - echo "drop schema public cascade; create schema public;" | psql -h $$PWD/build/db -d app - psql -h $$PWD/build/db -d app < "${IHP_LIB}/IHPSchema.sql" - psql -h $$PWD/build/db -d app < Application/Schema.sql - psql -h $$PWD/build/db -d app < Application/Fixtures.sql + (echo "drop schema public cascade; create schema public;" | psql -h $${PWD}/build/db -d app) && \ + psql -v ON_ERROR_STOP=1 -h $${PWD}/build/db -d app < "$${IHP_LIB}/IHPSchema.sql" && \ + psql -v ON_ERROR_STOP=1 -h $${PWD}/build/db -d app < Application/Schema.sql && \ + psql -v ON_ERROR_STOP=1 -h $${PWD}/build/db -d app < Application/Fixtures.sql dumpdb: dump_db ## Saves the current database state into the Fixtures.sql dump_db: ## Saves the current database state into the Fixtures.sql