Skip to content

Commit 10fbfa2

Browse files
committed
front: saving nge nodes
See osrd-project/osrd-confidential#597 - adding editoast API to manage nge nodes - refacto osrd-nge sync to use the API - apply layout with webcola on nodes Signed-off-by: Benoit Simard <contact@bsimard.com>
1 parent 2c47f6a commit 10fbfa2

File tree

22 files changed

+2257
-666
lines changed

22 files changed

+2257
-666
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 -> Float8,
420+
position_y -> Float8,
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::*;
@@ -731,6 +751,7 @@ diesel::joinable!(infra_object_signal -> infra (infra_id));
731751
diesel::joinable!(infra_object_speed_section -> infra (infra_id));
732752
diesel::joinable!(infra_object_switch -> infra (infra_id));
733753
diesel::joinable!(infra_object_track_section -> infra (infra_id));
754+
diesel::joinable!(macro_node -> scenario (scenario_id));
734755
diesel::joinable!(project -> document (image_id));
735756
diesel::joinable!(rolling_stock_livery -> document (compound_image_id));
736757
diesel::joinable!(rolling_stock_livery -> rolling_stock (rolling_stock_id));
@@ -784,6 +805,7 @@ diesel::allow_tables_to_appear_in_same_query!(
784805
infra_object_speed_section,
785806
infra_object_switch,
786807
infra_object_track_section,
808+
macro_node,
787809
project,
788810
rolling_stock,
789811
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 float8 NOT NULL,
5+
position_y float8 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)