From 54c7fe1ed28e81c3b835a552d36c1406ee700847 Mon Sep 17 00:00:00 2001 From: ahtlon Date: Tue, 28 Jul 2026 16:14:33 +0200 Subject: [PATCH] [alembic] automaticly stamp new database with the "head" tag so migrations are easier. also fix nix develop due to multiple top level folders --- app/services/database.py | 4 ++++ pyproject.toml | 3 +++ 2 files changed, 7 insertions(+) diff --git a/app/services/database.py b/app/services/database.py index 983f155..513a55c 100644 --- a/app/services/database.py +++ b/app/services/database.py @@ -8,6 +8,10 @@ engine = create_engine(SQLALCHEMY_DATABASE_URL) def create_db_and_tables(): SQLModel.metadata.create_all(engine) + from alembic.config import Config + from alembic import command + alembic_cfg = Config("./alembic.ini") + command.stamp(alembic_cfg, "head") def get_session(): with Session(engine) as db: diff --git a/pyproject.toml b/pyproject.toml index 7711393..9fe9cf6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,3 +25,6 @@ python-desfire = { git = "https://github.com/waza-ari/python-desfire" } [tool.uv.extra-build-dependencies] python-desfire = ["poetry"] "pyscard" = ["setuptools"] + +[tool.setuptools] +py-modules = ["app"]