From e3b331747ed241dc2faa1fd9d939969d3a639cd8 Mon Sep 17 00:00:00 2001 From: agmes4 Date: Tue, 23 Jan 2024 12:52:01 +0100 Subject: [PATCH] updated just file added the create view for the swdd so it is possible to get acces to user view without modification --- justfile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/justfile b/justfile index f28446d3d..4600d7c42 100644 --- a/justfile +++ b/justfile @@ -34,7 +34,19 @@ build: docker buildx bake # initializes the dev db with the instance -schema-import: _confirm-drop _schema-import (alembic "upgrade" "head") +schema-import: _confirm-drop _schema-import (alembic "upgrade" "head") create_view + +create_view: + psql -wb postgres://postgres@127.0.0.1:55432/pycroft -c 'create materialized view swdd_vv as \ + SELECT swdd_vv.persvv_id, \ + swdd_vv.person_id, \ + swdd_vv.vo_suchname, \ + swdd_vv.person_hash, \ + swdd_vv.mietbeginn, \ + swdd_vv.mietende, \ + swdd_vv.status_id \ + FROM swdd.swdd_vv; \ + ALTER materialized view swdd_vv owner to postgres;' _confirm-drop: #!/usr/bin/env bash @@ -52,10 +64,9 @@ _schema-import: _ensure_schema_dir _stop_all (_up "dev-db") --echo-errors -c '\set ON_ERROR_STOP 1' \ -c '\echo dropping schema…' \ -c 'drop schema if exists pycroft cascade' \ + -f {{ swdd }} \ -c '\echo importing schema…' \ -f {{ sql_schema }} \ - -c '\echo import swdd' \ - -f {{ swdd }} \ -c '\echo importing dump…' \ -f {{ sql_dump }} \ -c '\echo all done.'