@@ -148,11 +148,19 @@ impl Infra {
148
148
149
149
if let Some ( layer_table) = get_geometry_layer_table ( & object) {
150
150
let layer_table = layer_table. to_string ( ) ;
151
- let sql = if object != ObjectType :: Signal {
152
- format ! ( "INSERT INTO {layer_table}(obj_id,geographic,infra_id) SELECT obj_id,geographic,$1 FROM {layer_table} WHERE infra_id=$2" )
153
- } else {
154
- format ! ( "INSERT INTO {layer_table}(obj_id,geographic,infra_id, angle_geo, signaling_system, sprite)
151
+ let sql = match object {
152
+ ObjectType :: Signal => {
153
+ format ! ( "INSERT INTO {layer_table}(obj_id,geographic,infra_id, angle_geo, signaling_system, sprite)
155
154
SELECT obj_id,geographic,$1,angle_geo, signaling_system, sprite FROM {layer_table} WHERE infra_id = $2" )
155
+ }
156
+ ,
157
+ ObjectType :: OperationalPoint => {
158
+ format ! ( "INSERT INTO {layer_table}(obj_id,geographic,infra_id, kp, track_section)
159
+ SELECT obj_id,geographic,$1,kp, track_section FROM {layer_table} WHERE infra_id = $2" )
160
+ }
161
+ _ => {
162
+ format ! ( "INSERT INTO {layer_table}(obj_id,geographic,infra_id) SELECT obj_id,geographic,$1 FROM {layer_table} WHERE infra_id=$2" )
163
+ }
156
164
} ;
157
165
158
166
sql_query ( sql)
0 commit comments