Compare commits

..

1 Commits

Author SHA1 Message Date
d5907074c9 fix: moved to creyPY create_if_not_exist 2025-07-09 19:54:16 +02:00
2 changed files with 1 additions and 9 deletions

View File

@@ -1,8 +0,0 @@
from sqlalchemy_utils import create_database, database_exists
def create_if_not_exists(db_name: str):
from creyPY.fastapi.db.session import SQLALCHEMY_DATABASE_URL
if not database_exists(SQLALCHEMY_DATABASE_URL + db_name):
create_database(SQLALCHEMY_DATABASE_URL + db_name)

View File

@@ -2,6 +2,7 @@ import os
from datetime import datetime, timedelta
from apscheduler.schedulers.background import BackgroundScheduler
from creyPY.fastapi.db.helpers import create_if_not_exists
from creyPY.fastapi.db.session import SQLALCHEMY_DATABASE_URL, get_db, name
from sqlalchemy.orm import Session
@@ -9,7 +10,6 @@ from alembic import command
from alembic.config import Config
from app.models.app import Application
from app.models.entry import LogEntry
from app.services.db.session import create_if_not_exists
def delete_old_logs(sess: Session | None = None):