Infrastructure: Implement master/dev/vX branching, save git path, and fix username casing
This commit is contained in:
@@ -2,10 +2,16 @@ from sqlalchemy import create_engine
|
||||
from sqlalchemy.orm import sessionmaker, declarative_base
|
||||
import os
|
||||
|
||||
# Create data directory if it doesn't exist
|
||||
os.makedirs("data", exist_ok=True)
|
||||
# Get absolute path for the backend directory
|
||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
DATA_DIR = os.path.join(BASE_DIR, "data")
|
||||
|
||||
SQLALCHEMY_DATABASE_URL = "sqlite:///./data/inventory.db"
|
||||
# Create data directory if it doesn't exist in the backend folder
|
||||
os.makedirs(DATA_DIR, exist_ok=True)
|
||||
|
||||
# Handle absolute path for SQLite (needs 4 slashes on Unix)
|
||||
db_path = os.path.join(DATA_DIR, "inventory.db")
|
||||
SQLALCHEMY_DATABASE_URL = f"sqlite:////{db_path}"
|
||||
|
||||
# connect_args={"check_same_thread": False} is required for SQLite in FastAPI/Starlette
|
||||
engine = create_engine(
|
||||
|
||||
Reference in New Issue
Block a user