This directory contains the database setup and query functions for the SmartRoutes application.
migrations.ts - Contains the database schema definitions and migration functionsqueries.ts - Contains typed query functions for interacting with the databaseStores user account information:
id - Primary keyemail - User's Gmail address (unique)name - User's name (optional)created_at - Account creation timestamplast_login - Last login timestampStores traffic congestion reports:
id - Primary keyuser_id - Foreign key to users tablelatitude - Geographic latitudelongitude - Geographic longitudecongestion_level - Traffic level (1: Light, 2: Moderate, 3: Heavy, 4: Standstill)description - Optional text descriptioncreated_at - Report timestampStores users' last known locations:
id - Primary keyuser_id - Foreign key to users tablelatitude - Geographic latitudelongitude - Geographic longitudeupdated_at - Last update timestamp