Skip to content

Commit

Permalink
fix(dumps): update dumps for test
Browse files Browse the repository at this point in the history
  • Loading branch information
pYassine committed Oct 31, 2023
1 parent 00ed95b commit 9de98fa
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 22 deletions.
Binary file modified _scripts/db/dumps/domifa_test.postgres.custom.gz
Binary file not shown.
8 changes: 0 additions & 8 deletions _scripts/db/dumps/domifa_test.postgres.restore-data-only.sql
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,6 @@ COPY public.open_data_places (uuid, "createdAt", "updatedAt", version, nom, adre
\.


--
-- Data for Name: spatial_ref_sys; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.spatial_ref_sys (srid, auth_name, auth_srid, srtext, proj4text) FROM stdin;
\.


--
-- Data for Name: structure_doc; Type: TABLE DATA; Schema: public; Owner: -
--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,6 @@ COPY public.open_data_places (uuid, "createdAt", "updatedAt", version, nom, adre
\.


--
-- Data for Name: spatial_ref_sys; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.spatial_ref_sys (srid, auth_name, auth_srid, srtext, proj4text) FROM stdin;
\.


--
-- Data for Name: structure_doc; Type: TABLE DATA; Schema: public; Owner: -
--
Expand Down
6 changes: 3 additions & 3 deletions _scripts/db/make-dump-data-only-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ case $i in
;;
--dump=*)
DUMP_ENV="${i#*=}"
;;
;;
--column-inserts=*)
COLUMN_INSERTS="--column-inserts"
;;
;;
--exclude-table=*)
TABLE_TO_EXCLUDE="${i#*=}"
if [ "" != "${TABLE_TO_EXCLUDE}" ]
Expand Down Expand Up @@ -69,7 +69,7 @@ echo "##########################################################################
echo ""

(set -x && docker exec ${POSTGRES_CONTAINER_NAME} bash -c "\
(set -x && pg_dump --dbname=${POSTGRES_DUMP_FROM_DATABASE} --username=\${POSTGRES_USER} ${COLUMN_INSERTS} --data-only --no-owner --format=plain ${EXCLUDE_TABLE} --exclude-table=migrations_id_seq --file=${POSTGRES_DUMP_PATH}) \
(set -x && pg_dump --dbname=${POSTGRES_DUMP_FROM_DATABASE} --username=\${POSTGRES_USER} ${COLUMN_INSERTS} --data-only --no-owner --format=plain ${EXCLUDE_TABLE} --exclude-table=migrations_id_seq --exclude-table-data=spatial_ref_sys --file=${POSTGRES_DUMP_PATH}) \
&& ls -lah ${POSTGRES_DUMP_PATH} \
")

Expand Down
6 changes: 3 additions & 3 deletions _scripts/db/make-dump-database-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ case $i in
esac
done

if [ -z "${SOURCE_DB_ENV}" ]
if [ -z "${SOURCE_DB_ENV}" ]
then
echo ""
echo "----------------------------------------------------------------------------------------------"
Expand All @@ -43,7 +43,7 @@ then
exit 1
fi

if [ -z "${DUMP_ENV}" ]
if [ -z "${DUMP_ENV}" ]
then
DUMP_ENV=${SOURCE_DB_ENV}
fi
Expand All @@ -59,7 +59,7 @@ echo "##########################################################################
echo ""

(set -x && docker exec ${POSTGRES_CONTAINER_NAME} bash -c "\
(set -x && pg_dump --dbname=${POSTGRES_DUMP_FROM_DATABASE} --username=\${POSTGRES_USER} --no-owner --format=custom --compress=9 --file=${POSTGRES_DUMP_PATH}) \
(set -x && pg_dump --dbname=${POSTGRES_DUMP_FROM_DATABASE} --exclude-table-data='spatial_ref_sys' --username=\${POSTGRES_USER} --no-owner --format=custom --compress=9 --file=${POSTGRES_DUMP_PATH}) \
&& ls -lah ${POSTGRES_DUMP_PATH} \
")

Expand Down

0 comments on commit 9de98fa

Please sign in to comment.