Database Table Schemas
This document provides the current relational schema used by the project. Schema changes are tracked with Alembic, and the test database mirrors the application database so that migrations and table structures remain consistent.
Dynamic MData
trr
trr_id: TEXTtrr_time: TIMESTAMPtrr_nsv_id: INTEGER, valid range is 1 to 4- Primary key:
(trr_id, trr_time)
ligne
ligne_id: TEXTligne_time: TIMESTAMPligne_nsv_id: INTEGER, valid range is 1 to 4- Primary key:
(ligne_id, ligne_time)
OpenMeteo
openmeteo
time: TIMESTAMPtemperature_2m: FLOATapparent_temperature: FLOATrelativehumidity_2m: INTEGER, range 0 to 100precipitation: FLOATrain: FLOATsnowfall: FLOATweathercode: INTEGERpressure_msl: FLOATcloudcover: INTEGER, range 0 to 100windspeed_10m: FLOATwindgusts_10m: FLOAT- Primary key:
time
Atmo Auvergne-Rhône-Alpes
atmo
time: TIMESTAMPpollution_index: INTEGER, valid range is 1 to 6is_value_mesured: BOOLEANPM10_index: INTEGER, valid range is 1 to 6PM2_5_index: INTEGER, valid range is 1 to 6O3_index: INTEGER, valid range is 1 to 6NO2_index: INTEGER, valid range is 1 to 6SO2_index: INTEGER, valid range is 1 to 6- Primary key:
time
Notes
The main analytical tables are the time-series tables (trr, ligne, openmeteo, atmo). They are designed around a timestamp-based primary key so that historical comparison and joins are straightforward across all sources.