Create bash script to insert fixtures

This commit is contained in:
2020-05-12 01:25:01 +02:00
parent b497c61cfc
commit 460222bf69
4 changed files with 25 additions and 4 deletions

View File

@@ -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"

View 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"