Skip to content

Commit

Permalink
fix(ws, test): correct insert on ve_arc_*
Browse files Browse the repository at this point in the history
  • Loading branch information
danimarinBG committed Jan 21, 2025
1 parent 3ac9b33 commit a16a9a8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
16 changes: 14 additions & 2 deletions test/plsql/ws/test_gw_fct_setarcdivide.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,20 @@ VALUES('-902', '-902', 43.2300, NULL, 'SHTFF-VALVE160-PN16', 'SHORTPIPE', 3, NUL
INSERT INTO node (node_id, code, elevation, "depth", nodecat_id, epa_type, sector_id, arc_id, parent_id, state, state_type, annotation, observ, "comment", dma_id, presszone_id, soilcat_id, function_type, category_type, fluid_type, location_type, workcat_id, workcat_id_end, buildercat_id, builtdate, enddate, ownercat_id, muni_id, postcode, streetaxis_id, postnumber, postcomplement, streetaxis2_id, postnumber2, postcomplement2, descript, link, verified, rotation, the_geom, undelete, label_x, label_y, label_rotation, publish, inventory, hemisphere, expl_id, num_value, feature_type, tstamp, lastupdate, lastupdate_user, insert_user, minsector_id, dqa_id, staticpressure, district_id, adate, adescript, accessibility, workcat_id_plan, asset_id, om_state, conserv_state, access_type, placement_type, expl_id2, brand_id, model_id, serial_number, macrominsector_id)
VALUES('-903', '-903', 43.2300, NULL, 'SHTFF-VALVE160-PN16', 'SHORTPIPE', 3, NULL, NULL, 1, 2, NULL, NULL, NULL, 1, '3', 'soil1', NULL, NULL, NULL, NULL, 'work1', NULL, NULL, '2024-08-21', NULL, 'owner1', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', '1', NULL, 'SRID=25831;POINT (419190.2220079739 4576779.0129214395)'::public.geometry, NULL, NULL, NULL, NULL, true, true, NULL, 1, NULL, 'NODE', '2024-08-21 17:44:05.610', '2024-08-21 17:44:05.651', 'postgres', 'postgres', NULL, NULL, 28.520, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

INSERT INTO ve_arc_varc (arc_id, code, node_1, nodetype_1, elevation1, depth1, staticpress1, node_2, nodetype_2, staticpress2, elevation2, depth2, arccat_id, arc_type, sys_type, cat_matcat_id, cat_pnom, cat_dnom, cat_dint, epa_type, state, state_type, expl_id, macroexpl_id, sector_id, sector_type, presszone_id, presszone_name, presszone_type, presszone_head, dma_id, dma_name, dma_type, macrodma_id, dqa_id, dqa_name, dqa_type, macrodqa_id, annotation, observ, "comment", gis_length, custom_length, soilcat_id, function_type, category_type, fluid_type, location_type, workcat_id, workcat_id_end, workcat_id_plan, buildercat_id, builtdate, enddate, ownercat_id, muni_id, postcode, district_id, streetname, postnumber, postcomplement, streetname2, postnumber2, postcomplement2, region_id, province_id, descript, link, verified, undelete, "label", label_x, label_y, label_rotation, publish, inventory, num_value, adate, adescript, dma_style, presszone_style, asset_id, pavcat_id, om_state, conserv_state, parent_id, expl_id2, is_operative, brand_id, model_id, serial_number, minsector_id, macrominsector_id, flow_max, flow_min, flow_avg, vel_max, vel_min, vel_avg, tstamp, insert_user, lastupdate, lastupdate_user, the_geom, inp_type)
VALUES('-904', '-904', '-902', 'SHUTOFF_VALVE', 43.2300, NULL, 28.520, '-901', 'SHUTOFF_VALVE', 28.520, 43.2300, NULL, 'VIRTUAL', 'VARC', 'VARC', 'PE-HD', NULL, NULL, 999.00000, 'PIPE', 1, 2, 1, 1, 3, 'DISTRIBUTION', '3', 'pzone1-1d', NULL, 71.75, 1, 'dma1-1d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1.61, NULL, 'soil1', NULL, NULL, NULL, NULL, 'work1', NULL, NULL, NULL, '2024-08-21', NULL, 'owner1', 0, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', '1', NULL, NULL, NULL, NULL, NULL, true, true, NULL, NULL, NULL, '251,181,174', '204,235,197', NULL, 'Asphalt', NULL, NULL, NULL, NULL, true, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-08-21 17:43:47.000', 'postgres', '2024-08-21 17:44:15.000', 'postgres', 'SRID=25831;LINESTRING (419190.45461029344 4576779.998060674, 419189.1684562919 4576779.026603929)'::public.geometry, 'PIPE');
INSERT INTO ve_arc_varc (arc_id, code, node_1, nodetype_1, elevation1, depth1, staticpress1, node_2, nodetype_2, staticpress2, elevation2, depth2, "depth",
arccat_id, arc_type, sys_type, cat_matcat_id, cat_pnom, cat_dnom, cat_dint, epa_type, state, state_type, expl_id, macroexpl_id, sector_id, presszone_id,
preszone_name, presszone_type, presszone_head, dma_id, dma_name, dma_type, macrodma_id, dqa_id, dqa_name, dqa_type, macrodqa_id, annotation, observ, "comment",
gis_length, custom_length, soilcat_id, function_type, category_type, fluid_type, location_type, workcat_id, workcat_id_end, workcat_id_plan, buildercat_id,
builtdate, enddate, ownercat_id, muni_id, postcode, district_id, streetname, postnumber, postcomplement, streetname2, postnumber2, postcomplement2, region_id,
province_id, descript, link, verified, undelete, "label", label_x, label_y, label_rotation, label_quadrant, publish, inventory, num_value, adate, adescript,
dma_style, presszone_style, asset_id, pavcat_id, om_state, conserv_state, parent_id, expl_id2, is_operative, brand_id, model_id, serial_number, minsector_id,
macrominsector_id, flow_max, flow_min, flow_avg, vel_max, vel_min, vel_avg, tstamp, insert_user, lastupdate, lastupdate_user, the_geom, inp_type)
VALUES('-904', '-904', '-902', 'SHUTOFF_VALVE', 51.5000, 0.0000, 0.000, '-901', 'SHUTOFF_VALVE', 3.500, 81.5000, 0.0000, 0.00, 'VIRTUAL', 'VARC', 'VARC', 'PE-HD',
NULL, NULL, 999.00000, 'PIPE', 1, 2, 2, 1, 4, 5, 'pzone2-1s', NULL, 119.69, 5, 'source-2', NULL, NULL, 4, 'dma1-1d', NULL, NULL, NULL, NULL, NULL, 10.05,
NULL, 'soil1', 'St. Function', 'St. Category', 'St. Fluid', 'St. Location', 'work3', NULL, NULL, 'builder1', '1994-07-24', NULL, 'owner1', 2, '08830', 2,
NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, 'https://www.giswater.org', '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, NULL, NULL,
'255,255,204', '254,217,166', NULL, 'Asphalt', NULL, NULL, NULL, NULL, true, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL,
'2020-08-13 09:15:52.000', 'postgres', '2025-01-21 17:20:21.000', 'postgres', 'SRID=25831;LINESTRING (419190.45461029344 4576779.998060674, 419189.1684562919 4576779.026603929)'::public.geometry, 'PIPE');

UPDATE node SET the_geom = ST_GeomFromText('POINT(419189.81153329264 4576779.512332302)', 25831) WHERE node_id = '-903';

Expand Down
8 changes: 4 additions & 4 deletions test/upsert/ws/test_ve_arc.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ INSERT INTO ve_node_air_valve
VALUES('-901', '-901', 32.8100, NULL, 'AIR_VALVE', 'VALVE', 'AIR VALVE DN50', 'FD', '16', '50', NULL, 'UNDEFINED', 1, 2, 2, 1, 5, 'sector2-1d', 2, 'DISTRIBUTION', '3', 'pzone1-1d', NULL, NULL, 3, 'dma2-1d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'soil1', NULL, NULL, NULL, NULL, 'work1', NULL, NULL, '2024-08-22', NULL, NULL, 'owner1', 2, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, '', '1', NULL, NULL, NULL, NULL, NULL, true, true, NULL, NULL, NULL, NULL, NULL, '204,235,197', '204,235,197', NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-08-22 17:00:02.000', 'postgres', '2024-08-22 17:00:02.000', 'postgres', 'SRID=25831;POINT (418473.00472849904 4577983.379842222)'::public.geometry, NULL, false, false, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, false, NULL, NULL);

INSERT INTO ve_arc_pipe
(arc_id, code, node_1, nodetype_1, elevation1, depth1, staticpress1, node_2, nodetype_2, staticpress2, elevation2, depth2, "depth", arccat_id, arc_type, sys_type, cat_matcat_id, cat_pnom, cat_dnom, cat_dint, epa_type, state, state_type, expl_id, macroexpl_id, sector_id, sector_name, macrosector_id, sector_type, presszone_id, presszone_name, presszone_type, presszone_head, dma_id, dma_name, dma_type, macrodma_id, dqa_id, dqa_name, dqa_type, macrodqa_id, annotation, observ, "comment", gis_length, custom_length, soilcat_id, function_type, category_type, fluid_type, location_type, workcat_id, workcat_id_end, workcat_id_plan, buildercat_id, builtdate, enddate, ownercat_id, muni_id, postcode, district_id, streetname, postnumber, postcomplement, streetname2, postnumber2, postcomplement2, region_id, province_id, descript, link, verified, undelete, "label", label_x, label_y, label_rotation, publish, inventory, num_value, adate, adescript, dma_style, presszone_style, asset_id, pavcat_id, om_state, conserv_state, parent_id, expl_id2, is_operative, brand_id, model_id, serial_number, minsector_id, macrominsector_id, flow_max, flow_min, flow_avg, vel_max, vel_min, vel_avg, tstamp, insert_user, lastupdate, lastupdate_user, the_geom, inp_type, pipe_param_1)
VALUES('-901', '-901', '-902', 'AIR_VALVE', 32.8100, NULL, NULL, '-901', 'AIR_VALVE', NULL, 32.8100, NULL, NULL, 'PVC63-PN10', 'PIPE', 'PIPE', 'PVC', '10', '63', 56.70000, 'PIPE', 1, 2, 2, 1, 5, 'sector2-1d', 2, 'DISTRIBUTION', '3', 'pzone1-1d', NULL, NULL, 3, 'dma2-1d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1.22, NULL, 'soil1', NULL, NULL, NULL, NULL, 'work1', NULL, NULL, NULL, '2024-08-22', NULL, 'owner1', 2, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, '', '1', NULL, NULL, NULL, NULL, NULL, true, true, NULL, NULL, NULL, '204,235,197', '204,235,197', NULL, 'Asphalt', NULL, NULL, NULL, NULL, true, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-08-22 17:05:32.000', 'postgres', '2024-08-22 17:05:32.000', 'postgres', 'SRID=25831;LINESTRING (418473.00472849904 4577983.379842222, 418474.19510507485 4577983.667174499)'::public.geometry, 'PIPE', NULL);
(arc_id, code, node_1, nodetype_1, elevation1, depth1, staticpress1, node_2, nodetype_2, staticpress2, elevation2, depth2, "depth", arccat_id, arc_type, sys_type, cat_matcat_id, cat_pnom, cat_dnom, cat_dint, epa_type, state, state_type, expl_id, macroexpl_id, sector_id, presszone_id, presszone_name, presszone_type, presszone_head, dma_id, dma_name, dma_type, macrodma_id, dqa_id, dqa_name, dqa_type, macrodqa_id, annotation, observ, "comment", gis_length, custom_length, soilcat_id, function_type, category_type, fluid_type, location_type, workcat_id, workcat_id_end, workcat_id_plan, buildercat_id, builtdate, enddate, ownercat_id, muni_id, postcode, district_id, streetname, postnumber, postcomplement, streetname2, postnumber2, postcomplement2, region_id, province_id, descript, link, verified, undelete, "label", label_x, label_y, label_rotation, publish, inventory, num_value, adate, adescript, dma_style, presszone_style, asset_id, pavcat_id, om_state, conserv_state, parent_id, expl_id2, is_operative, brand_id, model_id, serial_number, minsector_id, macrominsector_id, flow_max, flow_min, flow_avg, vel_max, vel_min, vel_avg, tstamp, insert_user, lastupdate, lastupdate_user, the_geom, inp_type, pipe_param_1)
VALUES('-901', '-901', '-902', 'AIR_VALVE', 32.8100, NULL, NULL, '-901', 'AIR_VALVE', NULL, 32.8100, NULL, NULL, 'PVC63-PN10', 'PIPE', 'PIPE', 'PVC', '10', '63', 56.70000, 'PIPE', 1, 2, 2, 1, 5, 3, 'pzone1-1d', NULL, NULL, 3, 'dma2-1d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1.22, NULL, 'soil1', NULL, NULL, NULL, NULL, 'work1', NULL, NULL, NULL, '2024-08-22', NULL, 'owner1', 2, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, '', '1', NULL, NULL, NULL, NULL, NULL, true, true, NULL, NULL, NULL, '204,235,197', '204,235,197', NULL, 'Asphalt', NULL, NULL, NULL, NULL, true, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-08-22 17:05:32.000', 'postgres', '2024-08-22 17:05:32.000', 'postgres', 'SRID=25831;LINESTRING (418473.00472849904 4577983.379842222, 418474.19510507485 4577983.667174499)'::public.geometry, 'PIPE', NULL);
SELECT is((SELECT count(*)::integer FROM ve_arc_pipe WHERE code = '-901'), 1, 'INSERT: ve_arc_pipe "-901" was inserted');
SELECT is((SELECT count(*)::integer FROM arc WHERE code = '-901'), 1, 'INSERT: arc:pipe "-901" was inserted');

Expand All @@ -49,8 +49,8 @@ INSERT INTO ve_node_check_valve
VALUES('-904', '-904', 32.8100, NULL, 'CHECK_VALVE', 'VALVE', 'CHK-VALVE63-PN16', 'FD', '16', '63', 65.00000, 'SHORTPIPE', 1, 2, 2, 1, 5, 'sector2-1d', 2, 'DISTRIBUTION', '3', 'pzone1-1d', NULL, NULL, 3, 'dma2-1d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'soil1', NULL, NULL, NULL, NULL, 'work1', NULL, NULL, '2024-08-22', NULL, NULL, 'owner1', 2, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, '', '1', NULL, NULL, NULL, NULL, NULL, true, true, NULL, NULL, NULL, NULL, NULL, '204,235,197', '204,235,197', NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-08-22 17:02:03.000', 'postgres', '2024-08-22 17:02:03.000', 'postgres', 'SRID=25831;POINT (418474.44138988364 4577982.928320073)'::public.geometry, 'SHORTPIPE', false, false, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, false, NULL, NULL);

INSERT INTO ve_arc_varc
(arc_id, code, node_1, nodetype_1, elevation1, depth1, staticpress1, node_2, nodetype_2, staticpress2, elevation2, depth2, "depth", arccat_id, arc_type, sys_type, cat_matcat_id, cat_pnom, cat_dnom, cat_dint, epa_type, state, state_type, expl_id, macroexpl_id, sector_id, sector_name, macrosector_id, sector_type, presszone_id, presszone_name, presszone_type, presszone_head, dma_id, dma_name, dma_type, macrodma_id, dqa_id, dqa_name, dqa_type, macrodqa_id, annotation, observ, "comment", gis_length, custom_length, soilcat_id, function_type, category_type, fluid_type, location_type, workcat_id, workcat_id_end, workcat_id_plan, buildercat_id, builtdate, enddate, ownercat_id, muni_id, postcode, district_id, streetname, postnumber, postcomplement, streetname2, postnumber2, postcomplement2, region_id, province_id, descript, link, verified, undelete, "label", label_x, label_y, label_rotation, publish, inventory, num_value, adate, adescript, dma_style, presszone_style, asset_id, pavcat_id, om_state, conserv_state, parent_id, expl_id2, is_operative, brand_id, model_id, serial_number, minsector_id, macrominsector_id, flow_max, flow_min, flow_avg, vel_max, vel_min, vel_avg, tstamp, insert_user, lastupdate, lastupdate_user, the_geom, inp_type)
VALUES('-902', '-902', '-903', 'CHECK_VALVE', 32.8100, NULL, NULL, '-904', 'CHECK_VALVE', NULL, 32.8100, NULL, NULL, 'VIRTUAL', 'VARC', 'VARC', 'PE-HD', NULL, NULL, 999.00000, 'PIPE', 1, 2, 2, 1, 5, 'sector2-1d', 2, 'DISTRIBUTION', '3', 'pzone1-1d', NULL, NULL, 3, 'dma2-1d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1.34, NULL, 'soil1', NULL, NULL, NULL, NULL, 'work1', NULL, NULL, NULL, '2024-08-22', NULL, 'owner1', 2, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, '', '1', NULL, NULL, NULL, NULL, NULL, true, true, NULL, NULL, NULL, '204,235,197', '204,235,197', NULL, 'Asphalt', NULL, NULL, NULL, NULL, true, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-08-22 17:05:48.000', 'postgres', '2024-08-22 17:05:48.000', 'postgres', 'SRID=25831;LINESTRING (418473.1278709034 4577982.640987795, 418474.44138988364 4577982.928320073)'::public.geometry, 'PIPE');
(arc_id, code, node_1, nodetype_1, elevation1, depth1, staticpress1, node_2, nodetype_2, staticpress2, elevation2, depth2, "depth", arccat_id, arc_type, sys_type, cat_matcat_id, cat_pnom, cat_dnom, cat_dint, epa_type, state, state_type, expl_id, macroexpl_id, sector_id, presszone_id, presszone_name, presszone_type, presszone_head, dma_id, dma_name, dma_type, macrodma_id, dqa_id, dqa_name, dqa_type, macrodqa_id, annotation, observ, "comment", gis_length, custom_length, soilcat_id, function_type, category_type, fluid_type, location_type, workcat_id, workcat_id_end, workcat_id_plan, buildercat_id, builtdate, enddate, ownercat_id, muni_id, postcode, district_id, streetname, postnumber, postcomplement, streetname2, postnumber2, postcomplement2, region_id, province_id, descript, link, verified, undelete, "label", label_x, label_y, label_rotation, publish, inventory, num_value, adate, adescript, dma_style, presszone_style, asset_id, pavcat_id, om_state, conserv_state, parent_id, expl_id2, is_operative, brand_id, model_id, serial_number, minsector_id, macrominsector_id, flow_max, flow_min, flow_avg, vel_max, vel_min, vel_avg, tstamp, insert_user, lastupdate, lastupdate_user, the_geom, inp_type)
VALUES('-902', '-902', '-903', 'CHECK_VALVE', 32.8100, NULL, NULL, '-904', 'CHECK_VALVE', NULL, 32.8100, NULL, NULL, 'VIRTUAL', 'VARC', 'VARC', 'PE-HD', NULL, NULL, 999.00000, 'PIPE', 1, 2, 2, 1, 5, 2, 'pzone1-1d', NULL, NULL, 3, 'dma2-1d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1.34, NULL, 'soil1', NULL, NULL, NULL, NULL, 'work1', NULL, NULL, NULL, '2024-08-22', NULL, 'owner1', 2, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, '', '1', NULL, NULL, NULL, NULL, NULL, true, true, NULL, NULL, NULL, '204,235,197', '204,235,197', NULL, 'Asphalt', NULL, NULL, NULL, NULL, true, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-08-22 17:05:48.000', 'postgres', '2024-08-22 17:05:48.000', 'postgres', 'SRID=25831;LINESTRING (418473.1278709034 4577982.640987795, 418474.44138988364 4577982.928320073)'::public.geometry, 'PIPE');
SELECT is((SELECT count(*)::integer FROM ve_arc_varc WHERE code = '-902'), 1, 'INSERT: ve_arc_varc "-902" was inserted');
SELECT is((SELECT count(*)::integer FROM arc WHERE code = '-902'), 1, 'INSERT: arc:varc "-902" was inserted');

Expand Down
4 changes: 2 additions & 2 deletions updates/40/40000/ws/ddlview.sql
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ AS WITH streetaxis AS (
exploitation.macroexpl_id,
arc.sector_id,
arc.presszone_id,
presszone.name AS preszone_name,
presszone.name AS presszone_name,
et2.idval::character varying(16) AS presszone_type,
presszone.head AS presszone_head,
arc.dma_id,
Expand Down Expand Up @@ -243,7 +243,7 @@ AS WITH streetaxis AS (
exploitation.macroexpl_id,
node.sector_id,
node.presszone_id,
presszone.name AS preszone_name,
presszone.name AS presszone_name,
et2.idval::character varying(16) AS presszone_type,
presszone.head AS presszone_head,
node.dma_id,
Expand Down

0 comments on commit a16a9a8

Please sign in to comment.