From 5a199d40a69251705d6fa52cdbc3df960e5fc9f7 Mon Sep 17 00:00:00 2001 From: agmes4 Date: Sun, 21 Jan 2024 23:20:57 +0100 Subject: [PATCH] changed justfile added swdd.sql schema import for database --- justfile | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/justfile b/justfile index d3a5a62e5..c03a663c0 100644 --- a/justfile +++ b/justfile @@ -10,6 +10,7 @@ dev-psql := drc + " exec --user=postgres dev-db psql pycroft" schemadir := justfile_directory() / "data" sql_schema := schemadir / "pycroft_schema.sql" sql_dump := schemadir / "pycroft.sql" +sswd := justfile_directory() / "docker" / "db" / "docker-entrypoint-initdb.d" / "swdd.sql" # test @@ -46,16 +47,18 @@ _confirm-drop: _schema-import: _ensure_schema_dir _stop_all (_up "dev-db") psql postgres://postgres@127.0.0.1:55432/pycroft \ - --quiet --no-password -o /dev/null \ - -c 'set client_min_messages to WARNING' \ - --echo-errors -c '\set ON_ERROR_STOP 1' \ - -c '\echo dropping schema…' \ - -c 'drop schema if exists pycroft cascade' \ - -c '\echo importing schema…' \ - -f {{ sql_schema }} \ - -c '\echo importing dump…' \ - -f {{ sql_dump }} \ - -c '\echo all done.' + --quiet --no-password -o /dev/null \ + -c 'set client_min_messages to WARNING' \ + --echo-errors -c '\set ON_ERROR_STOP 1' \ + -c '\echo dropping schema…' \ + -c 'drop schema if exists pycroft cascade' \ + -c '\echo importing schema…' \ + -f {{ sql_schema }} \ + -c '\echo import sswd' \ + -f {{ sswd }} \ + -c '\echo importing dump…' \ + -f {{ sql_dump }} \ + -c '\echo all done.' _ensure_schema_dir: #!/usr/bin/env bash