Skip to content

Commit

Permalink
updated just file
Browse files Browse the repository at this point in the history
added the create view for the swdd so it is possible to get acces to user view without modification
  • Loading branch information
agmes4 committed Jan 23, 2024
1 parent 0529485 commit e3b3317
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.'
Expand Down

0 comments on commit e3b3317

Please sign in to comment.