File size: 469 Bytes
3a66575
 
 
 
 
 
 
 
 
 
fb85f93
 
 
 
 
3a66575
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from sqlmodel import SQLModel, Field, create_engine, Session

class FlightReport(SQLModel, table=True):
    id: int | None = Field(default=None, primary_key=True)
    filename: str
    max_capacity_breached: bool
    peak_crowd_count: int
    duration_frames: int
    chaos_anomalies: int

import os

DATABASE_URL = os.environ.get("DATABASE_URL", "sqlite:///crowd_data.db")

engine = create_engine(DATABASE_URL)

def init_db():
    SQLModel.metadata.create_all(engine)