From 8dae88d6b4f1642b6032ca3fdf5de1c23e5ed2e1 Mon Sep 17 00:00:00 2001 From: Dennis Priskorn Date: Wed, 28 Aug 2024 11:47:01 +0200 Subject: [PATCH] fix: setup: Add DB_USER and DB_NAME variables to example config and use them when creating the tables. --- config/example.py | 3 +++ create_db.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config/example.py b/config/example.py index 28f5052..26b8a0e 100644 --- a/config/example.py +++ b/config/example.py @@ -1,5 +1,8 @@ """Sample config.""" +# POSTGIS +DB_USER = "owl" +DB_NAME = "matcher" ID_TAGGING_SCHEMA_DIR = "/var/lib/data/id-tagging-schema" ID_PRESET_DIR = "/var/lib/data/id-tagging-schema/data/presets/" diff --git a/create_db.py b/create_db.py index 2c1c6f9..761fce7 100755 --- a/create_db.py +++ b/create_db.py @@ -2,9 +2,10 @@ from sqlalchemy.schema import CreateIndex, CreateTable +from config.default import DB_USER, DB_NAME from matcher import database, model -DB_URL = "postgresql:///matcher" +DB_URL = f"postgresql://{DB_USER}@localhost/{DB_NAME}" database.init_db(DB_URL)