Skip to content

Commit

Permalink
changed justfile
Browse files Browse the repository at this point in the history
added swdd.sql schema import for database
  • Loading branch information
agmes4 committed Jan 21, 2024
1 parent 4b8eb3c commit 5a199d4
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5a199d4

Please sign in to comment.