-
Notifications
You must be signed in to change notification settings - Fork 46
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
50acf5a
commit 7c70671
Showing
3 changed files
with
49 additions
and
76 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
editoast/migrations/2024-08-13-140358_delete_tsv1_tables/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,45 @@ | ||
-- This file should undo anything in `up.sql` | ||
|
||
|
||
CREATE TABLE pathfinding ( | ||
id int8 PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, | ||
"owner" uuid NOT NULL, | ||
created timestamptz NOT NULL, | ||
payload jsonb NOT NULL, | ||
slopes jsonb NOT NULL, | ||
curves jsonb NOT NULL, | ||
geographic geometry(linestring, 4326) NOT NULL, | ||
schematic geometry(linestring, 4326) NOT NULL, | ||
infra_id int8 NOT NULL, | ||
length float8 NOT NULL, | ||
CONSTRAINT pathfinding_fkey FOREIGN KEY (infra_id) REFERENCES infra(id) ON DELETE CASCADE | ||
); | ||
|
||
CREATE TABLE timetable ( | ||
id int8 PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, | ||
name varchar(128) NOT NULL | ||
); | ||
|
||
CREATE TABLE scenario ( | ||
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, | ||
infra_id int8 NOT NULL REFERENCES infra(id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, | ||
timetable_id int8 NOT NULL UNIQUE REFERENCES timetable(id) DEFERRABLE INITIALLY DEFERRED, | ||
study_id int8 NOT NULL REFERENCES study(id) ON DELETE CASCADE, | ||
electrical_profile_set_id int8 NULL REFERENCES electrical_profile_set(id) ON DELETE CASCADE | ||
); | ||
CREATE INDEX scenario_infra_id ON scenario USING btree (infra_id); | ||
|
||
CREATE TABLE simulation_output ( | ||
id int8 PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, | ||
mrsp jsonb NOT NULL, | ||
base_simulation jsonb NOT NULL, | ||
eco_simulation jsonb NULL, | ||
electrification_ranges jsonb NOT NULL, | ||
train_schedule_id int8 NULL UNIQUE REFERENCES train_schedule(id) ON DELETE CASCADE, | ||
power_restriction_ranges jsonb NOT NULL | ||
); |
4 changes: 4 additions & 0 deletions
4
editoast/migrations/2024-08-13-140358_delete_tsv1_tables/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,4 @@ | ||
DROP TABLE scenario CASCADE; | ||
DROP TABLE simulation_output; | ||
DROP TABLE timetable CASCADE; | ||
DROP TABLE pathfinding CASCADE; |
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