5.1. Datenbankerweiterungen initialisieren
TEKSI Wastewater unterhält Datenbankerweiterungen, um die folgenden Modelle bedienen zu können:
AG-64 Abwasserkataster Version 2.1.0
AG-96 Genereller_Entwaesserungsplan_AG Version 2.0.0
The database is automatically loaded with the necessary tables and attributes for the extension. In order to be able to use an extension, activate the corresponding app modification Modification Framework for application schema
5.1.1. Ein leeres Datenmodell mit Erweiterung erstellen
Um eine Datenbankerweiterung nutzen zu können, muss sie aus dem Quellcode geladen werden.
Laden Sie eine Standard TWW-Datenbank* https://github.com/TWW/datamodel/releases/latest * download tww_{version}_structure_with_value_lists.sql
Laden Sie den Quellcode herunter * https://github.com/TWW/datamodel/releases/latest * download`Source Code(zip)`
Wenn nötig, passen Sie Ihre PGSYSCONFDIR Umgebungsvariable an
Erstellen Sie ein Batch File wie das Untenstehende und lassen Sie es laufen:
@echo off setlocal set /p tww_dir="Set the directory your downloaded teksi wastewater to" if not exist %tww_dir% ( echo "Path %tww_dir% does not exist. Please download the latest datamodel from https://github.com/TWW/datamodel/releases (structure_with_value_lists.sql) and adjust path in this batch file." PAUSE exit -1 ) pip install pirogue set /p myservice="Please enter the service name? (e.g. tww_community) " REM Set the PYTHONPATH to include the directory containing the app module set "PYTHONPATH=%tww_dir%\datamodel;%PYTHONPATH%" python -m app.create_app.py --pg_service %myservice% --srid 2056 --drop-schema --extension_names agxx foobar demo endlocal PAUSE
For official models, an adapted value list sql is provided.
5.1.2. Erzeugen des Datenmodells unter Linux
Es ist auch unter LINUX möglich das Datenmodell zu erzeugen
Download des Datenmodells
git clone https://github.com/TWW/datamodel cd datamodel
Anpassen des Konfigurationsfile „pg_service.conf“ und setzen des Service auf „pg_tww“, siehe „pg_service-linux“
Erzeugen der Datenbank
psql -U postgres -c 'CREATE DATABASE tww;'
Die Umgebungsvariablen für das Erstellungsskript setzen
./scripts/db_setup.sh
Starten Sie das Skript:
./scripts/db_setup.sh