WIP compliance

This commit is contained in:
2026-03-28 14:41:15 -04:00
parent 1c9fbbda6c
commit 0521b8dfd6
7 changed files with 1931 additions and 76 deletions
+1 -5
View File
@@ -2,7 +2,7 @@ from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, declarative_base
import os
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///./drugs.db")
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///./data/drugs.db")
# For SQLite, ensure the directory exists
if "sqlite" in DATABASE_URL:
@@ -18,10 +18,6 @@ engine = create_engine(
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
# Drop and recreate all tables (for development only)
Base.metadata.drop_all(bind=engine)
Base.metadata.create_all(bind=engine)
def get_db():
db = SessionLocal()
try: