@@ -37,7 +37,7 @@ use crate::modelsv2::get_table;
37
37
use crate :: modelsv2:: prelude:: * ;
38
38
use crate :: modelsv2:: railjson:: persist_railjson;
39
39
use crate :: modelsv2:: Create ;
40
- use crate :: tables:: infra:: dsl;
40
+ use editoast_models :: tables:: infra:: dsl;
41
41
use editoast_models:: DbConnection ;
42
42
use editoast_models:: DbConnectionPoolV2 ;
43
43
use editoast_schemas:: infra:: RailJson ;
@@ -57,7 +57,7 @@ editoast_common::schemas! {
57
57
pub const DEFAULT_INFRA_VERSION : & str = "0" ;
58
58
59
59
#[ derive( Debug , Clone , Derivative , Serialize , Deserialize , ModelV2 , utoipa:: ToSchema ) ]
60
- #[ model( table = crate :: tables:: infra) ]
60
+ #[ model( table = editoast_models :: tables:: infra) ]
61
61
#[ derivative( Default ) ]
62
62
pub struct Infra {
63
63
pub id : i64 ,
@@ -151,7 +151,7 @@ impl Infra {
151
151
let sql = if object != ObjectType :: Signal {
152
152
format ! ( "INSERT INTO {layer_table}(obj_id,geographic,infra_id) SELECT obj_id,geographic,$1 FROM {layer_table} WHERE infra_id=$2" )
153
153
} else {
154
- format ! ( "INSERT INTO {layer_table}(obj_id,geographic,infra_id, angle_geo, signaling_system, sprite)
154
+ format ! ( "INSERT INTO {layer_table}(obj_id,geographic,infra_id, angle_geo, signaling_system, sprite)
155
155
SELECT obj_id,geographic,$1,angle_geo, signaling_system, sprite FROM {layer_table} WHERE infra_id = $2" )
156
156
} ;
157
157
@@ -169,8 +169,8 @@ impl Infra {
169
169
sql_query ( "ALTER TABLE infra_object_operational_point ENABLE TRIGGER search_operational_point__ins_trig" ) . execute ( conn) . await ?;
170
170
171
171
// Fill search tables
172
- sql_query ( "INSERT INTO search_signal(id, label, line_name, infra_id, obj_id, signaling_systems, settings, line_code)
173
- SELECT signal.id, label, line_name, $1, search_signal.obj_id, signaling_systems, settings, line_code FROM search_signal
172
+ sql_query ( "INSERT INTO search_signal(id, label, line_name, infra_id, obj_id, signaling_systems, settings, line_code)
173
+ SELECT signal.id, label, line_name, $1, search_signal.obj_id, signaling_systems, settings, line_code FROM search_signal
174
174
JOIN infra_object_signal AS signal ON search_signal.obj_id = signal.obj_id and signal.infra_id = $1
175
175
WHERE search_signal.infra_id = $2" )
176
176
. bind :: < BigInt , _ > ( cloned_infra. id )
@@ -182,8 +182,8 @@ impl Infra {
182
182
. bind :: < BigInt , _ > ( self . id )
183
183
. execute ( conn) . await ?;
184
184
185
- sql_query ( "INSERT INTO search_operational_point(id, infra_id, obj_id, uic, trigram, ci, ch, name)
186
- SELECT op.id, $1, op.obj_id, uic, trigram, ci, ch, name FROM search_operational_point
185
+ sql_query ( "INSERT INTO search_operational_point(id, infra_id, obj_id, uic, trigram, ci, ch, name)
186
+ SELECT op.id, $1, op.obj_id, uic, trigram, ci, ch, name FROM search_operational_point
187
187
JOIN infra_object_operational_point AS op ON search_operational_point.obj_id = op.obj_id and op.infra_id = $1
188
188
WHERE search_operational_point.infra_id = $2" )
189
189
. bind :: < BigInt , _ > ( cloned_infra. id )
@@ -252,8 +252,8 @@ impl Infra {
252
252
///
253
253
/// Note: Everything is done in one transaction for consistency.
254
254
pub async fn fast_delete_static ( conn : & mut DbConnection , infra_id : i64 ) -> Result < bool > {
255
- use crate :: tables:: infra_object_track_section:: dsl as track_section_dsl;
256
- use crate :: tables:: search_track:: dsl as search_track_dsl;
255
+ use editoast_models :: tables:: infra_object_track_section:: dsl as track_section_dsl;
256
+ use editoast_models :: tables:: search_track:: dsl as search_track_dsl;
257
257
258
258
conn. build_transaction ( )
259
259
. run ( |conn| Box :: pin ( async {
0 commit comments