From 6955739841d8d1bf0441ea526ee9ec6f54ef2540 Mon Sep 17 00:00:00 2001 From: matsewe Date: Wed, 3 Jul 2024 11:57:01 +0200 Subject: [PATCH] Fix database errors --- .gitea/workflows/build-push-image.yml | 3 +-- app/main.py | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/build-push-image.yml b/.gitea/workflows/build-push-image.yml index 8ddebef..15fa13b 100644 --- a/.gitea/workflows/build-push-image.yml +++ b/.gitea/workflows/build-push-image.yml @@ -46,8 +46,7 @@ jobs: context: . file: ./Dockerfile platforms: | - linux/amd64 - linux/arm64 + linux/amd64 push: true tags: | # replace it with your local IP and tags git.matsewe.de/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }} diff --git a/app/main.py b/app/main.py index aa14637..17a8e6a 100644 --- a/app/main.py +++ b/app/main.py @@ -19,13 +19,14 @@ from starlette.middleware import Middleware from starlette_context import context, plugins from starlette_context.middleware import RawContextMiddleware +Base.metadata.create_all(engine) + if os.path.isfile("/tmp/first_run") and (os.environ.get("RELOAD_ON_FIRST_RUN", "").lower() == "true"): print("First run ... load data") with SessionLocal() as db: asyncio.run(admin.create_upload_file(include_non_singable=True, db=db)) os.remove("/tmp/first_run") -# Base.metadata.create_all(engine) middleware = [ Middleware(