Skip to content

Commit

Permalink
restore demo data + add verso offset
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Feb 20, 2024
1 parent 643541d commit c2ca8df
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 4 deletions.
10 changes: 6 additions & 4 deletions datamodel/app/vw_sign_symbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def vw_sign_symbol(srid: int, pg_service: str = None):
, azimut.azimut
, azimut.offset_x
, azimut.offset_y
, azimut.offset_x_verso
, azimut.offset_y_verso
, {frame_columns}
, sign.rank AS sign_rank
, support.id AS support_id
Expand Down Expand Up @@ -189,8 +191,8 @@ def vw_sign_symbol(srid: int, pg_service: str = None):
SELECT
jt.*
, jt.azimut+180 AS _azimut_rectified
, COALESCE(az.offset_x, 0) AS _azimut_offset_x_rectified
, COALESCE(az.offset_y, 0) AS _azimut_offset_y_rectified
, COALESCE(az.offset_x, jt.offset_x_verso) AS _azimut_offset_x_rectified
, COALESCE(az.offset_y, jt.offset_y_verso) AS _azimut_offset_y_rectified
, NOT natural_direction_or_left AS _natural_direction_or_left_rectified
, true::bool AS _verso
, 1000 + ROW_NUMBER () OVER ( PARTITION BY support_id, jt.azimut ORDER BY frame_rank, sign_rank ) AS _rank
Expand All @@ -204,8 +206,8 @@ def vw_sign_symbol(srid: int, pg_service: str = None):
SELECT
jt.*
, jt.azimut+180 AS _azimut_rectified
, COALESCE(az.offset_x, 0) AS _azimut_offset_x_rectified
, COALESCE(az.offset_y, 0) AS _azimut_offset_y_rectified
, COALESCE(az.offset_x, jt.offset_x_verso) AS _azimut_offset_x_rectified
, COALESCE(az.offset_y, jt.offset_y_verso) AS _azimut_offset_y_rectified
, NOT natural_direction_or_left AS _natural_direction_or_left_rectified
, true::bool AS _verso
, 1000 + ROW_NUMBER () OVER ( PARTITION BY support_id, jt.azimut, frame_anchor ORDER BY frame_rank, sign_rank ) AS _rank
Expand Down
2 changes: 2 additions & 0 deletions datamodel/changelogs/0100/0100_01_anchor-point.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ ALTER TABLE signalo_db.support ADD COLUMN group_by_anchor BOOLEAN NOT NULL DEFAU
ALTER TABLE signalo_db.frame ADD COLUMN anchor signalo_db.anchor NOT NULL DEFAULT 'CENTER'::signalo_db.anchor;
ALTER TABLE signalo_db.azimut ADD COLUMN offset_x INTEGER NOT NULL DEFAULT 0;
ALTER TABLE signalo_db.azimut ADD COLUMN offset_y INTEGER NOT NULL DEFAULT 0;
ALTER TABLE signalo_db.azimut ADD COLUMN offset_x_verso INTEGER NOT NULL DEFAULT 0;
ALTER TABLE signalo_db.azimut ADD COLUMN offset_y_verso INTEGER NOT NULL DEFAULT 0;

INSERT INTO signalo_db.vl_support_type (id, value_fr, value_de) VALUES (17, 'borne d''îlot', 'Inselpfosten');

