-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff17ab1
commit 698c5c1
Showing
3 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
editoast/migrations/2024-02-01-002011_create_v2_scenario_trainschedule_timetable/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DROP TABLE scenariov2; | ||
DROP TABLE trainschedulev2; | ||
DROP TABLE timetablev2; |
30 changes: 30 additions & 0 deletions
30
editoast/migrations/2024-02-01-002011_create_v2_scenario_trainschedule_timetable/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
CREATE TABLE timetablev2 ( | ||
id int8 PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, | ||
infra_id int8 NOT NULL REFERENCES infra(id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, | ||
electrical_profile_set_id int8 NULL REFERENCES electrical_profile_set(id) ON DELETE CASCADE | ||
); | ||
CREATE TABLE scenariov2 ( | ||
id int8 PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, | ||
name varchar(128) NOT NULL, | ||
description varchar(1024) NOT NULL, | ||
creation_date timestamptz NOT NULL, | ||
last_modification timestamptz NOT NULL, | ||
tags text [] NOT NULL, | ||
timetable_id int8 NOT NULL UNIQUE REFERENCES timetablev2(id) DEFERRABLE INITIALLY DEFERRED, | ||
study_id int8 NOT NULL REFERENCES study(id) ON DELETE CASCADE | ||
); | ||
CREATE TABLE trainschedulev2 ( | ||
id int8 PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, | ||
train_name varchar(128) NOT NULL, | ||
labels jsonb NOT NULL, | ||
rolling_stock_id int8 NOT NULL REFERENCES rolling_stock(id) ON DELETE CASCADE, | ||
timetable_id int8 NOT NULL UNIQUE REFERENCES timetablev2(id) DEFERRABLE INITIALLY DEFERRED, | ||
departure_time float8 NOT NULL, | ||
scheduled_points jsonb NOT NULL, | ||
allowances jsonb NOT NULL, | ||
initial_speed float8 NOT NULL, | ||
comfort varchar(8) NOT NULL, | ||
speed_limit_tags varchar(128) NULL, | ||
power_restriction_ranges jsonb NULL, | ||
options jsonb NULL | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters