fix: setup: Add DB_USER and DB_NAME variables to example config and use them when creating the tables.

This commit is contained in:
Dennis Priskorn 2024-08-28 11:47:01 +02:00
parent 9f90fbd52d
commit 8dae88d6b4
2 changed files with 5 additions and 1 deletions

View file

@ -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/"

View file

@ -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)