Skip to content

Commit ea0cda5

Browse files
committed
editoast: nge saving node's positions
Signed-off-by: Benoit Simard <[email protected]>
1 parent 419a315 commit ea0cda5

File tree

18 files changed

+1272
-30
lines changed

18 files changed

+1272
-30
lines changed

editoast/editoast_models/src/tables.rs

+22
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,26 @@ diesel::table! {
410410
}
411411
}
412412

413+
diesel::table! {
414+
use diesel::sql_types::*;
415+
use postgis_diesel::sql_types::*;
416+
417+
macro_node (id) {
418+
id -> Int8,
419+
scenario_id -> Int8,
420+
position_x -> Int8,
421+
position_y -> Int8,
422+
#[max_length = 255]
423+
full_name -> Nullable<Varchar>,
424+
connection_time -> Int8,
425+
labels -> Array<Nullable<Text>>,
426+
#[max_length = 25]
427+
trigram -> Nullable<Varchar>,
428+
#[max_length = 255]
429+
path_item_key -> Varchar,
430+
}
431+
}
432+
413433
diesel::table! {
414434
use diesel::sql_types::*;
415435
use postgis_diesel::sql_types::*;
@@ -785,6 +805,7 @@ diesel::joinable!(infra_object_signal -> infra (infra_id));
785805
diesel::joinable!(infra_object_speed_section -> infra (infra_id));
786806
diesel::joinable!(infra_object_switch -> infra (infra_id));
787807
diesel::joinable!(infra_object_track_section -> infra (infra_id));
808+
diesel::joinable!(macro_node -> scenario (scenario_id));
788809
diesel::joinable!(project -> document (image_id));
789810
diesel::joinable!(rolling_stock_livery -> document (compound_image_id));
790811
diesel::joinable!(rolling_stock_livery -> rolling_stock (rolling_stock_id));
@@ -841,6 +862,7 @@ diesel::allow_tables_to_appear_in_same_query!(
841862
infra_object_speed_section,
842863
infra_object_switch,
843864
infra_object_track_section,
865+
macro_node,
844866
project,
845867
rolling_stock,
846868
rolling_stock_livery,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DROP TABLE IF EXISTS macro_node;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
CREATE TABLE IF NOT EXISTS macro_node (
2+
id int8 PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
3+
scenario_id int8 NOT NULL,
4+
position_x int8 NOT NULL,
5+
position_y int8 NOT NULL,
6+
full_name varchar(255),
7+
connection_time int8 NOT NULL DEFAULT 0,
8+
labels text[] NOT NULL,
9+
trigram varchar(25),
10+
path_item_key varchar(255) NOT NULL,
11+
UNIQUE (scenario_id, path_item_key),
12+
CONSTRAINT fk_scenario
13+
FOREIGN KEY(scenario_id)
14+
REFERENCES scenario(id)
15+
);

0 commit comments

Comments
 (0)