Skip to content

Commit 0f5046d

Browse files
committed
editoast: nge saving node's positions
Signed-off-by: Benoit Simard <contact@bsimard.com>
1 parent 3ae2b6a commit 0f5046d

File tree

18 files changed

+1271
-29
lines changed

18 files changed

+1271
-29
lines changed

editoast/editoast_models/src/tables.rs

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

412+
diesel::table! {
413+
use diesel::sql_types::*;
414+
use postgis_diesel::sql_types::*;
415+
416+
macro_node (id) {
417+
id -> Int8,
418+
scenario_id -> Int8,
419+
position_x -> Int8,
420+
position_y -> Int8,
421+
#[max_length = 255]
422+
full_name -> Nullable<Varchar>,
423+
connection_time -> Int8,
424+
labels -> Array<Nullable<Text>>,
425+
#[max_length = 25]
426+
trigram -> Nullable<Varchar>,
427+
#[max_length = 255]
428+
path_item_key -> Varchar,
429+
}
430+
}
431+
412432
diesel::table! {
413433
use diesel::sql_types::*;
414434
use postgis_diesel::sql_types::*;
@@ -783,6 +803,7 @@ diesel::joinable!(infra_object_signal -> infra (infra_id));
783803
diesel::joinable!(infra_object_speed_section -> infra (infra_id));
784804
diesel::joinable!(infra_object_switch -> infra (infra_id));
785805
diesel::joinable!(infra_object_track_section -> infra (infra_id));
806+
diesel::joinable!(macro_node -> scenario (scenario_id));
786807
diesel::joinable!(project -> document (image_id));
787808
diesel::joinable!(rolling_stock_livery -> document (compound_image_id));
788809
diesel::joinable!(rolling_stock_livery -> rolling_stock (rolling_stock_id));
@@ -837,6 +858,7 @@ diesel::allow_tables_to_appear_in_same_query!(
837858
infra_object_speed_section,
838859
infra_object_switch,
839860
infra_object_track_section,
861+
macro_node,
840862
project,
841863
rolling_stock,
842864
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)