generated from azures04/Base-REST-API
Add transport DDL, repos and transport service
Add database DDL and server-side data access/service layers for transport domain. New SQL DDL files create transport_types, lines, stations, platforms and platform_lines tables (with FKs, indexes, spatial POINT column, CHECK constraints, and triggers to populate location). New repositories implement queries and CRUD for lines, stations, platforms and platform_lines (including distance/nearest-platform and accessibility queries). A transportService aggregates repo functions and exposes high-level operations (CRUD, station/line lookups, platform-line management and nearest-platform validation).
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
CREATE TRIGGER IF NOT EXISTS trg_platforms_before_insert
|
||||
BEFORE INSERT ON `platforms`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
SET NEW.location = POINT(NEW.longitude, NEW.latitude);
|
||||
END;
|
||||
|
||||
CREATE TRIGGER IF NOT EXISTS trg_platforms_before_update
|
||||
BEFORE UPDATE ON `platforms`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
SET NEW.location = POINT(NEW.longitude, NEW.latitude);
|
||||
END;
|
||||
Reference in New Issue
Block a user