renew schema and tests for new dtabases
Sonarqube Scanner / Prepare environment (push) Successful in 10s
Sonarqube Scanner / Build and test (push) Successful in 32s
Sonarqube Scanner / SonarQube analysis (push) Successful in 1m41s
Sonarqube Scanner / Deploy to Server (push) Successful in 10s

This commit is contained in:
Florian Zumpe
2026-10-03 13:57:17 +02:00
parent edfe227641
commit 5fe79067b0
9 changed files with 189 additions and 108 deletions
-19
View File
@@ -6,17 +6,10 @@ CREATE TABLE IF NOT EXISTS routes (
school_name TEXT NOT NULL DEFAULT '',
status TEXT NOT NULL DEFAULT 'active' CHECK (status IN ('active', 'deleted')),
gpx_path TEXT NOT NULL,
start_lat REAL,
start_lon REAL,
center_lat REAL,
center_lon REAL,
min_lat REAL,
min_lon REAL,
max_lat REAL,
max_lon REAL,
distance_m REAL NOT NULL DEFAULT 0,
elevation_gain_m REAL NOT NULL DEFAULT 0,
point_count INTEGER NOT NULL DEFAULT 0,
created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
deleted_at TEXT DEFAULT NULL,
@@ -34,17 +27,6 @@ BEGIN
WHERE id = NEW.id;
END;
CREATE TABLE IF NOT EXISTS route_points (
id INTEGER PRIMARY KEY AUTOINCREMENT,
route_id INTEGER NOT NULL REFERENCES routes(id),
sequence INTEGER NOT NULL,
lat REAL NOT NULL,
lon REAL NOT NULL,
elevation REAL,
recorded_at TEXT,
UNIQUE(route_id, sequence)
) STRICT;
CREATE TABLE IF NOT EXISTS pois (
id INTEGER PRIMARY KEY AUTOINCREMENT,
route_id INTEGER NOT NULL REFERENCES routes(id),
@@ -80,6 +62,5 @@ END;
CREATE INDEX IF NOT EXISTS idx_routes_status ON routes(status);
CREATE INDEX IF NOT EXISTS idx_routes_activation ON routes(status, activated_at);
CREATE INDEX IF NOT EXISTS idx_route_points_route ON route_points(route_id, sequence);
CREATE INDEX IF NOT EXISTS idx_pois_route ON pois(route_id, sequence);
CREATE INDEX IF NOT EXISTS idx_poi_images_poi ON poi_images(poi_id, sequence);