diff --git a/README.md b/README.md index 6e7d288..258286e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ## Next steps - [x] Station -- [ ] Path +- [ ] Route ## Fancy features - see when a group starts going to your direction diff --git a/migration.sql b/migration.sql index 695721f..1b23dd8 100644 --- a/migration.sql +++ b/migration.sql @@ -9,17 +9,17 @@ CREATE TABLE station ( lng REAL ); -CREATE TABLE path ( +CREATE TABLE route ( id INTEGER PRIMARY KEY, name TEXT NOT NULL -- e.g. 'wiwö' ); -CREATE TABLE path_station ( - path_id INTEGER, +CREATE TABLE route_station ( + route_id INTEGER, station_id INTEGER, pos INTEGER, - PRIMARY KEY (path_id, station_id), - FOREIGN KEY (path_id) REFERENCES path(id), + PRIMARY KEY (route_id, station_id), + FOREIGN KEY (route_id) REFERENCES route(id), FOREIGN KEY (station_id) REFERENCES station(id) ); @@ -30,8 +30,8 @@ CREATE TABLE "group" ( amount_people INTEGER, first_station_id INTEGER NOT NULL, FOREIGN KEY (first_station_id) REFERENCES station(id) - path_id INTEGER NOT NULL, - FOREIGN KEY (path_id) REFERENCES path(id) + route_id INTEGER NOT NULL, + FOREIGN KEY (route_id) REFERENCES route(id) ); CREATE TABLE group_station (