Create bash script to insert fixtures
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#bin/bash
|
||||
echo "Start fixtures"
|
||||
cat ./*.sql > ./allSQL.sql
|
||||
awk 'FNR==1{print "--------------------"}1' ./*.sql > ./allSQL.sql
|
||||
docker exec -i postgresql_dc-project psql dc-project dc-project -q -b -v "ON_ERROR_STOP=1" < ./allSQL.sql
|
||||
rm ./allSQL.sql
|
||||
echo "End fixtures"
|
||||
#sleep 20
|
||||
echo "End fixtures"
|
||||
9
src/main/resources/sql/resetDB.sh
Normal file
9
src/main/resources/sql/resetDB.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#bin/bash
|
||||
echo "Reset DB"
|
||||
awk 'FNR==1{print "--------------------"}1' \
|
||||
./migrations/*.down.sql \
|
||||
./migrations/*.up.sql \
|
||||
./functions/*/*.sql > ./allSQL.sql
|
||||
docker exec -i postgresql_dc-project psql dc-project dc-project -q -b -v "ON_ERROR_STOP=1" < ./allSQL.sql
|
||||
rm ./allSQL.sql
|
||||
echo "End reset"
|
||||
Reference in New Issue
Block a user