Expand Down
19 changes: 19 additions & 0 deletions datamodel/demo_data/azimut_content.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('00000000-0000-0000-aaaa-000000000201', '00000000-0000-0000-0000-000000000002', 227, NULL, NULL, NULL, '2023-02-22 08:31:37.740141', NULL, '2023-02-22 08:31:37.740141', NULL, false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('00000000-0000-0000-aaaa-000000000202', '00000000-0000-0000-0000-000000000002', 345, NULL, NULL, NULL, '2023-02-22 08:31:37.741532', NULL, '2023-02-22 08:31:37.741532', NULL, false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('00000000-0000-bbbb-0000-0000000000a1', '00000000-0000-0000-0000-0000000000a1', 110, NULL, NULL, NULL, '2023-02-22 08:31:37.799163', NULL, '2023-11-14 08:33:39.706', 'Rouzaud Denis', false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('0d8fb844-ec63-43fb-a0e5-cd35a0c62565', '82f3002b-ebdf-4621-9a19-951639fc18bd', 200, NULL, NULL, NULL, '2023-09-06 09:22:19.287', 'Denis Rouzaud', '2023-11-14 05:56:42.155', 'Rouzaud Denis', false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('0e2cd688-3984-46b5-9f70-e052305e2cac', 'f5054922-95a7-4f12-8374-0a57e105327c', 290, NULL, NULL, NULL, '2023-02-22 10:06:58.155', 'Denis Rouzaud', '2023-09-07 09:35:52.676', 'Denis Rouzaud', false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('1193f576-089a-11eb-8b8b-0242ac110002', '814da66a-0894-11eb-99f5-0242ac110002', 0, NULL, NULL, NULL, '2023-02-22 08:31:37.751308', NULL, '2023-02-22 08:31:37.751308', NULL, false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('38d32a6b-2145-4ac7-b890-7459d67cd167', '94ff73df-fc80-4319-b2b9-7aa06ca4f806', 90, NULL, NULL, NULL, '2024-01-30 10:16:21.373', 'Rouzaud Denis', '2024-01-30 10:54:23.077', 'Rouzaud Denis', false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('55ffc93c-fd0f-4c67-8fe7-da217124a793', 'bbdb5d1e-4973-4900-8838-889357a60e65', 180, NULL, NULL, NULL, '2023-09-06 09:22:19.287', 'Denis Rouzaud', '2023-11-24 10:43:42.024', 'Rouzaud Denis', false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('779ffe5a-2538-41ed-8abe-79e6825a1b56', '3dbc19a5-b7bf-4acd-94d0-ba4b0b17ddc0', 180, NULL, NULL, NULL, '2024-01-30 10:16:21.373', 'Rouzaud Denis', '2024-01-30 10:54:13.024', 'Rouzaud Denis', false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('7fd7b4cc-24b7-4b3c-acbe-a9633337fb82', '20f47695-aefa-43b1-854f-a770fa0f79e0', 30, NULL, NULL, NULL, '2024-02-13 09:39:33.382', 'Rouzaud Denis', '2024-02-13 09:49:16.387', 'Rouzaud Denis', false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('83fb8a3a-0899-11eb-8b8b-0242ac110002', '814da66a-0894-11eb-99f5-0242ac110002', 200, NULL, NULL, NULL, '2023-02-22 08:31:37.777955', NULL, '2023-02-22 08:31:37.777955', NULL, false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('9dcc763a-1af7-4fb8-9e32-085f74a3ef77', 'a3921fbd-8a89-4d82-b3b8-7a24a16f4df4', 280, NULL, NULL, NULL, '2023-09-07 09:36:47.07', 'Denis Rouzaud', '2023-09-07 09:39:36.121', 'Denis Rouzaud', false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('b3fd2055-2ab4-4da8-9dbc-a3aeba311fe7', 'f17d39cc-bac3-4134-9b9c-ea14e228d4b4', 290, NULL, NULL, NULL, '2023-08-31 16:15:55.608', 'Denis Rouzaud', '2023-11-14 08:33:25.694', 'Rouzaud Denis', false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('bbb63098-ee04-4a0d-963d-4df18af5fa7a', '70104932-54ff-4668-90b0-6946352d5544', 20, NULL, NULL, NULL, '2023-09-06 09:22:19.287', 'Denis Rouzaud', '2023-09-07 09:17:46.397', 'Denis Rouzaud', false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('d8a1e45b-7f4c-4c71-a12a-3a2df6d42045', 'bbdb5d1e-4973-4900-8838-889357a60e65', 90, NULL, NULL, NULL, '2023-11-08 13:29:08.086', 'Rouzaud Denis', '2023-11-24 10:42:49.654', 'Rouzaud Denis', false, 1, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('dd9e3482-089b-11eb-8b8b-0242ac110002', '2e988298-0897-11eb-8771-0242ac110002', 200, NULL, NULL, NULL, '2023-02-22 08:31:37.79742', NULL, '2023-02-22 08:31:37.79742', NULL, false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('e136f7a0-5913-48bb-8893-1b4b0705f238', '4478bbcc-0236-46ee-b284-4c586e6af8a9', 190, NULL, NULL, NULL, '2023-06-21 08:36:19.92', 'Denis Rouzaud', '2023-09-07 09:46:09.378', 'Denis Rouzaud', false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('e3999392-ea54-4848-87cb-9440a552d35b', '82f3002b-ebdf-4621-9a19-951639fc18bd', 290, NULL, NULL, NULL, '2023-09-06 09:21:06.167', 'Denis Rouzaud', '2023-11-14 05:57:01.141', 'Rouzaud Denis', false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('f05176ff-87e6-40e5-aae6-e58ff8e76dc6', 'c13a9809-b862-4237-a67f-bb34897d90b5', 30, NULL, NULL, NULL, '2024-02-13 09:39:33.382', 'Rouzaud Denis', '2024-02-13 09:39:33.383', 'Rouzaud Denis', false, 0, 0);
Loading

0 comments on commit c2ca8df

Please sign in to comment.