@golemio/bicycle-counters 1.2.6 → 1.2.7-dev.976015587
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/db/example/01_sql_dump.sql +82 -0
- package/db/migrations/postgresql/20230816112250-bigint-timestamptz.js +53 -0
- package/db/migrations/postgresql/sqls/20230816112250-bigint-timestamptz-down.sql +515 -0
- package/db/migrations/postgresql/sqls/20230816112250-bigint-timestamptz-up.sql +122 -0
- package/dist/integration-engine/transformations/CameaMeasurementsTransformation.js +4 -4
- package/dist/integration-engine/transformations/CameaMeasurementsTransformation.js.map +1 -1
- package/dist/integration-engine/transformations/EcoCounterMeasurementsTransformation.js +2 -2
- package/dist/integration-engine/transformations/EcoCounterMeasurementsTransformation.js.map +1 -1
- package/dist/output-gateway/BicycleCountersRouter.js +0 -2
- package/dist/output-gateway/BicycleCountersRouter.js.map +1 -1
- package/dist/schema-definitions/index.js +8 -8
- package/dist/schema-definitions/index.js.map +1 -1
- package/package.json +1 -1
- package/db/example/sql_dump.sql +0 -82
- /package/db/example/{__truncate_tables.sql → 00__truncate_tables.sql} +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
-- EXAMPLE DATA - for testing purposes
|
|
2
|
+
|
|
3
|
+
INSERT INTO "bicyclecounters_locations" ("id", "vendor_id", "lat", "lng", "name", "route", "create_batch_id", "created_at", "created_by", "update_batch_id", "updated_at", "updated_by") VALUES
|
|
4
|
+
('camea-BC_VK-HRUP', 'BC_VK-HRUP', 50.089491724101, 14.460735619068, 'Drážní stezka - Vítkov', 'A 25', NULL, '2020-01-17 12:25:08.322+00', NULL, NULL, '2020-03-22 14:50:01.167+00', NULL),
|
|
5
|
+
('camea-BC_VS-CE', 'BC_VS-CE', 50.0704264, 14.3857008, 'Košíře', 'A 14', NULL, '2020-01-17 12:25:08.322+00', NULL, NULL, '2020-03-22 14:50:01.167+00', NULL),
|
|
6
|
+
('camea-BC_ZA-KLBO', 'BC_ZA-KLBO', 50.1433144, 14.3993322, 'V Zámcích', 'A2', NULL, '2020-01-17 12:25:08.322+00', NULL, NULL, '2020-03-22 14:50:01.167+00', NULL);
|
|
7
|
+
|
|
8
|
+
INSERT INTO "bicyclecounters_directions" ("id", "vendor_id", "locations_id", "name", "create_batch_id", "created_at", "created_by", "update_batch_id", "updated_at", "updated_by") VALUES
|
|
9
|
+
('camea-BC_VK-HR', 'BC_VK-HR', 'camea-BC_VK-HRUP', 'Hrdlořezy', NULL, '2020-01-17 12:25:09.767+00', NULL, NULL, '2020-03-22 14:50:01.398+00', NULL),
|
|
10
|
+
('camea-BC_VK-UP', 'BC_VK-UP', 'camea-BC_VK-HRUP', 'U památníku', NULL, '2020-01-17 12:25:09.767+00', NULL, NULL, '2020-03-22 14:50:01.398+00', NULL),
|
|
11
|
+
('camea-BC_VS-CE', 'BC_VS-CE', 'camea-BC_VS-CE', 'centrum', NULL, '2020-01-17 12:25:09.767+00', NULL, NULL, '2020-03-22 14:50:01.399+00', NULL),
|
|
12
|
+
('camea-BC_ZA-KL', 'BC_ZA-KL', 'camea-BC_ZA-KLBO', 'Klecany', NULL, '2020-01-17 12:25:09.767+00', NULL, NULL, '2020-03-22 14:50:01.399+00', NULL),
|
|
13
|
+
('camea-BC_ZA-BO', 'BC_ZA-BO', 'camea-BC_ZA-KLBO', 'Bohnice', NULL, '2020-01-17 12:25:09.767+00', NULL, NULL, '2020-03-22 14:50:01.399+00', NULL);
|
|
14
|
+
|
|
15
|
+
INSERT INTO "bicyclecounters_detections" ("locations_id", "directions_id", "measured_from", "measured_to", "value", "create_batch_id", "created_at", "created_by", "update_batch_id", "updated_at", "updated_by", "value_pedestrians") VALUES
|
|
16
|
+
('camea-BC_VK-HRUP','camea-BC_VK-HR','2020-03-14 11:55:00+01','2020-03-14 12:00:00+01',4,-1,'2020-03-14 12:05:06.852411+01','integration-engine',-1,'2020-03-15 05:00:20.646195+01','integration-engine',2),
|
|
17
|
+
('camea-BC_ZA-KLBO','camea-BC_ZA-KL','2020-03-14 11:50:00+01','2020-03-14 11:55:00+01',3,-1,'2020-03-14 12:00:27.856626+01','integration-engine',-1,'2020-03-15 05:00:21.650912+01','integration-engine',3),
|
|
18
|
+
('camea-BC_VK-HRUP','camea-BC_VK-UP','2020-03-14 11:50:00+01','2020-03-14 11:55:00+01',4,-1,'2020-03-14 12:00:26.857761+01','integration-engine',-1,'2020-03-15 05:00:20.646195+01','integration-engine',1),
|
|
19
|
+
('camea-BC_ZA-KLBO','camea-BC_ZA-BO','2020-03-14 11:45:00+01','2020-03-14 11:50:00+01',5,-1,'2020-03-14 11:55:07.65846+01','integration-engine',-1,'2020-03-15 05:00:21.650912+01','integration-engine',NULL),
|
|
20
|
+
('camea-BC_ZA-KLBO','camea-BC_ZA-KL','2020-03-14 11:45:00+01','2020-03-14 11:50:00+01',10,-1,'2020-03-14 11:55:07.65846+01','integration-engine',-1,'2020-03-15 05:00:21.650912+01','integration-engine',2),
|
|
21
|
+
('camea-BC_ZA-KLBO','camea-BC_ZA-KL','2020-03-14 11:40:00+01','2020-03-14 11:45:00+01',3,-1,'2020-03-14 11:50:07.448117+01','integration-engine',-1,'2020-03-15 05:00:21.650912+01','integration-engine',1),
|
|
22
|
+
('camea-BC_ZA-KLBO','camea-BC_ZA-KL','2020-03-14 11:35:00+01','2020-03-14 11:40:00+01',11,-1,'2020-03-14 11:45:07.338274+01','integration-engine',-1,'2020-03-15 05:00:21.650912+01','integration-engine',2),
|
|
23
|
+
('camea-BC_ZA-KLBO','camea-BC_ZA-KL','2020-03-14 11:30:00+01','2020-03-14 11:35:00+01',6,-1,'2020-03-14 11:40:06.557032+01','integration-engine',-1,'2020-03-15 05:00:21.650912+01','integration-engine',7),
|
|
24
|
+
('camea-BC_VK-HRUP','camea-BC_VK-UP','2020-03-14 11:30:00+01','2020-03-14 11:35:00+01',5,-1,'2020-03-14 11:40:05.777015+01','integration-engine',-1,'2020-03-15 05:00:20.646195+01','integration-engine',8),
|
|
25
|
+
('camea-BC_ZA-KLBO','camea-BC_ZA-KL','2020-03-14 11:20:00+01','2020-03-14 11:25:00+01',4,-1,'2020-03-14 11:30:08.810805+01','integration-engine',-1,'2020-03-15 05:00:21.650912+01','integration-engine',1),
|
|
26
|
+
('camea-BC_VK-HRUP','camea-BC_VK-UP','2020-03-14 11:20:00+01','2020-03-14 11:25:00+01',6,-1,'2020-03-14 11:30:07.938707+01','integration-engine',-1,'2020-03-15 05:00:20.646195+01','integration-engine',0),
|
|
27
|
+
('camea-BC_ZA-KLBO','camea-BC_ZA-KL','2020-03-14 11:15:00+01','2020-03-14 11:20:00+01',4,-1,'2020-03-14 11:25:06.850141+01','integration-engine',-1,'2020-03-15 05:00:21.650912+01','integration-engine',2),
|
|
28
|
+
('camea-BC_ZA-KLBO','camea-BC_ZA-KL','2020-03-14 11:10:00+01','2020-03-14 11:15:00+01',4,-1,'2020-03-14 11:20:06.842241+01','integration-engine',-1,'2020-03-15 05:00:21.650912+01','integration-engine',1),
|
|
29
|
+
('camea-BC_ZA-KLBO','camea-BC_ZA-BO','2020-03-14 11:05:00+01','2020-03-14 11:10:00+01',4,-1,'2020-03-14 11:15:07.775845+01','integration-engine',-1,'2020-03-15 05:00:21.650912+01','integration-engine',1),
|
|
30
|
+
('camea-BC_ZA-KLBO','camea-BC_ZA-KL','2020-03-14 11:05:00+01','2020-03-14 11:10:00+01',6,-1,'2020-03-14 11:15:07.775845+01','integration-engine',-1,'2020-03-15 05:00:21.650912+01','integration-engine',4),
|
|
31
|
+
('camea-BC_ZA-KLBO','camea-BC_ZA-KL','2020-03-14 11:00:00+01','2020-03-14 11:05:00+01',4,-1,'2020-03-14 11:10:07.418647+01','integration-engine',-1,'2020-03-15 05:00:21.650912+01','integration-engine',1),
|
|
32
|
+
('camea-BC_VK-HRUP','camea-BC_VK-UP','2020-03-14 11:00:00+01','2020-03-14 11:05:00+01',3,-1,'2020-03-14 11:10:06.659036+01','integration-engine',-1,'2020-03-15 05:00:20.646195+01','integration-engine',7),
|
|
33
|
+
('camea-BC_ZA-KLBO','camea-BC_ZA-KL','2020-03-14 10:55:00+01','2020-03-14 11:00:00+01',5,-1,'2020-03-14 11:05:07.293445+01','integration-engine',-1,'2020-03-15 05:00:21.650912+01','integration-engine',2),
|
|
34
|
+
('camea-BC_ZA-KLBO','camea-BC_ZA-KL','2020-03-14 10:50:00+01','2020-03-14 10:55:00+01',4,-1,'2020-03-14 11:00:09.034003+01','integration-engine',-1,'2020-03-15 05:00:21.650912+01','integration-engine',2),
|
|
35
|
+
('camea-BC_ZA-KLBO','camea-BC_ZA-KL','2020-03-14 10:45:00+01','2020-03-14 10:50:00+01',5,-1,'2020-03-14 10:55:06.595799+01','integration-engine',-1,'2020-03-15 05:00:21.650912+01','integration-engine',1),
|
|
36
|
+
('camea-BC_ZA-KLBO','camea-BC_ZA-KL','2020-03-14 10:40:00+01','2020-03-14 10:45:00+01',6,-1,'2020-03-14 10:50:08.878222+01','integration-engine',-1,'2020-03-15 05:00:21.650912+01','integration-engine',0),
|
|
37
|
+
('camea-BC_VK-HRUP','camea-BC_VK-HR','2020-03-14 10:40:00+01','2020-03-14 10:45:00+01',3,-1,'2020-03-14 10:50:08.235704+01','integration-engine',-1,'2020-03-15 05:00:20.646195+01','integration-engine',2),
|
|
38
|
+
('camea-BC_VK-HRUP','camea-BC_VK-UP','2020-03-14 10:40:00+01','2020-03-14 10:45:00+01',3,-1,'2020-03-14 10:50:08.235704+01','integration-engine',-1,'2020-03-15 05:00:20.646195+01','integration-engine',0),
|
|
39
|
+
('camea-BC_ZA-KLBO','camea-BC_ZA-KL','2020-03-14 10:35:00+01','2020-03-14 10:40:00+01',3,-1,'2020-03-14 10:45:07.985855+01','integration-engine',-1,'2020-03-15 05:00:21.650912+01','integration-engine',1),
|
|
40
|
+
('camea-BC_ZA-KLBO','camea-BC_ZA-BO','2020-03-14 10:35:00+01','2020-03-14 10:40:00+01',4,-1,'2020-03-14 10:45:07.985855+01','integration-engine',-1,'2020-03-15 05:00:21.650912+01','integration-engine',NULL),
|
|
41
|
+
('camea-BC_VK-HRUP','camea-BC_VK-UP','2020-03-14 10:35:00+01','2020-03-14 10:40:00+01',3,-1,'2020-03-14 10:45:06.935666+01','integration-engine',-1,'2020-03-15 05:00:20.646195+01','integration-engine',1),
|
|
42
|
+
('camea-BC_ZA-KLBO','camea-BC_ZA-KL','2020-03-14 10:30:00+01','2020-03-14 10:35:00+01',4,-1,'2020-03-14 10:40:07.268232+01','integration-engine',-1,'2020-03-15 05:00:21.650912+01','integration-engine',2),
|
|
43
|
+
('camea-BC_ZA-KLBO','camea-BC_ZA-KL','2020-03-14 10:25:00+01','2020-03-14 10:30:00+01',3,-1,'2020-03-14 10:35:07.008885+01','integration-engine',-1,'2020-03-15 05:00:21.650912+01','integration-engine',0),
|
|
44
|
+
('camea-BC_VK-HRUP','camea-BC_VK-HR','2020-03-14 10:25:00+01','2020-03-14 10:30:00+01',3,-1,'2020-03-14 10:35:06.531007+01','integration-engine',-1,'2020-03-15 05:00:20.646195+01','integration-engine',3);
|
|
45
|
+
|
|
46
|
+
INSERT INTO "bicyclecounters_temperatures" ("locations_id", "measured_from", "measured_to", "value", "create_batch_id", "created_at", "created_by", "update_batch_id", "updated_at", "updated_by") VALUES
|
|
47
|
+
('camea-BC_VK-HRUP','2020-03-14 10:20:00+01','2020-03-14 10:25:00+01',10,-1,'2020-03-14 10:30:09.629185+01','integration-engine',-1,'2020-03-15 05:00:20.835272+01','integration-engine'),
|
|
48
|
+
('camea-BC_VK-HRUP','2020-03-14 10:25:00+01','2020-03-14 10:30:00+01',10,-1,'2020-03-14 10:35:06.555745+01','integration-engine',-1,'2020-03-15 05:00:20.835272+01','integration-engine'),
|
|
49
|
+
('camea-BC_VK-HRUP','2020-03-14 10:30:00+01','2020-03-14 10:35:00+01',10,-1,'2020-03-14 10:40:06.616807+01','integration-engine',-1,'2020-03-15 05:00:20.835272+01','integration-engine'),
|
|
50
|
+
('camea-BC_VK-HRUP','2020-03-14 10:35:00+01','2020-03-14 10:40:00+01',10,-1,'2020-03-14 10:45:06.961899+01','integration-engine',-1,'2020-03-15 05:00:20.835272+01','integration-engine'),
|
|
51
|
+
('camea-BC_VK-HRUP','2020-03-14 10:40:00+01','2020-03-14 10:45:00+01',10,-1,'2020-03-14 10:50:08.255987+01','integration-engine',-1,'2020-03-15 05:00:20.835272+01','integration-engine'),
|
|
52
|
+
('camea-BC_VK-HRUP','2020-03-14 10:45:00+01','2020-03-14 10:50:00+01',10,-1,'2020-03-14 10:55:06.0094+01','integration-engine',-1,'2020-03-15 05:00:20.835272+01','integration-engine'),
|
|
53
|
+
('camea-BC_VK-HRUP','2020-03-14 10:50:00+01','2020-03-14 10:55:00+01',10,-1,'2020-03-14 11:00:08.42887+01','integration-engine',-1,'2020-03-15 05:00:20.835272+01','integration-engine'),
|
|
54
|
+
('camea-BC_VK-HRUP','2020-03-14 10:55:00+01','2020-03-14 11:00:00+01',10,-1,'2020-03-14 11:05:06.687607+01','integration-engine',-1,'2020-03-15 05:00:20.835272+01','integration-engine'),
|
|
55
|
+
('camea-BC_VK-HRUP','2020-03-14 11:00:00+01','2020-03-14 11:05:00+01',10,-1,'2020-03-14 11:10:06.682393+01','integration-engine',-1,'2020-03-15 05:00:20.835272+01','integration-engine'),
|
|
56
|
+
('camea-BC_VK-HRUP','2020-03-14 11:05:00+01','2020-03-14 11:10:00+01',11,-1,'2020-03-14 11:15:07.093541+01','integration-engine',-1,'2020-03-15 05:00:20.835272+01','integration-engine'),
|
|
57
|
+
('camea-BC_VK-HRUP','2020-03-14 11:10:00+01','2020-03-14 11:15:00+01',11,-1,'2020-03-14 11:20:06.062893+01','integration-engine',-1,'2020-03-15 05:00:20.835272+01','integration-engine'),
|
|
58
|
+
('camea-BC_VK-HRUP','2020-03-14 11:15:00+01','2020-03-14 11:20:00+01',11,-1,'2020-03-14 11:25:06.149189+01','integration-engine',-1,'2020-03-15 05:00:20.835272+01','integration-engine'),
|
|
59
|
+
('camea-BC_VK-HRUP','2020-03-14 11:20:00+01','2020-03-14 11:25:00+01',10,-1,'2020-03-14 11:30:07.980846+01','integration-engine',-1,'2020-03-15 05:00:20.835272+01','integration-engine'),
|
|
60
|
+
('camea-BC_VK-HRUP','2020-03-14 11:25:00+01','2020-03-14 11:30:00+01',10,-1,'2020-03-14 11:35:07.920386+01','integration-engine',-1,'2020-03-15 05:00:20.835272+01','integration-engine'),
|
|
61
|
+
('camea-BC_VK-HRUP','2020-03-14 11:30:00+01','2020-03-14 11:35:00+01',10,-1,'2020-03-14 11:40:05.805547+01','integration-engine',-1,'2020-03-15 05:00:20.835272+01','integration-engine'),
|
|
62
|
+
('camea-BC_VK-HRUP','2020-03-14 11:35:00+01','2020-03-14 11:40:00+01',10,-1,'2020-03-14 11:45:06.742474+01','integration-engine',-1,'2020-03-15 05:00:20.835272+01','integration-engine'),
|
|
63
|
+
('camea-BC_VK-HRUP','2020-03-14 11:40:00+01','2020-03-14 11:45:00+01',10,-1,'2020-03-14 11:50:06.341474+01','integration-engine',-1,'2020-03-15 05:00:20.835272+01','integration-engine'),
|
|
64
|
+
('camea-BC_VK-HRUP','2020-03-14 11:45:00+01','2020-03-14 11:50:00+01',11,-1,'2020-03-14 11:55:06.858758+01','integration-engine',-1,'2020-03-15 05:00:20.835272+01','integration-engine'),
|
|
65
|
+
('camea-BC_VK-HRUP','2020-03-14 11:50:00+01','2020-03-14 11:55:00+01',10,-1,'2020-03-14 12:00:26.877299+01','integration-engine',-1,'2020-03-15 05:00:20.835272+01','integration-engine'),
|
|
66
|
+
('camea-BC_VK-HRUP','2020-03-14 11:55:00+01','2020-03-14 12:00:00+01',11,-1,'2020-03-14 12:05:06.872869+01','integration-engine',-1,'2020-03-15 05:00:20.835272+01','integration-engine'),
|
|
67
|
+
('camea-BC_ZA-KLBO','2020-03-14 10:30:00+01','2020-03-14 10:35:00+01',10,-1,'2020-03-14 10:40:07.290585+01','integration-engine',-1,'2020-03-15 05:00:21.740315+01','integration-engine'),
|
|
68
|
+
('camea-BC_ZA-KLBO','2020-03-14 10:35:00+01','2020-03-14 10:40:00+01',10,-1,'2020-03-14 10:45:08.015288+01','integration-engine',-1,'2020-03-15 05:00:21.740315+01','integration-engine'),
|
|
69
|
+
('camea-BC_ZA-KLBO','2020-03-14 10:50:00+01','2020-03-14 10:55:00+01',10,-1,'2020-03-14 11:00:09.070265+01','integration-engine',-1,'2020-03-15 05:00:21.740315+01','integration-engine'),
|
|
70
|
+
('camea-BC_ZA-KLBO','2020-03-14 10:55:00+01','2020-03-14 11:00:00+01',10,-1,'2020-03-14 11:05:07.319131+01','integration-engine',-1,'2020-03-15 05:00:21.740315+01','integration-engine'),
|
|
71
|
+
('camea-BC_ZA-KLBO','2020-03-14 11:00:00+01','2020-03-14 11:05:00+01',10,-1,'2020-03-14 11:10:07.440586+01','integration-engine',-1,'2020-03-15 05:00:21.740315+01','integration-engine'),
|
|
72
|
+
('camea-BC_ZA-KLBO','2020-03-14 11:05:00+01','2020-03-14 11:10:00+01',10,-1,'2020-03-14 11:15:07.797602+01','integration-engine',-1,'2020-03-15 05:00:21.740315+01','integration-engine'),
|
|
73
|
+
('camea-BC_ZA-KLBO','2020-03-14 11:10:00+01','2020-03-14 11:15:00+01',10,-1,'2020-03-14 11:20:06.882923+01','integration-engine',-1,'2020-03-15 05:00:21.740315+01','integration-engine'),
|
|
74
|
+
('camea-BC_ZA-KLBO','2020-03-14 11:15:00+01','2020-03-14 11:20:00+01',10,-1,'2020-03-14 11:25:07.099943+01','integration-engine',-1,'2020-03-15 05:00:21.740315+01','integration-engine'),
|
|
75
|
+
('camea-BC_ZA-KLBO','2020-03-14 11:20:00+01','2020-03-14 11:25:00+01',11,-1,'2020-03-14 11:30:08.835391+01','integration-engine',-1,'2020-03-15 05:00:21.740315+01','integration-engine'),
|
|
76
|
+
('camea-BC_ZA-KLBO','2020-03-14 11:25:00+01','2020-03-14 11:30:00+01',11,-1,'2020-03-14 11:35:08.573236+01','integration-engine',-1,'2020-03-15 05:00:21.740315+01','integration-engine'),
|
|
77
|
+
('camea-BC_ZA-KLBO','2020-03-14 11:30:00+01','2020-03-14 11:35:00+01',11,-1,'2020-03-14 11:40:06.581227+01','integration-engine',-1,'2020-03-15 05:00:21.740315+01','integration-engine'),
|
|
78
|
+
('camea-BC_ZA-KLBO','2020-03-14 11:35:00+01','2020-03-14 11:40:00+01',11,-1,'2020-03-14 11:45:07.361461+01','integration-engine',-1,'2020-03-15 05:00:21.740315+01','integration-engine'),
|
|
79
|
+
('camea-BC_ZA-KLBO','2020-03-14 11:40:00+01','2020-03-14 11:45:00+01',11,-1,'2020-03-14 11:50:07.481585+01','integration-engine',-1,'2020-03-15 05:00:21.740315+01','integration-engine'),
|
|
80
|
+
('camea-BC_ZA-KLBO','2020-03-14 11:45:00+01','2020-03-14 11:50:00+01',10,-1,'2020-03-14 11:55:07.679932+01','integration-engine',-1,'2020-03-15 05:00:21.740315+01','integration-engine'),
|
|
81
|
+
('camea-BC_ZA-KLBO','2020-03-14 11:50:00+01','2020-03-14 11:55:00+01',11,-1,'2020-03-14 12:00:27.87918+01','integration-engine',-1,'2020-03-15 05:00:21.740315+01','integration-engine'),
|
|
82
|
+
('camea-BC_ZA-KLBO','2020-03-14 11:55:00+01','2020-03-14 12:00:00+01',11,-1,'2020-03-14 12:05:07.83522+01','integration-engine',-1,'2020-03-15 05:00:21.740315+01','integration-engine');
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var dbm;
|
|
4
|
+
var type;
|
|
5
|
+
var seed;
|
|
6
|
+
var fs = require('fs');
|
|
7
|
+
var path = require('path');
|
|
8
|
+
var Promise;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* We receive the dbmigrate dependency from dbmigrate initially.
|
|
12
|
+
* This enables us to not have to rely on NODE_PATH.
|
|
13
|
+
*/
|
|
14
|
+
exports.setup = function(options, seedLink) {
|
|
15
|
+
dbm = options.dbmigrate;
|
|
16
|
+
type = dbm.dataType;
|
|
17
|
+
seed = seedLink;
|
|
18
|
+
Promise = options.Promise;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.up = function(db) {
|
|
22
|
+
var filePath = path.join(__dirname, 'sqls', '20230816112250-bigint-timestamptz-up.sql');
|
|
23
|
+
return new Promise( function( resolve, reject ) {
|
|
24
|
+
fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
|
|
25
|
+
if (err) return reject(err);
|
|
26
|
+
console.log('received data: ' + data);
|
|
27
|
+
|
|
28
|
+
resolve(data);
|
|
29
|
+
});
|
|
30
|
+
})
|
|
31
|
+
.then(function(data) {
|
|
32
|
+
return db.runSql(data);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.down = function(db) {
|
|
37
|
+
var filePath = path.join(__dirname, 'sqls', '20230816112250-bigint-timestamptz-down.sql');
|
|
38
|
+
return new Promise( function( resolve, reject ) {
|
|
39
|
+
fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
|
|
40
|
+
if (err) return reject(err);
|
|
41
|
+
console.log('received data: ' + data);
|
|
42
|
+
|
|
43
|
+
resolve(data);
|
|
44
|
+
});
|
|
45
|
+
})
|
|
46
|
+
.then(function(data) {
|
|
47
|
+
return db.runSql(data);
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
exports._meta = {
|
|
52
|
+
"version": 1
|
|
53
|
+
};
|
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
/* Replace with your SQL commands */
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
-- drop existing analytic views connected to tables we change
|
|
5
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_24h_missing;
|
|
6
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_24h_missing;
|
|
7
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_all_data_history;
|
|
8
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_all_data_table_today;
|
|
9
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_all_data_today;
|
|
10
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_data_disbalance;
|
|
11
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_data_quality;
|
|
12
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_last_update;
|
|
13
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_name_table;
|
|
14
|
+
DROP VIEW IF EXISTS analytic.v_camea_data_disbalance;
|
|
15
|
+
DROP VIEW IF EXISTS analytic.v_camea_data_quality;
|
|
16
|
+
DROP VIEW IF EXISTS analytic.v_camea_last_update;
|
|
17
|
+
|
|
18
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_history;
|
|
19
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_history_table;
|
|
20
|
+
DROP VIEW IF EXISTS analytic.v_bicyclecounters_24h_missing;
|
|
21
|
+
|
|
22
|
+
-- drop only view in bicycle_counters schema
|
|
23
|
+
DROP VIEW IF EXISTS v_camea_bikecounters_data_month;
|
|
24
|
+
|
|
25
|
+
-- drop table detections
|
|
26
|
+
DROP TABLE IF EXISTS bicyclecounters_detections;
|
|
27
|
+
DROP TABLE IF EXISTS bicyclecounters_temperatures;
|
|
28
|
+
|
|
29
|
+
--rename original table
|
|
30
|
+
ALTER TABLE bicyclecounters_detections_old RENAME TO bicyclecounters_detections;
|
|
31
|
+
ALTER TABLE bicyclecounters_temperatures_old RENAME TO bicyclecounters_temperatures;
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
--rename partitions
|
|
35
|
+
ALTER TABLE bicyclecounters_detections_min_old RENAME TO bicyclecounters_detections_min;
|
|
36
|
+
ALTER TABLE bicyclecounters_detections_y2019_old RENAME TO bicyclecounters_detections_y2019;
|
|
37
|
+
ALTER TABLE bicyclecounters_detections_y2020_old RENAME TO bicyclecounters_detections_y2020;
|
|
38
|
+
ALTER TABLE bicyclecounters_detections_y2021_old RENAME TO bicyclecounters_detections_y2021;
|
|
39
|
+
ALTER TABLE bicyclecounters_detections_y2022_old RENAME TO bicyclecounters_detections_y2022;
|
|
40
|
+
ALTER TABLE bicyclecounters_detections_y2023_old RENAME TO bicyclecounters_detections_y2023;
|
|
41
|
+
ALTER TABLE bicyclecounters_detections_y2024_old RENAME TO bicyclecounters_detections_y2024;
|
|
42
|
+
ALTER TABLE bicyclecounters_detections_y2025_old RENAME TO bicyclecounters_detections_y2025;
|
|
43
|
+
ALTER TABLE bicyclecounters_detections_y2026_old RENAME TO bicyclecounters_detections_y2026;
|
|
44
|
+
ALTER TABLE bicyclecounters_detections_y2027up_old RENAME TO bicyclecounters_detections_y2027up;
|
|
45
|
+
|
|
46
|
+
--rename back partitions
|
|
47
|
+
ALTER TABLE bicyclecounters_temperatures_min_old RENAME TO bicyclecounters_temperatures_min;
|
|
48
|
+
ALTER TABLE bicyclecounters_temperatures_y2019_old RENAME TO bicyclecounters_temperatures_y2019;
|
|
49
|
+
ALTER TABLE bicyclecounters_temperatures_y2020_old RENAME TO bicyclecounters_temperatures_y2020;
|
|
50
|
+
ALTER TABLE bicyclecounters_temperatures_y2021_old RENAME TO bicyclecounters_temperatures_y2021;
|
|
51
|
+
ALTER TABLE bicyclecounters_temperatures_y2022_old RENAME TO bicyclecounters_temperatures_y2022;
|
|
52
|
+
ALTER TABLE bicyclecounters_temperatures_y2023_old RENAME TO bicyclecounters_temperatures_y2023;
|
|
53
|
+
ALTER TABLE bicyclecounters_temperatures_y2024_old RENAME TO bicyclecounters_temperatures_y2024;
|
|
54
|
+
ALTER TABLE bicyclecounters_temperatures_y2025_old RENAME TO bicyclecounters_temperatures_y2025;
|
|
55
|
+
ALTER TABLE bicyclecounters_temperatures_y2026_old RENAME TO bicyclecounters_temperatures_y2026;
|
|
56
|
+
ALTER TABLE bicyclecounters_temperatures_y2027up_old RENAME TO bicyclecounters_temperatures_y2027up;
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
-- analytic.v_camea_bikecounters_24h_missing source
|
|
60
|
+
|
|
61
|
+
CREATE OR REPLACE VIEW analytic.v_camea_bikecounters_24h_missing
|
|
62
|
+
AS SELECT max(to_timestamp((bd.measured_from / 1000)::double precision)) AS last_refresh,
|
|
63
|
+
bl.name
|
|
64
|
+
FROM bicyclecounters_detections bd
|
|
65
|
+
JOIN bicyclecounters_locations bl ON bd.locations_id::text = bl.id::text
|
|
66
|
+
GROUP BY bl.name
|
|
67
|
+
HAVING max(to_timestamp((bd.measured_from / 1000)::double precision)) < (now() - '1 day'::interval) AND max(to_timestamp((bd.measured_from / 1000)::double precision)) >= (CURRENT_DATE - '3 mons'::interval);
|
|
68
|
+
|
|
69
|
+
-- analytic.v_camea_bikecounters_all_data_history source
|
|
70
|
+
|
|
71
|
+
CREATE OR REPLACE VIEW analytic.v_camea_bikecounters_all_data_history
|
|
72
|
+
AS SELECT to_timestamp((det.measured_from / 1000)::double precision)::date AS datum,
|
|
73
|
+
det.locations_id,
|
|
74
|
+
loc.name AS location_name,
|
|
75
|
+
old_1.in_camea_contract,
|
|
76
|
+
replace(loc.route::text, ' '::text, ''::text) AS route,
|
|
77
|
+
dir.name AS direction_name,
|
|
78
|
+
CASE
|
|
79
|
+
WHEN sum(det.value) IS NULL THEN 0::bigint
|
|
80
|
+
ELSE sum(det.value)
|
|
81
|
+
END AS detections
|
|
82
|
+
FROM bicyclecounters_detections det
|
|
83
|
+
LEFT JOIN bicyclecounters_locations loc ON det.locations_id::text = loc.id::text
|
|
84
|
+
LEFT JOIN bicyclecounters_directions dir ON det.directions_id::text = dir.id::text
|
|
85
|
+
LEFT JOIN analytic.camea_bikecounters_in_contract old_1 ON loc.vendor_id::text = old_1.location_id::text
|
|
86
|
+
GROUP BY (to_timestamp((det.measured_from / 1000)::double precision)::date), det.locations_id, loc.name, old_1.in_camea_contract, (replace(loc.route::text, ' '::text, ''::text)), dir.name;
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
-- analytic.v_camea_bikecounters_all_data_table_today source
|
|
90
|
+
|
|
91
|
+
CREATE OR REPLACE VIEW analytic.v_camea_bikecounters_all_data_table_today
|
|
92
|
+
AS SELECT t1.datum,
|
|
93
|
+
t1.locations_id,
|
|
94
|
+
t1.location_name,
|
|
95
|
+
t1.route,
|
|
96
|
+
t1.direction_name,
|
|
97
|
+
t1.in_camea_contract,
|
|
98
|
+
t1.dir1det,
|
|
99
|
+
CASE
|
|
100
|
+
WHEN t2.direction_name::text = t1.direction_name::text THEN 'není'::character varying
|
|
101
|
+
ELSE t2.direction_name
|
|
102
|
+
END AS direction2_name,
|
|
103
|
+
t2.dir2det,
|
|
104
|
+
t3.temperature
|
|
105
|
+
FROM ( SELECT to_timestamp((det.measured_from / 1000)::double precision) AS datum,
|
|
106
|
+
det.locations_id,
|
|
107
|
+
loc.name AS location_name,
|
|
108
|
+
replace(loc.route::text, ' '::text, ''::text) AS route,
|
|
109
|
+
dir.name AS direction_name,
|
|
110
|
+
old_1.in_camea_contract,
|
|
111
|
+
CASE
|
|
112
|
+
WHEN sum(det.value) IS NULL THEN 0::bigint
|
|
113
|
+
ELSE sum(det.value)
|
|
114
|
+
END AS dir1det
|
|
115
|
+
FROM bicyclecounters_detections det
|
|
116
|
+
LEFT JOIN bicyclecounters_locations loc ON det.locations_id::text = loc.id::text
|
|
117
|
+
LEFT JOIN bicyclecounters_directions dir ON det.directions_id::text = dir.id::text
|
|
118
|
+
LEFT JOIN analytic.camea_bikecounters_in_contract old_1 ON loc.vendor_id::text = old_1.location_id::text
|
|
119
|
+
WHERE (det.directions_id::text IN ( SELECT min(bicyclecounters_directions.id::text) AS min
|
|
120
|
+
FROM bicyclecounters_directions
|
|
121
|
+
GROUP BY bicyclecounters_directions.locations_id)) AND (to_timestamp((det.measured_from / 1000)::double precision)::date IN ( SELECT max(to_timestamp((bicyclecounters_detections.measured_from / 1000)::double precision)::date) AS max
|
|
122
|
+
FROM bicyclecounters_detections))
|
|
123
|
+
GROUP BY (to_timestamp((det.measured_from / 1000)::double precision)), det.locations_id, loc.name, (replace(loc.route::text, ' '::text, ''::text)), dir.name, old_1.in_camea_contract) t1
|
|
124
|
+
LEFT JOIN ( SELECT to_timestamp((det2.measured_from / 1000)::double precision) AS datum,
|
|
125
|
+
det2.locations_id,
|
|
126
|
+
loc.name AS location_name,
|
|
127
|
+
dir.vendor_id AS direction_id,
|
|
128
|
+
dir.name AS direction_name,
|
|
129
|
+
CASE
|
|
130
|
+
WHEN sum(det2.value) IS NULL THEN 0::bigint
|
|
131
|
+
ELSE sum(det2.value)
|
|
132
|
+
END AS dir2det
|
|
133
|
+
FROM bicyclecounters_detections det2
|
|
134
|
+
LEFT JOIN bicyclecounters_locations loc ON det2.locations_id::text = loc.id::text
|
|
135
|
+
LEFT JOIN bicyclecounters_directions dir ON det2.directions_id::text = dir.id::text
|
|
136
|
+
WHERE (det2.directions_id::text IN ( SELECT max(bicyclecounters_directions.id::text) AS max
|
|
137
|
+
FROM bicyclecounters_directions
|
|
138
|
+
GROUP BY bicyclecounters_directions.locations_id)) AND (to_timestamp((det2.measured_from / 1000)::double precision)::date IN ( SELECT max(to_timestamp((bicyclecounters_detections.measured_from / 1000)::double precision)::date) AS max
|
|
139
|
+
FROM bicyclecounters_detections))
|
|
140
|
+
GROUP BY (to_timestamp((det2.measured_from / 1000)::double precision)), det2.locations_id, loc.name, dir.vendor_id, dir.name) t2 ON t1.datum = t2.datum AND t1.locations_id::text = t2.locations_id::text
|
|
141
|
+
LEFT JOIN ( SELECT to_timestamp((bicyclecounters_temperatures.measured_from / 1000)::double precision) AS datum,
|
|
142
|
+
bicyclecounters_temperatures.locations_id,
|
|
143
|
+
avg(bicyclecounters_temperatures.value) AS temperature
|
|
144
|
+
FROM bicyclecounters_temperatures
|
|
145
|
+
WHERE (to_timestamp((bicyclecounters_temperatures.measured_from / 1000)::double precision)::date IN ( SELECT max(to_timestamp((bicyclecounters_detections.measured_from / 1000)::double precision)::date) AS max
|
|
146
|
+
FROM bicyclecounters_detections))
|
|
147
|
+
GROUP BY (to_timestamp((bicyclecounters_temperatures.measured_from / 1000)::double precision)), bicyclecounters_temperatures.locations_id) t3 ON t1.datum = t3.datum AND t1.locations_id::text = t3.locations_id::text;
|
|
148
|
+
|
|
149
|
+
-- analytic.v_camea_bikecounters_all_data_today source
|
|
150
|
+
|
|
151
|
+
CREATE OR REPLACE VIEW analytic.v_camea_bikecounters_all_data_today
|
|
152
|
+
AS SELECT t1.datum,
|
|
153
|
+
t1.locations_id,
|
|
154
|
+
t1.location_name,
|
|
155
|
+
t1.in_camea_contract,
|
|
156
|
+
t1.lat,
|
|
157
|
+
t1.lng,
|
|
158
|
+
t1.route,
|
|
159
|
+
t1.directions_id,
|
|
160
|
+
t1.direction_name,
|
|
161
|
+
t1.direction_num,
|
|
162
|
+
t1.detections,
|
|
163
|
+
t2.temperature
|
|
164
|
+
FROM ( SELECT to_timestamp((det.measured_from / 1000)::double precision) AS datum,
|
|
165
|
+
det.locations_id,
|
|
166
|
+
loc.name AS location_name,
|
|
167
|
+
old_1.in_camea_contract,
|
|
168
|
+
loc.lat,
|
|
169
|
+
loc.lng,
|
|
170
|
+
replace(loc.route::text, ' '::text, ''::text) AS route,
|
|
171
|
+
det.directions_id,
|
|
172
|
+
dir.name AS direction_name,
|
|
173
|
+
CASE
|
|
174
|
+
WHEN (det.directions_id::text IN ( SELECT min(bicyclecounters_detections.directions_id::text) AS min
|
|
175
|
+
FROM bicyclecounters_detections
|
|
176
|
+
GROUP BY bicyclecounters_detections.locations_id)) THEN 'Směr 1'::text
|
|
177
|
+
ELSE 'Směr 2'::text
|
|
178
|
+
END AS direction_num,
|
|
179
|
+
CASE
|
|
180
|
+
WHEN sum(det.value) IS NULL THEN 0::bigint
|
|
181
|
+
ELSE sum(det.value)
|
|
182
|
+
END AS detections
|
|
183
|
+
FROM bicyclecounters_detections det
|
|
184
|
+
LEFT JOIN bicyclecounters_locations loc ON det.locations_id::text = loc.id::text
|
|
185
|
+
LEFT JOIN bicyclecounters_directions dir ON det.directions_id::text = dir.id::text
|
|
186
|
+
LEFT JOIN analytic.camea_bikecounters_in_contract old_1 ON loc.vendor_id::text = old_1.location_id::text
|
|
187
|
+
WHERE (to_timestamp((det.measured_from / 1000)::double precision)::date IN ( SELECT max(to_timestamp((bicyclecounters_detections.measured_from / 1000)::double precision)::date) AS max
|
|
188
|
+
FROM bicyclecounters_detections))
|
|
189
|
+
GROUP BY (to_timestamp((det.measured_from / 1000)::double precision)), det.locations_id, loc.name, old_1.in_camea_contract, loc.lat, loc.lng, (replace(loc.route::text, ' '::text, ''::text)), det.directions_id, dir.name, (
|
|
190
|
+
CASE
|
|
191
|
+
WHEN (det.directions_id::text IN ( SELECT min(bicyclecounters_detections.directions_id::text) AS min
|
|
192
|
+
FROM bicyclecounters_detections
|
|
193
|
+
GROUP BY bicyclecounters_detections.locations_id)) THEN 'Směr 1'::text
|
|
194
|
+
ELSE 'Směr 2'::text
|
|
195
|
+
END)) t1
|
|
196
|
+
LEFT JOIN ( SELECT to_timestamp((bicyclecounters_temperatures.measured_from / 1000)::double precision) AS datum,
|
|
197
|
+
bicyclecounters_temperatures.locations_id,
|
|
198
|
+
avg(bicyclecounters_temperatures.value) AS temperature
|
|
199
|
+
FROM bicyclecounters_temperatures
|
|
200
|
+
WHERE (to_timestamp((bicyclecounters_temperatures.measured_from / 1000)::double precision)::date IN ( SELECT max(to_timestamp((bicyclecounters_temperatures_1.measured_from / 1000)::double precision)::date) AS max
|
|
201
|
+
FROM bicyclecounters_temperatures bicyclecounters_temperatures_1))
|
|
202
|
+
GROUP BY (to_timestamp((bicyclecounters_temperatures.measured_from / 1000)::double precision)), bicyclecounters_temperatures.locations_id) t2 ON t1.datum = t2.datum AND t1.locations_id::text = t2.locations_id::text;
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
-- analytic.v_camea_bikecounters_data_disbalance source
|
|
206
|
+
|
|
207
|
+
CREATE OR REPLACE VIEW analytic.v_camea_bikecounters_data_disbalance
|
|
208
|
+
AS SELECT d1.datum,
|
|
209
|
+
d1.locations_id,
|
|
210
|
+
d1.location_name,
|
|
211
|
+
d1.direction_id AS dir1id,
|
|
212
|
+
d1.direction_name AS dir1_name,
|
|
213
|
+
CASE
|
|
214
|
+
WHEN d1.dir1det IS NULL THEN 0::bigint
|
|
215
|
+
ELSE d1.dir1det
|
|
216
|
+
END AS dir1det,
|
|
217
|
+
d1.in_camea_contract,
|
|
218
|
+
CASE
|
|
219
|
+
WHEN d2.direction_id::text = d1.direction_id::text THEN 'není'::character varying
|
|
220
|
+
ELSE d2.direction_id
|
|
221
|
+
END AS dir2id,
|
|
222
|
+
CASE
|
|
223
|
+
WHEN d2.direction_id::text = d1.direction_id::text THEN 'není'::character varying
|
|
224
|
+
ELSE d2.direction_name
|
|
225
|
+
END AS dir2_name,
|
|
226
|
+
CASE
|
|
227
|
+
WHEN d2.direction_id::text = d1.direction_id::text THEN 0::bigint
|
|
228
|
+
WHEN d2.dir2det IS NULL THEN 0::bigint
|
|
229
|
+
ELSE d2.dir2det
|
|
230
|
+
END AS dir2det
|
|
231
|
+
FROM ( SELECT to_timestamp((det.measured_from / 1000)::double precision)::date AS datum,
|
|
232
|
+
det.locations_id,
|
|
233
|
+
loc.name AS location_name,
|
|
234
|
+
dir.vendor_id AS direction_id,
|
|
235
|
+
dir.name AS direction_name,
|
|
236
|
+
old_1.in_camea_contract,
|
|
237
|
+
sum(det.value) AS dir1det
|
|
238
|
+
FROM bicyclecounters_detections det
|
|
239
|
+
LEFT JOIN bicyclecounters_locations loc ON det.locations_id::text = loc.id::text
|
|
240
|
+
LEFT JOIN bicyclecounters_directions dir ON det.directions_id::text = dir.id::text
|
|
241
|
+
LEFT JOIN analytic.camea_bikecounters_in_contract old_1 ON loc.vendor_id::text = old_1.location_id::text
|
|
242
|
+
WHERE (det.directions_id::text IN ( SELECT max(bicyclecounters_directions.id::text) AS max
|
|
243
|
+
FROM bicyclecounters_directions
|
|
244
|
+
GROUP BY bicyclecounters_directions.locations_id))
|
|
245
|
+
GROUP BY (to_timestamp((det.measured_from / 1000)::double precision)::date), det.locations_id, loc.name, dir.vendor_id, dir.name, old_1.in_camea_contract) d1
|
|
246
|
+
LEFT JOIN ( SELECT to_timestamp((det2.measured_from / 1000)::double precision)::date AS datum,
|
|
247
|
+
det2.locations_id,
|
|
248
|
+
loc.name AS location_name,
|
|
249
|
+
dir.vendor_id AS direction_id,
|
|
250
|
+
dir.name AS direction_name,
|
|
251
|
+
sum(det2.value) AS dir2det
|
|
252
|
+
FROM bicyclecounters_detections det2
|
|
253
|
+
LEFT JOIN bicyclecounters_locations loc ON det2.locations_id::text = loc.id::text
|
|
254
|
+
LEFT JOIN bicyclecounters_directions dir ON det2.directions_id::text = dir.id::text
|
|
255
|
+
WHERE (det2.directions_id::text IN ( SELECT min(bicyclecounters_directions.id::text) AS min
|
|
256
|
+
FROM bicyclecounters_directions
|
|
257
|
+
GROUP BY bicyclecounters_directions.locations_id))
|
|
258
|
+
GROUP BY (to_timestamp((det2.measured_from / 1000)::double precision)::date), det2.locations_id, loc.name, dir.vendor_id, dir.name) d2 ON d1.datum = d2.datum AND d1.locations_id::text = d2.locations_id::text;
|
|
259
|
+
|
|
260
|
+
-- analytic.v_camea_bikecounters_data_quality source
|
|
261
|
+
|
|
262
|
+
CREATE OR REPLACE VIEW analytic.v_camea_bikecounters_data_quality
|
|
263
|
+
AS SELECT to_timestamp((det.measured_from / 1000)::double precision)::date AS date,
|
|
264
|
+
loc.vendor_id AS location_id,
|
|
265
|
+
loc.name AS location_name,
|
|
266
|
+
dir.vendor_id AS direction_id,
|
|
267
|
+
dir.name AS direction_name,
|
|
268
|
+
count(det.locations_id) AS lines,
|
|
269
|
+
count(det.value) AS detections,
|
|
270
|
+
count(det.value)::numeric / count(det.locations_id)::numeric AS ratio,
|
|
271
|
+
old_1.in_camea_contract
|
|
272
|
+
FROM bicyclecounters_detections det
|
|
273
|
+
LEFT JOIN bicyclecounters_locations loc ON det.locations_id::text = loc.id::text
|
|
274
|
+
LEFT JOIN bicyclecounters_directions dir ON det.directions_id::text = dir.id::text
|
|
275
|
+
LEFT JOIN analytic.camea_bikecounters_in_contract old_1 ON loc.vendor_id::text = old_1.location_id::text
|
|
276
|
+
GROUP BY (to_timestamp((det.measured_from / 1000)::double precision)::date), loc.vendor_id, loc.name, dir.vendor_id, dir.name, old_1.in_camea_contract;
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
-- analytic.v_camea_bikecounters_last_update source
|
|
280
|
+
|
|
281
|
+
CREATE OR REPLACE VIEW analytic.v_camea_bikecounters_last_update
|
|
282
|
+
AS SELECT max(timezone('Europe/Prague'::text, to_timestamp((bicyclecounters_detections.measured_to / 1000)::double precision))) AS max
|
|
283
|
+
FROM bicyclecounters_detections;
|
|
284
|
+
|
|
285
|
+
-- analytic.v_camea_bikecounters_name_table source
|
|
286
|
+
|
|
287
|
+
CREATE OR REPLACE VIEW analytic.v_camea_bikecounters_name_table
|
|
288
|
+
AS SELECT loc.id AS location_id,
|
|
289
|
+
loc.vendor_id AS loc_vendor_id,
|
|
290
|
+
loc.name AS location_name,
|
|
291
|
+
loc.route,
|
|
292
|
+
loc.lat,
|
|
293
|
+
loc.lng,
|
|
294
|
+
dir.id AS direction_id,
|
|
295
|
+
dir.vendor_id AS dir_vendor_id,
|
|
296
|
+
dir.name AS direction_name,
|
|
297
|
+
old_1.in_camea_contract
|
|
298
|
+
FROM bicyclecounters_locations loc
|
|
299
|
+
JOIN bicyclecounters_directions dir ON loc.id::text = dir.locations_id::text
|
|
300
|
+
JOIN analytic.camea_bikecounters_in_contract old_1 ON loc.vendor_id::text = old_1.location_id::text;
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
-- analytic.v_camea_data_disbalance source
|
|
304
|
+
|
|
305
|
+
CREATE OR REPLACE VIEW analytic.v_camea_data_disbalance
|
|
306
|
+
AS SELECT d1.datum,
|
|
307
|
+
d1.locations_id,
|
|
308
|
+
d1.location_name,
|
|
309
|
+
d1.direction_id AS dir1id,
|
|
310
|
+
d1.direction_name AS dir1_name,
|
|
311
|
+
CASE
|
|
312
|
+
WHEN d1.dir1det IS NULL THEN 0::bigint
|
|
313
|
+
ELSE d1.dir1det
|
|
314
|
+
END AS dir1det,
|
|
315
|
+
d1.in_camea_contract,
|
|
316
|
+
CASE
|
|
317
|
+
WHEN d2.direction_id::text = d1.direction_id::text THEN 'není'::character varying
|
|
318
|
+
ELSE d2.direction_id
|
|
319
|
+
END AS dir2id,
|
|
320
|
+
CASE
|
|
321
|
+
WHEN d2.direction_id::text = d1.direction_id::text THEN 'není'::character varying
|
|
322
|
+
ELSE d2.direction_name
|
|
323
|
+
END AS dir2_name,
|
|
324
|
+
CASE
|
|
325
|
+
WHEN d2.direction_id::text = d1.direction_id::text THEN 0::bigint
|
|
326
|
+
WHEN d2.dir2det IS NULL THEN 0::bigint
|
|
327
|
+
ELSE d2.dir2det
|
|
328
|
+
END AS dir2det
|
|
329
|
+
FROM ( SELECT to_timestamp((det.measured_from / 1000)::double precision)::date AS datum,
|
|
330
|
+
det.locations_id,
|
|
331
|
+
loc.name AS location_name,
|
|
332
|
+
dir.vendor_id AS direction_id,
|
|
333
|
+
dir.name AS direction_name,
|
|
334
|
+
old_1.in_camea_contract,
|
|
335
|
+
sum(det.value) AS dir1det
|
|
336
|
+
FROM bicyclecounters_detections det
|
|
337
|
+
LEFT JOIN bicyclecounters_locations loc ON det.locations_id::text = loc.id::text
|
|
338
|
+
LEFT JOIN bicyclecounters_directions dir ON det.directions_id::text = dir.id::text
|
|
339
|
+
LEFT JOIN analytic.camea_bikecounters_in_contract old_1 ON loc.vendor_id::text = old_1.location_id::text
|
|
340
|
+
WHERE (det.directions_id::text IN ( SELECT max(bicyclecounters_directions.id::text) AS max
|
|
341
|
+
FROM bicyclecounters_directions
|
|
342
|
+
GROUP BY bicyclecounters_directions.locations_id))
|
|
343
|
+
GROUP BY (to_timestamp((det.measured_from / 1000)::double precision)::date), det.locations_id, loc.name, dir.vendor_id, dir.name, old_1.in_camea_contract) d1
|
|
344
|
+
LEFT JOIN ( SELECT to_timestamp((det2.measured_from / 1000)::double precision)::date AS datum,
|
|
345
|
+
det2.locations_id,
|
|
346
|
+
loc.name AS location_name,
|
|
347
|
+
dir.vendor_id AS direction_id,
|
|
348
|
+
dir.name AS direction_name,
|
|
349
|
+
sum(det2.value) AS dir2det
|
|
350
|
+
FROM bicyclecounters_detections det2
|
|
351
|
+
LEFT JOIN bicyclecounters_locations loc ON det2.locations_id::text = loc.id::text
|
|
352
|
+
LEFT JOIN bicyclecounters_directions dir ON det2.directions_id::text = dir.id::text
|
|
353
|
+
WHERE (det2.directions_id::text IN ( SELECT min(bicyclecounters_directions.id::text) AS min
|
|
354
|
+
FROM bicyclecounters_directions
|
|
355
|
+
GROUP BY bicyclecounters_directions.locations_id))
|
|
356
|
+
GROUP BY (to_timestamp((det2.measured_from / 1000)::double precision)::date), det2.locations_id, loc.name, dir.vendor_id, dir.name) d2 ON d1.datum = d2.datum AND d1.locations_id::text = d2.locations_id::text;
|
|
357
|
+
|
|
358
|
+
-- analytic.v_camea_data_quality source
|
|
359
|
+
|
|
360
|
+
CREATE OR REPLACE VIEW analytic.v_camea_data_quality
|
|
361
|
+
AS SELECT to_timestamp((det.measured_from / 1000)::double precision)::date AS date,
|
|
362
|
+
loc.vendor_id AS location_id,
|
|
363
|
+
loc.name AS location_name,
|
|
364
|
+
dir.vendor_id AS direction_id,
|
|
365
|
+
dir.name AS direction_name,
|
|
366
|
+
count(det.locations_id) AS lines,
|
|
367
|
+
count(det.value) AS detections,
|
|
368
|
+
count(det.value)::numeric / count(det.locations_id)::numeric AS ratio,
|
|
369
|
+
old_1.in_camea_contract
|
|
370
|
+
FROM bicyclecounters_detections det
|
|
371
|
+
LEFT JOIN bicyclecounters_locations loc ON det.locations_id::text = loc.id::text
|
|
372
|
+
LEFT JOIN bicyclecounters_directions dir ON det.directions_id::text = dir.id::text
|
|
373
|
+
LEFT JOIN analytic.camea_bikecounters_in_contract old_1 ON loc.vendor_id::text = old_1.location_id::text
|
|
374
|
+
GROUP BY (to_timestamp((det.measured_from / 1000)::double precision)::date), loc.vendor_id, loc.name, dir.vendor_id, dir.name, old_1.in_camea_contract;
|
|
375
|
+
|
|
376
|
+
-- analytic.v_camea_last_update source
|
|
377
|
+
|
|
378
|
+
CREATE OR REPLACE VIEW analytic.v_camea_last_update
|
|
379
|
+
AS SELECT max(timezone('Europe/Prague'::text, to_timestamp((bicyclecounters_detections.measured_to / 1000)::double precision))) AS max
|
|
380
|
+
FROM bicyclecounters_detections;
|
|
381
|
+
|
|
382
|
+
-- analytic.v_bicyclecounters_24h_missing
|
|
383
|
+
CREATE OR REPLACE VIEW analytic.v_bicyclecounters_24h_missing
|
|
384
|
+
AS SELECT max(to_timestamp((bd.measured_from / 1000)::double precision)) AS last_refresh,
|
|
385
|
+
bl.name
|
|
386
|
+
FROM bicyclecounters_detections bd
|
|
387
|
+
JOIN bicyclecounters_locations bl ON bd.locations_id::text = bl.id::text
|
|
388
|
+
GROUP BY bl.name
|
|
389
|
+
HAVING max(to_timestamp((bd.measured_from / 1000)::double precision)) < (now() - '1 day'::interval) AND max(to_timestamp((bd.measured_from / 1000)::double precision)) >= (CURRENT_DATE - '3 mons'::interval);
|
|
390
|
+
|
|
391
|
+
COMMENT ON VIEW analytic.v_bicyclecounters_24h_missing IS 'alerting for Martin Lér';
|
|
392
|
+
|
|
393
|
+
-- bikecounter history
|
|
394
|
+
|
|
395
|
+
CREATE OR REPLACE VIEW analytic.v_camea_bikecounters_history
|
|
396
|
+
AS SELECT to_timestamp((det.measured_from / 1000)::double precision)::date AS datum,
|
|
397
|
+
det.locations_id,
|
|
398
|
+
loc.name AS location_name,
|
|
399
|
+
old_1.in_camea_contract,
|
|
400
|
+
loc.lat AS latitude,
|
|
401
|
+
loc.lng AS longitude,
|
|
402
|
+
replace(loc.route::text, ' '::text, ''::text) AS route,
|
|
403
|
+
det.directions_id,
|
|
404
|
+
dir.name AS direction_name,
|
|
405
|
+
CASE
|
|
406
|
+
WHEN (det.directions_id::text IN ( SELECT min(bicyclecounters_detections.directions_id::text) AS min
|
|
407
|
+
FROM bicycle_counters.bicyclecounters_detections
|
|
408
|
+
GROUP BY bicyclecounters_detections.locations_id)) THEN 'Směr 1'::text
|
|
409
|
+
ELSE 'Směr 2'::text
|
|
410
|
+
END AS direction_num,
|
|
411
|
+
CASE
|
|
412
|
+
WHEN sum(det.value) IS NULL THEN 0::bigint
|
|
413
|
+
ELSE sum(det.value)
|
|
414
|
+
END AS detections
|
|
415
|
+
FROM bicycle_counters.bicyclecounters_detections det
|
|
416
|
+
LEFT JOIN bicycle_counters.bicyclecounters_locations loc ON det.locations_id::text = loc.id::text
|
|
417
|
+
LEFT JOIN bicycle_counters.bicyclecounters_directions dir ON det.directions_id::text = dir.id::text
|
|
418
|
+
LEFT JOIN analytic.camea_bikecounters_in_contract old_1 ON loc.vendor_id::text = old_1.location_id::text
|
|
419
|
+
GROUP BY (to_timestamp((det.measured_from / 1000)::double precision)::date), det.locations_id, loc.name, old_1.in_camea_contract, loc.lat, loc.lng, loc.route, det.directions_id, dir.name, (
|
|
420
|
+
CASE
|
|
421
|
+
WHEN (det.directions_id::text IN ( SELECT min(bicyclecounters_detections.directions_id::text) AS min
|
|
422
|
+
FROM bicycle_counters.bicyclecounters_detections
|
|
423
|
+
GROUP BY bicyclecounters_detections.locations_id)) THEN 'Směr 1'::text
|
|
424
|
+
ELSE 'Směr 2'::text
|
|
425
|
+
END);
|
|
426
|
+
|
|
427
|
+
-- bikecounter history table
|
|
428
|
+
|
|
429
|
+
CREATE OR REPLACE VIEW analytic.v_camea_bikecounters_history_table
|
|
430
|
+
AS SELECT t1.datum,
|
|
431
|
+
t1.locations_id,
|
|
432
|
+
t1.location_name,
|
|
433
|
+
t1.route,
|
|
434
|
+
t1.direction_name,
|
|
435
|
+
t1.in_camea_contract,
|
|
436
|
+
t1.dir1det,
|
|
437
|
+
CASE
|
|
438
|
+
WHEN t2.direction_name::text = t1.direction_name::text THEN 'není'::character varying
|
|
439
|
+
ELSE t2.direction_name
|
|
440
|
+
END AS direction2_name,
|
|
441
|
+
t2.dir2det
|
|
442
|
+
FROM ( SELECT to_timestamp((det.measured_from / 1000)::double precision)::date AS datum,
|
|
443
|
+
det.locations_id,
|
|
444
|
+
loc.name AS location_name,
|
|
445
|
+
replace(loc.route::text, ' '::text, ''::text) AS route,
|
|
446
|
+
dir.name AS direction_name,
|
|
447
|
+
old_1.in_camea_contract,
|
|
448
|
+
CASE
|
|
449
|
+
WHEN sum(det.value) IS NULL THEN 0::bigint
|
|
450
|
+
ELSE sum(det.value)
|
|
451
|
+
END AS dir1det
|
|
452
|
+
FROM bicycle_counters.bicyclecounters_detections det
|
|
453
|
+
LEFT JOIN bicyclecounters_locations loc ON det.locations_id::text = loc.id::text
|
|
454
|
+
LEFT JOIN bicyclecounters_directions dir ON det.directions_id::text = dir.id::text
|
|
455
|
+
LEFT JOIN analytic.camea_bikecounters_in_contract old_1 ON loc.vendor_id::text = old_1.location_id::text
|
|
456
|
+
WHERE (det.directions_id::text IN ( SELECT min(bicyclecounters_directions.id::text) AS min
|
|
457
|
+
FROM bicyclecounters_directions
|
|
458
|
+
GROUP BY bicyclecounters_directions.locations_id))
|
|
459
|
+
GROUP BY (to_timestamp((det.measured_from / 1000)::double precision)::date), det.locations_id, loc.name, (replace(loc.route::text, ' '::text, ''::text)), dir.name, old_1.in_camea_contract) t1
|
|
460
|
+
LEFT JOIN ( SELECT to_timestamp((det2.measured_from / 1000)::double precision)::date AS datum,
|
|
461
|
+
det2.locations_id,
|
|
462
|
+
loc.name AS location_name,
|
|
463
|
+
dir.vendor_id AS direction_id,
|
|
464
|
+
dir.name AS direction_name,
|
|
465
|
+
CASE
|
|
466
|
+
WHEN sum(det2.value) IS NULL THEN 0::bigint
|
|
467
|
+
ELSE sum(det2.value)
|
|
468
|
+
END AS dir2det
|
|
469
|
+
FROM bicycle_counters.bicyclecounters_detections det2
|
|
470
|
+
LEFT JOIN bicyclecounters_locations loc ON det2.locations_id::text = loc.id::text
|
|
471
|
+
LEFT JOIN bicyclecounters_directions dir ON det2.directions_id::text = dir.id::text
|
|
472
|
+
WHERE (det2.directions_id::text IN ( SELECT max(bicyclecounters_directions.id::text) AS max
|
|
473
|
+
FROM bicyclecounters_directions
|
|
474
|
+
GROUP BY bicyclecounters_directions.locations_id))
|
|
475
|
+
GROUP BY (to_timestamp((det2.measured_from / 1000)::double precision)::date), det2.locations_id, loc.name, dir.vendor_id, dir.name) t2 ON t1.datum = t2.datum AND t1.locations_id::text = t2.locations_id::text;
|
|
476
|
+
|
|
477
|
+
-- camea data month
|
|
478
|
+
|
|
479
|
+
CREATE OR REPLACE VIEW v_camea_bikecounters_data_month
|
|
480
|
+
AS SELECT d1.date_time,
|
|
481
|
+
d1.date_hour,
|
|
482
|
+
d1.locations_id,
|
|
483
|
+
d1.location_name,
|
|
484
|
+
d1.directions_id AS smer_1,
|
|
485
|
+
d2.directions_id AS smer_2,
|
|
486
|
+
d1.direction_name AS dir1_name,
|
|
487
|
+
d2.direction_name AS dir2_name,
|
|
488
|
+
d1.dir1det,
|
|
489
|
+
d2.dir2det
|
|
490
|
+
FROM ( SELECT to_timestamp((det.measured_from / 1000)::double precision) AS date_time,
|
|
491
|
+
date_trunc('hour'::text, to_timestamp((det.measured_from / 1000)::double precision)) AS date_hour,
|
|
492
|
+
det.locations_id,
|
|
493
|
+
loc.name AS location_name,
|
|
494
|
+
det.directions_id,
|
|
495
|
+
dir.name AS direction_name,
|
|
496
|
+
det.value AS dir1det
|
|
497
|
+
FROM bicyclecounters_detections det
|
|
498
|
+
LEFT JOIN bicyclecounters_locations loc ON det.locations_id::text = loc.id::text
|
|
499
|
+
LEFT JOIN bicyclecounters_directions dir ON det.directions_id::text = dir.id::text
|
|
500
|
+
WHERE (det.directions_id::text IN ( SELECT max(bicyclecounters_directions.id::text) AS max --vyberu smer 1
|
|
501
|
+
FROM bicyclecounters_directions
|
|
502
|
+
GROUP BY bicyclecounters_directions.locations_id)) AND det.measured_from::double precision >= (date_part('epoch'::text, now() - '1 mon'::interval) * 1000::double precision)) d1
|
|
503
|
+
FULL JOIN ( SELECT to_timestamp((det2.measured_from / 1000)::double precision) AS date_time,
|
|
504
|
+
det2.locations_id,
|
|
505
|
+
loc.name AS location_name,
|
|
506
|
+
det2.directions_id,
|
|
507
|
+
dir.name AS direction_name,
|
|
508
|
+
det2.value AS dir2det
|
|
509
|
+
FROM bicyclecounters_detections det2
|
|
510
|
+
LEFT JOIN bicyclecounters_locations loc ON det2.locations_id::text = loc.id::text
|
|
511
|
+
LEFT JOIN bicyclecounters_directions dir ON det2.directions_id::text = dir.id::text
|
|
512
|
+
WHERE (det2.directions_id::text IN ( SELECT min(bicyclecounters_directions.id::text) AS min -- vyberu smer 2
|
|
513
|
+
FROM bicyclecounters_directions
|
|
514
|
+
GROUP BY bicyclecounters_directions.locations_id)) AND det2.measured_from::double precision >= (date_part('epoch'::text, now() - '1 mon'::interval) * 1000::double precision)) d2 ON d1.date_time = d2.date_time AND d1.locations_id::text = d2.locations_id::text;
|
|
515
|
+
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/* Replace with your SQL commands */
|
|
2
|
+
|
|
3
|
+
-- drop existing analytic views connected to tables we change
|
|
4
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_24h_missing;
|
|
5
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_24h_missing;
|
|
6
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_all_data_history;
|
|
7
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_all_data_table_today;
|
|
8
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_all_data_today;
|
|
9
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_data_disbalance;
|
|
10
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_data_quality;
|
|
11
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_last_update;
|
|
12
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_name_table;
|
|
13
|
+
DROP VIEW IF EXISTS analytic.v_camea_data_disbalance;
|
|
14
|
+
DROP VIEW IF EXISTS analytic.v_camea_data_quality;
|
|
15
|
+
DROP VIEW IF EXISTS analytic.v_camea_last_update;
|
|
16
|
+
|
|
17
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_history;
|
|
18
|
+
DROP VIEW IF EXISTS analytic.v_camea_bikecounters_history_table;
|
|
19
|
+
DROP VIEW IF EXISTS analytic.v_bicyclecounters_24h_missing;
|
|
20
|
+
|
|
21
|
+
-- drop only view in bicycle_counters schema
|
|
22
|
+
DROP VIEW IF EXISTS v_camea_bikecounters_data_month;
|
|
23
|
+
|
|
24
|
+
--rename original table
|
|
25
|
+
ALTER TABLE bicyclecounters_detections RENAME TO bicyclecounters_detections_old;
|
|
26
|
+
|
|
27
|
+
--rename back partitions
|
|
28
|
+
ALTER TABLE bicyclecounters_detections_min RENAME TO bicyclecounters_detections_min_old;
|
|
29
|
+
ALTER TABLE bicyclecounters_detections_y2019 RENAME TO bicyclecounters_detections_y2019_old;
|
|
30
|
+
ALTER TABLE bicyclecounters_detections_y2020 RENAME TO bicyclecounters_detections_y2020_old;
|
|
31
|
+
ALTER TABLE bicyclecounters_detections_y2021 RENAME TO bicyclecounters_detections_y2021_old;
|
|
32
|
+
ALTER TABLE bicyclecounters_detections_y2022 RENAME TO bicyclecounters_detections_y2022_old;
|
|
33
|
+
ALTER TABLE bicyclecounters_detections_y2023 RENAME TO bicyclecounters_detections_y2023_old;
|
|
34
|
+
ALTER TABLE bicyclecounters_detections_y2024 RENAME TO bicyclecounters_detections_y2024_old;
|
|
35
|
+
ALTER TABLE bicyclecounters_detections_y2025 RENAME TO bicyclecounters_detections_y2025_old;
|
|
36
|
+
ALTER TABLE bicyclecounters_detections_y2026 RENAME TO bicyclecounters_detections_y2026_old;
|
|
37
|
+
ALTER TABLE bicyclecounters_detections_y2027up RENAME TO bicyclecounters_detections_y2027up_old;
|
|
38
|
+
|
|
39
|
+
-- CREATE TABLE bicyclecounters_detections
|
|
40
|
+
CREATE TABLE bicyclecounters_detections (
|
|
41
|
+
locations_id varchar(255) NOT NULL,
|
|
42
|
+
directions_id varchar(255) NOT NULL,
|
|
43
|
+
measured_from timestamptz NOT NULL,
|
|
44
|
+
measured_to timestamptz NOT NULL,
|
|
45
|
+
value int4 NULL,
|
|
46
|
+
create_batch_id int8 NULL,
|
|
47
|
+
created_at timestamptz NULL,
|
|
48
|
+
created_by varchar(150) NULL,
|
|
49
|
+
update_batch_id int8 NULL,
|
|
50
|
+
updated_at timestamptz NULL,
|
|
51
|
+
updated_by varchar(150) NULL,
|
|
52
|
+
value_pedestrians int4 NULL,
|
|
53
|
+
CONSTRAINT bicyclecounters_detections_pkey_new PRIMARY KEY (locations_id, directions_id, measured_from)
|
|
54
|
+
)
|
|
55
|
+
PARTITION BY RANGE (measured_from);
|
|
56
|
+
;
|
|
57
|
+
|
|
58
|
+
-- create indices
|
|
59
|
+
|
|
60
|
+
CREATE INDEX bicyclecounters_detections_directions_idx ON bicyclecounters_detections USING btree (directions_id);
|
|
61
|
+
CREATE INDEX bicyclecounters_detections_locations_idx ON bicyclecounters_detections USING btree (locations_id);
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
-- create partitions in the new table
|
|
65
|
+
CREATE TABLE bicyclecounters_detections_min PARTITION OF bicyclecounters_detections FOR VALUES FROM (MINVALUE) TO ('2019-01-01');
|
|
66
|
+
CREATE TABLE bicyclecounters_detections_y2019 PARTITION OF bicyclecounters_detections FOR VALUES FROM ('2019-01-01') TO ('2020-01-01');
|
|
67
|
+
CREATE TABLE bicyclecounters_detections_y2020 PARTITION OF bicyclecounters_detections FOR VALUES FROM ('2020-01-01') TO ('2021-01-01');
|
|
68
|
+
CREATE TABLE bicyclecounters_detections_y2021 PARTITION OF bicyclecounters_detections FOR VALUES FROM ('2021-01-01') TO ('2022-01-01');
|
|
69
|
+
CREATE TABLE bicyclecounters_detections_y2022 PARTITION OF bicyclecounters_detections FOR VALUES FROM ('2022-01-01') TO ('2023-01-01');
|
|
70
|
+
CREATE TABLE bicyclecounters_detections_y2023 PARTITION OF bicyclecounters_detections FOR VALUES FROM ('2023-01-01') TO ('2024-01-01');
|
|
71
|
+
CREATE TABLE bicyclecounters_detections_y2024 PARTITION OF bicyclecounters_detections FOR VALUES FROM ('2024-01-01') TO ('2025-01-01');
|
|
72
|
+
CREATE TABLE bicyclecounters_detections_y2025 PARTITION OF bicyclecounters_detections FOR VALUES FROM ('2025-01-01') TO ('2026-01-01');
|
|
73
|
+
CREATE TABLE bicyclecounters_detections_y2026 PARTITION OF bicyclecounters_detections FOR VALUES FROM ('2026-01-01') TO ('2027-01-01');
|
|
74
|
+
CREATE TABLE bicyclecounters_detections_y2027up PARTITION OF bicyclecounters_detections FOR VALUES FROM ('2027-01-01') TO (maxvalue);
|
|
75
|
+
|
|
76
|
+
-- change name
|
|
77
|
+
ALTER TABLE bicyclecounters_temperatures RENAME TO bicyclecounters_temperatures_old;
|
|
78
|
+
|
|
79
|
+
--rename partitions
|
|
80
|
+
ALTER TABLE bicyclecounters_temperatures_min RENAME TO bicyclecounters_temperatures_min_old;
|
|
81
|
+
ALTER TABLE bicyclecounters_temperatures_y2019 RENAME TO bicyclecounters_temperatures_y2019_old;
|
|
82
|
+
ALTER TABLE bicyclecounters_temperatures_y2020 RENAME TO bicyclecounters_temperatures_y2020_old;
|
|
83
|
+
ALTER TABLE bicyclecounters_temperatures_y2021 RENAME TO bicyclecounters_temperatures_y2021_old;
|
|
84
|
+
ALTER TABLE bicyclecounters_temperatures_y2022 RENAME TO bicyclecounters_temperatures_y2022_old;
|
|
85
|
+
ALTER TABLE bicyclecounters_temperatures_y2023 RENAME TO bicyclecounters_temperatures_y2023_old;
|
|
86
|
+
ALTER TABLE bicyclecounters_temperatures_y2024 RENAME TO bicyclecounters_temperatures_y2024_old;
|
|
87
|
+
ALTER TABLE bicyclecounters_temperatures_y2025 RENAME TO bicyclecounters_temperatures_y2025_old;
|
|
88
|
+
ALTER TABLE bicyclecounters_temperatures_y2026 RENAME TO bicyclecounters_temperatures_y2026_old;
|
|
89
|
+
ALTER TABLE bicyclecounters_temperatures_y2027up RENAME TO bicyclecounters_temperatures_y2027up_old;
|
|
90
|
+
|
|
91
|
+
--create second table with partitions
|
|
92
|
+
|
|
93
|
+
CREATE TABLE bicyclecounters_temperatures (
|
|
94
|
+
locations_id varchar(255) NOT NULL,
|
|
95
|
+
measured_from timestamptz NOT NULL,
|
|
96
|
+
measured_to timestamptz NOT NULL,
|
|
97
|
+
value int4 NULL,
|
|
98
|
+
create_batch_id int8 NULL,
|
|
99
|
+
created_at timestamptz NULL,
|
|
100
|
+
created_by varchar(150) NULL,
|
|
101
|
+
update_batch_id int8 NULL,
|
|
102
|
+
updated_at timestamptz NULL,
|
|
103
|
+
updated_by varchar(150) NULL,
|
|
104
|
+
CONSTRAINT bicyclecounters_temperatures_pkey_new PRIMARY KEY (locations_id, measured_from)
|
|
105
|
+
)
|
|
106
|
+
PARTITION BY RANGE (measured_from);
|
|
107
|
+
|
|
108
|
+
-- create index
|
|
109
|
+
|
|
110
|
+
CREATE INDEX bicyclecounters_temperatures_locations_idx ON bicyclecounters_temperatures USING btree (locations_id);
|
|
111
|
+
|
|
112
|
+
-- create partitions in the new table
|
|
113
|
+
CREATE TABLE bicyclecounters_temperatures_min PARTITION OF bicyclecounters_temperatures FOR VALUES FROM (MINVALUE) TO ('2019-01-01');
|
|
114
|
+
CREATE TABLE bicyclecounters_temperatures_y2019 PARTITION OF bicyclecounters_temperatures FOR VALUES FROM ('2019-01-01') TO ('2020-01-01');
|
|
115
|
+
CREATE TABLE bicyclecounters_temperatures_y2020 PARTITION OF bicyclecounters_temperatures FOR VALUES FROM ('2020-01-01') TO ('2021-01-01');
|
|
116
|
+
CREATE TABLE bicyclecounters_temperatures_y2021 PARTITION OF bicyclecounters_temperatures FOR VALUES FROM ('2021-01-01') TO ('2022-01-01');
|
|
117
|
+
CREATE TABLE bicyclecounters_temperatures_y2022 PARTITION OF bicyclecounters_temperatures FOR VALUES FROM ('2022-01-01') TO ('2023-01-01');
|
|
118
|
+
CREATE TABLE bicyclecounters_temperatures_y2023 PARTITION OF bicyclecounters_temperatures FOR VALUES FROM ('2023-01-01') TO ('2024-01-01');
|
|
119
|
+
CREATE TABLE bicyclecounters_temperatures_y2024 PARTITION OF bicyclecounters_temperatures FOR VALUES FROM ('2024-01-01') TO ('2025-01-01');
|
|
120
|
+
CREATE TABLE bicyclecounters_temperatures_y2025 PARTITION OF bicyclecounters_temperatures FOR VALUES FROM ('2025-01-01') TO ('2026-01-01');
|
|
121
|
+
CREATE TABLE bicyclecounters_temperatures_y2026 PARTITION OF bicyclecounters_temperatures FOR VALUES FROM ('2026-01-01') TO ('2027-01-01');
|
|
122
|
+
CREATE TABLE bicyclecounters_temperatures_y2027up PARTITION OF bicyclecounters_temperatures FOR VALUES FROM ('2027-01-01') TO (maxvalue);
|
|
@@ -57,8 +57,8 @@ class CameaMeasurementsTransformation extends transformations_1.BaseTransformati
|
|
|
57
57
|
? element.directions.map((direction) => ({
|
|
58
58
|
directions_id: "camea-" + direction.id,
|
|
59
59
|
locations_id: "camea-" + element.bikecounter,
|
|
60
|
-
measured_from: measuredFrom.
|
|
61
|
-
measured_to: measuredTo.
|
|
60
|
+
measured_from: measuredFrom.toISOString(),
|
|
61
|
+
measured_to: measuredTo.toISOString(),
|
|
62
62
|
value: direction.detections,
|
|
63
63
|
value_pedestrians: direction.pedestrians !== undefined && direction.pedestrians !== -1 ? direction.pedestrians : null,
|
|
64
64
|
}))
|
|
@@ -66,8 +66,8 @@ class CameaMeasurementsTransformation extends transformations_1.BaseTransformati
|
|
|
66
66
|
temperature: !isNaN(parseFloat(element.temperature))
|
|
67
67
|
? {
|
|
68
68
|
locations_id: "camea-" + element.bikecounter,
|
|
69
|
-
measured_from: measuredFrom.
|
|
70
|
-
measured_to: measuredTo.
|
|
69
|
+
measured_from: measuredFrom.toISOString(),
|
|
70
|
+
measured_to: measuredTo.toISOString(),
|
|
71
71
|
value: parseInt(element.temperature, 10),
|
|
72
72
|
}
|
|
73
73
|
: null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CameaMeasurementsTransformation.js","sourceRoot":"","sources":["../../../src/integration-engine/transformations/CameaMeasurementsTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2FAA4G;AAC5G,0DAA6C;AAC7C,kEAA+D;AAC/D,MAAa,+BAAgC,SAAQ,oCAAkB;IAGnE;QACI,KAAK,EAAE,CAAC;QAIZ;;WAEG;QACI,cAAS,GAAG,CAAO,IAAiB,EAAuD,EAAE;YAChG,MAAM,GAAG,GAA0B;gBAC/B,UAAU,EAAE,EAAE;gBACd,YAAY,EAAE,EAAE;aACnB,CAAC;YAEF,IAAI,IAAI,YAAY,KAAK,EAAE;gBACvB,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAO,OAAO,EAAE,CAAC,EAAE,EAAE;oBAC3C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;oBACrD,IAAI,OAAO,EAAE;wBACT,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;wBAC3D,IAAI,OAAO,CAAC,WAAW,EAAE;4BACrB,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;yBAC9C;qBACJ;oBACD,OAAO;gBACX,CAAC,CAAA,CAAC,CAAC;gBACH,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;gBAC5B,OAAO,GAAU,CAAC;aACrB;iBAAM;gBACH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;gBAClD,IAAI,OAAO,EAAE;oBACT,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;oBAC3D,IAAI,OAAO,CAAC,WAAW,EAAE;wBACrB,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;qBAC9C;iBACJ;gBACD,OAAO,GAAU,CAAC;aACrB;QACL,CAAC,CAAA,CAAC;QAEQ,qBAAgB,GAAG,CAAO,OAAY,EAAgB,EAAE;YAC9D,MAAM,YAAY,GAAG,mBAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;YACrF,MAAM,UAAU,GAAG,YAAY,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;YAE1D,MAAM,GAAG,GAAG;gBACR,UAAU,EAAE,OAAO,CAAC,UAAU;oBAC1B,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,SAA8B,EAAE,EAAE,CAAC,CAAC;wBACxD,aAAa,EAAE,QAAQ,GAAG,SAAS,CAAC,EAAE;wBACtC,YAAY,EAAE,QAAQ,GAAG,OAAO,CAAC,WAAW;wBAC5C,aAAa,EAAE,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"CameaMeasurementsTransformation.js","sourceRoot":"","sources":["../../../src/integration-engine/transformations/CameaMeasurementsTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2FAA4G;AAC5G,0DAA6C;AAC7C,kEAA+D;AAC/D,MAAa,+BAAgC,SAAQ,oCAAkB;IAGnE;QACI,KAAK,EAAE,CAAC;QAIZ;;WAEG;QACI,cAAS,GAAG,CAAO,IAAiB,EAAuD,EAAE;YAChG,MAAM,GAAG,GAA0B;gBAC/B,UAAU,EAAE,EAAE;gBACd,YAAY,EAAE,EAAE;aACnB,CAAC;YAEF,IAAI,IAAI,YAAY,KAAK,EAAE;gBACvB,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAO,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GAAG,CAAC,CAAC,SAA8B,EAAE,EAAE,CAAC,CAAC;wBACxD,aAAa,EAAE,QAAQ,GAAG,SAAS,CAAC,EAAE;wBACtC,YAAY,EAAE,QAAQ,GAAG,OAAO,CAAC,WAAW;wBAC5C,aAAa,EAAE,YAAY,CAAC,WAAW,EAAE;wBACzC,WAAW,EAAE,UAAU,CAAC,WAAW,EAAE;wBACrC,KAAK,EAAE,SAAS,CAAC,UAAU;wBAC3B,iBAAiB,EACb,SAAS,CAAC,WAAW,KAAK,SAAS,IAAI,SAAS,CAAC,WAAW,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI;qBACzG,CAAC,CAAC;oBACL,CAAC,CAAC,EAAE;gBACR,WAAW,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;oBAChD,CAAC,CAAC;wBACI,YAAY,EAAE,QAAQ,GAAG,OAAO,CAAC,WAAW;wBAC5C,aAAa,EAAE,YAAY,CAAC,WAAW,EAAE;wBACzC,WAAW,EAAE,UAAU,CAAC,WAAW,EAAE;wBACrC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;qBAC3C;oBACH,CAAC,CAAC,IAAI;aACb,CAAC;YAEF,OAAO,GAAG,CAAC;QACf,CAAC,CAAA,CAAC;QAhEE,IAAI,CAAC,IAAI,GAAG,uBAAe,CAAC,KAAK,CAAC,IAAI,GAAG,cAAc,CAAC;IAC5D,CAAC;CAgEJ;AAtED,0EAsEC"}
|
|
@@ -27,8 +27,8 @@ class EcoCounterMeasurementsTransformation extends transformations_1.BaseTransfo
|
|
|
27
27
|
const res = {
|
|
28
28
|
directions_id: null,
|
|
29
29
|
locations_id: null,
|
|
30
|
-
measured_from: measuredFrom.
|
|
31
|
-
measured_to: measuredTo.
|
|
30
|
+
measured_from: measuredFrom.toISOString(),
|
|
31
|
+
measured_to: measuredTo.toISOString(),
|
|
32
32
|
value: element.counts,
|
|
33
33
|
};
|
|
34
34
|
return res;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EcoCounterMeasurementsTransformation.js","sourceRoot":"","sources":["../../../src/integration-engine/transformations/EcoCounterMeasurementsTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2FAA4G;AAC5G,0DAA6C;AAC7C,kEAA+D;AAE/D,MAAa,oCAAqC,SAAQ,oCAAkB;IAGxE;QACI,KAAK,EAAE,CAAC;QAIF,qBAAgB,GAAG,CAAO,OAAY,EAAgB,EAAE;YAC9D,wGAAwG;YACxG,sGAAsG;YACtG,gBAAgB;YAChB,MAAM,YAAY,GAAG,mBAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE;gBACpF,QAAQ,EAAE,eAAe;aAC5B,CAAC,CAAC;YACH,MAAM,UAAU,GAAG,YAAY,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;YAE3D,MAAM,GAAG,GAAG;gBACR,aAAa,EAAE,IAAI;gBACnB,YAAY,EAAE,IAAI;gBAClB,aAAa,EAAE,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"EcoCounterMeasurementsTransformation.js","sourceRoot":"","sources":["../../../src/integration-engine/transformations/EcoCounterMeasurementsTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2FAA4G;AAC5G,0DAA6C;AAC7C,kEAA+D;AAE/D,MAAa,oCAAqC,SAAQ,oCAAkB;IAGxE;QACI,KAAK,EAAE,CAAC;QAIF,qBAAgB,GAAG,CAAO,OAAY,EAAgB,EAAE;YAC9D,wGAAwG;YACxG,sGAAsG;YACtG,gBAAgB;YAChB,MAAM,YAAY,GAAG,mBAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE;gBACpF,QAAQ,EAAE,eAAe;aAC5B,CAAC,CAAC;YACH,MAAM,UAAU,GAAG,YAAY,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;YAE3D,MAAM,GAAG,GAAG;gBACR,aAAa,EAAE,IAAI;gBACnB,YAAY,EAAE,IAAI;gBAClB,aAAa,EAAE,YAAY,CAAC,WAAW,EAAE;gBACzC,WAAW,EAAE,UAAU,CAAC,WAAW,EAAE;gBACrC,KAAK,EAAE,OAAO,CAAC,MAAM;aACxB,CAAC;YAEF,OAAO,GAAG,CAAC;QACf,CAAC,CAAA,CAAC;QArBE,IAAI,CAAC,IAAI,GAAG,uBAAe,CAAC,UAAU,CAAC,IAAI,GAAG,cAAc,CAAC;IACjE,CAAC;CAqBJ;AA3BD,oFA2BC"}
|
|
@@ -70,8 +70,6 @@ class BicycleCountersRouter extends BaseRouter_1.BaseRouter {
|
|
|
70
70
|
}
|
|
71
71
|
else {
|
|
72
72
|
element.measurement_count = 1;
|
|
73
|
-
element.measured_from = new Date(parseInt(element.measured_from, 10)).toISOString();
|
|
74
|
-
element.measured_to = new Date(parseInt(element.measured_to, 10)).toISOString();
|
|
75
73
|
}
|
|
76
74
|
});
|
|
77
75
|
res.status(200).send(data);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BicycleCountersRouter.js","sourceRoot":"","sources":["../../src/output-gateway/BicycleCountersRouter.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,+DAI+C;AAC/C,mEAA6E;AAC7E,oFAAiF;AACjF,6EAAkH;AAClH,+DAA4F;AAC5F,mFAAoE;AAEpE,qCAA8E;AAK9E,MAAa,qBAAsB,SAAQ,uBAAU;IAQjD;QACI,KAAK,EAAE,CAAC;QARZ,iDAAiD;QAC1C,WAAM,GAAW,IAAA,gBAAM,GAAE,CAAC;QAc1B,WAAM,GAAG,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CAAC,MAAM,CACd,CAAC;QACN,CAAC,CAAC;QA3IE,IAAI,CAAC,6BAA6B,GAAG,eAAM,CAAC,6BAA6B,CAAC;QAC1E,IAAI,CAAC,8BAA8B,GAAG,eAAM,CAAC,8BAA8B,CAAC;QAC5E,IAAI,CAAC,gCAAgC,GAAG,eAAM,CAAC,gCAAgC,CAAC;QAChF,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;CAwIJ;AAtJD,sDAsJC;AAED,MAAM,qBAAqB,GAAW,IAAI,qBAAqB,EAAE,CAAC,MAAM,CAAC;AAEhE,sDAAqB"}
|
|
@@ -203,9 +203,9 @@ const outputDetectionsSDMA = {
|
|
|
203
203
|
measured_from: {
|
|
204
204
|
// id
|
|
205
205
|
primaryKey: true,
|
|
206
|
-
type: sequelize_1.default.
|
|
206
|
+
type: sequelize_1.default.DATE,
|
|
207
207
|
},
|
|
208
|
-
measured_to: sequelize_1.default.
|
|
208
|
+
measured_to: sequelize_1.default.DATE,
|
|
209
209
|
value: sequelize_1.default.INTEGER,
|
|
210
210
|
// Audit database fields
|
|
211
211
|
create_batch_id: { type: sequelize_1.default.BIGINT },
|
|
@@ -223,8 +223,8 @@ const outputDetectionsJsonSchema = {
|
|
|
223
223
|
properties: {
|
|
224
224
|
directions_id: { type: "string" },
|
|
225
225
|
locations_id: { type: "string" },
|
|
226
|
-
measured_from: { type: "
|
|
227
|
-
measured_to: { type: "
|
|
226
|
+
measured_from: { type: "string" },
|
|
227
|
+
measured_to: { type: "string" },
|
|
228
228
|
value: { type: ["number", "null"] },
|
|
229
229
|
},
|
|
230
230
|
required: ["directions_id", "locations_id", "measured_from", "measured_to"],
|
|
@@ -240,9 +240,9 @@ const outputTemperaturesSDMA = {
|
|
|
240
240
|
measured_from: {
|
|
241
241
|
// id
|
|
242
242
|
primaryKey: true,
|
|
243
|
-
type: sequelize_1.default.
|
|
243
|
+
type: sequelize_1.default.DATE,
|
|
244
244
|
},
|
|
245
|
-
measured_to: sequelize_1.default.
|
|
245
|
+
measured_to: sequelize_1.default.DATE,
|
|
246
246
|
value: sequelize_1.default.INTEGER,
|
|
247
247
|
// Audit database fields
|
|
248
248
|
create_batch_id: { type: sequelize_1.default.BIGINT },
|
|
@@ -259,8 +259,8 @@ const outputTemperaturesJsonSchema = {
|
|
|
259
259
|
type: "object",
|
|
260
260
|
properties: {
|
|
261
261
|
locations_id: { type: "string" },
|
|
262
|
-
measured_from: { type: "
|
|
263
|
-
measured_to: { type: "
|
|
262
|
+
measured_from: { type: "string" },
|
|
263
|
+
measured_to: { type: "string" },
|
|
264
264
|
value: { type: ["number", "null"] },
|
|
265
265
|
},
|
|
266
266
|
required: ["locations_id", "measured_from", "measured_to", "value"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema-definitions/index.ts"],"names":[],"mappings":";;;;;;AAAA,oFAA4D;AAE5D,kDAAkD;AAClD,yCAAyC;AAEzC,MAAM,yBAAyB,GAAG;IAC9B,IAAI,EAAE,OAAO;IACb,KAAK,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACR,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC/B,UAAU,EAAE;gBACR,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACR,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBACtB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;qBAC3B;oBACD,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;iBAC3B;aACJ;YACD,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACvB,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACvB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC5B;Q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2BAA2B;QACjC,sBAAsB,EAAE,0BAA0B;QAClD,yBAAyB,EAAE,oBAAoB;QAC/C,WAAW,EAAE,4BAA4B;KAC5C;IACD,UAAU,EAAE;QACR,IAAI,EAAE,2BAA2B;QACjC,sBAAsB,EAAE,0BAA0B;QAClD,yBAAyB,EAAE,oBAAoB;QAC/C,WAAW,EAAE,4BAA4B;KAC5C;IAED,SAAS,EAAE;QACP,IAAI,EAAE,0BAA0B;QAChC,sBAAsB,EAAE,yBAAyB;QACjD,yBAAyB,EAAE,mBAAmB;QAC9C,WAAW,EAAE,2BAA2B;KAC3C;IACD,YAAY,EAAE;QACV,IAAI,EAAE,6BAA6B;QACnC,sBAAsB,EAAE,4BAA4B;QACpD,yBAAyB,EAAE,sBAAsB;QACjD,WAAW,EAAE,8BAA8B;KAC9C;CACJ,CAAC;AAEoB,oCAAe"}
|
package/package.json
CHANGED
package/db/example/sql_dump.sql
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
-- EXAMPLE DATA - for testing purposes
|
|
2
|
-
|
|
3
|
-
INSERT INTO "bicyclecounters_locations" ("id", "vendor_id", "lat", "lng", "name", "route", "create_batch_id", "created_at", "created_by", "update_batch_id", "updated_at", "updated_by") VALUES
|
|
4
|
-
('camea-BC_VK-HRUP', 'BC_VK-HRUP', 50.089491724101, 14.460735619068, 'Drážní stezka - Vítkov', 'A 25', NULL, '2020-01-17 12:25:08.322+00', NULL, NULL, '2020-03-22 14:50:01.167+00', NULL),
|
|
5
|
-
('camea-BC_VS-CE', 'BC_VS-CE', 50.0704264, 14.3857008, 'Košíře', 'A 14', NULL, '2020-01-17 12:25:08.322+00', NULL, NULL, '2020-03-22 14:50:01.167+00', NULL),
|
|
6
|
-
('camea-BC_ZA-KLBO', 'BC_ZA-KLBO', 50.1433144, 14.3993322, 'V Zámcích', 'A2', NULL, '2020-01-17 12:25:08.322+00', NULL, NULL, '2020-03-22 14:50:01.167+00', NULL);
|
|
7
|
-
|
|
8
|
-
INSERT INTO "bicyclecounters_directions" ("id", "vendor_id", "locations_id", "name", "create_batch_id", "created_at", "created_by", "update_batch_id", "updated_at", "updated_by") VALUES
|
|
9
|
-
('camea-BC_VK-HR', 'BC_VK-HR', 'camea-BC_VK-HRUP', 'Hrdlořezy', NULL, '2020-01-17 12:25:09.767+00', NULL, NULL, '2020-03-22 14:50:01.398+00', NULL),
|
|
10
|
-
('camea-BC_VK-UP', 'BC_VK-UP', 'camea-BC_VK-HRUP', 'U památníku', NULL, '2020-01-17 12:25:09.767+00', NULL, NULL, '2020-03-22 14:50:01.398+00', NULL),
|
|
11
|
-
('camea-BC_VS-CE', 'BC_VS-CE', 'camea-BC_VS-CE', 'centrum', NULL, '2020-01-17 12:25:09.767+00', NULL, NULL, '2020-03-22 14:50:01.399+00', NULL),
|
|
12
|
-
('camea-BC_ZA-KL', 'BC_ZA-KL', 'camea-BC_ZA-KLBO', 'Klecany', NULL, '2020-01-17 12:25:09.767+00', NULL, NULL, '2020-03-22 14:50:01.399+00', NULL),
|
|
13
|
-
('camea-BC_ZA-BO', 'BC_ZA-BO', 'camea-BC_ZA-KLBO', 'Bohnice', NULL, '2020-01-17 12:25:09.767+00', NULL, NULL, '2020-03-22 14:50:01.399+00', NULL);
|
|
14
|
-
|
|
15
|
-
INSERT INTO "bicyclecounters_detections" ("locations_id", "directions_id", "measured_from", "measured_to", "value", "create_batch_id", "created_at", "created_by", "update_batch_id", "updated_at", "updated_by", "value_pedestrians") VALUES
|
|
16
|
-
('camea-BC_VK-HRUP', 'camea-BC_VK-HR', 1584183300000, 1584183600000, 4, -1, '2020-03-14 11:05:06.852411+00', 'integration-engine', -1, '2020-03-15 04:00:20.646195+00', 'integration-engine', 2),
|
|
17
|
-
('camea-BC_ZA-KLBO', 'camea-BC_ZA-KL', 1584183000000, 1584183300000, 3, -1, '2020-03-14 11:00:27.856626+00', 'integration-engine', -1, '2020-03-15 04:00:21.650912+00', 'integration-engine', 3),
|
|
18
|
-
('camea-BC_VK-HRUP', 'camea-BC_VK-UP', 1584183000000, 1584183300000, 4, -1, '2020-03-14 11:00:26.857761+00', 'integration-engine', -1, '2020-03-15 04:00:20.646195+00', 'integration-engine', 1),
|
|
19
|
-
('camea-BC_ZA-KLBO', 'camea-BC_ZA-BO', 1584182700000, 1584183000000, 5, -1, '2020-03-14 10:55:07.65846+00', 'integration-engine', -1, '2020-03-15 04:00:21.650912+00', 'integration-engine', NULL),
|
|
20
|
-
('camea-BC_ZA-KLBO', 'camea-BC_ZA-KL', 1584182700000, 1584183000000, 10, -1, '2020-03-14 10:55:07.65846+00', 'integration-engine', -1, '2020-03-15 04:00:21.650912+00', 'integration-engine', 2),
|
|
21
|
-
('camea-BC_ZA-KLBO', 'camea-BC_ZA-KL', 1584182400000, 1584182700000, 3, -1, '2020-03-14 10:50:07.448117+00', 'integration-engine', -1, '2020-03-15 04:00:21.650912+00', 'integration-engine', 1),
|
|
22
|
-
('camea-BC_ZA-KLBO', 'camea-BC_ZA-KL', 1584182100000, 1584182400000, 11, -1, '2020-03-14 10:45:07.338274+00', 'integration-engine', -1, '2020-03-15 04:00:21.650912+00', 'integration-engine', 2),
|
|
23
|
-
('camea-BC_ZA-KLBO', 'camea-BC_ZA-KL', 1584181800000, 1584182100000, 6, -1, '2020-03-14 10:40:06.557032+00', 'integration-engine', -1, '2020-03-15 04:00:21.650912+00', 'integration-engine', 7),
|
|
24
|
-
('camea-BC_VK-HRUP', 'camea-BC_VK-UP', 1584181800000, 1584182100000, 5, -1, '2020-03-14 10:40:05.777015+00', 'integration-engine', -1, '2020-03-15 04:00:20.646195+00', 'integration-engine', 8),
|
|
25
|
-
('camea-BC_ZA-KLBO', 'camea-BC_ZA-KL', 1584181200000, 1584181500000, 4, -1, '2020-03-14 10:30:08.810805+00', 'integration-engine', -1, '2020-03-15 04:00:21.650912+00', 'integration-engine', 1),
|
|
26
|
-
('camea-BC_VK-HRUP', 'camea-BC_VK-UP', 1584181200000, 1584181500000, 6, -1, '2020-03-14 10:30:07.938707+00', 'integration-engine', -1, '2020-03-15 04:00:20.646195+00', 'integration-engine', 0),
|
|
27
|
-
('camea-BC_ZA-KLBO', 'camea-BC_ZA-KL', 1584180900000, 1584181200000, 4, -1, '2020-03-14 10:25:06.850141+00', 'integration-engine', -1, '2020-03-15 04:00:21.650912+00', 'integration-engine', 2),
|
|
28
|
-
('camea-BC_ZA-KLBO', 'camea-BC_ZA-KL', 1584180600000, 1584180900000, 4, -1, '2020-03-14 10:20:06.842241+00', 'integration-engine', -1, '2020-03-15 04:00:21.650912+00', 'integration-engine', 1),
|
|
29
|
-
('camea-BC_ZA-KLBO', 'camea-BC_ZA-BO', 1584180300000, 1584180600000, 4, -1, '2020-03-14 10:15:07.775845+00', 'integration-engine', -1, '2020-03-15 04:00:21.650912+00', 'integration-engine', 1),
|
|
30
|
-
('camea-BC_ZA-KLBO', 'camea-BC_ZA-KL', 1584180300000, 1584180600000, 6, -1, '2020-03-14 10:15:07.775845+00', 'integration-engine', -1, '2020-03-15 04:00:21.650912+00', 'integration-engine', 4),
|
|
31
|
-
('camea-BC_ZA-KLBO', 'camea-BC_ZA-KL', 1584180000000, 1584180300000, 4, -1, '2020-03-14 10:10:07.418647+00', 'integration-engine', -1, '2020-03-15 04:00:21.650912+00', 'integration-engine', 1),
|
|
32
|
-
('camea-BC_VK-HRUP', 'camea-BC_VK-UP', 1584180000000, 1584180300000, 3, -1, '2020-03-14 10:10:06.659036+00', 'integration-engine', -1, '2020-03-15 04:00:20.646195+00', 'integration-engine', 7),
|
|
33
|
-
('camea-BC_ZA-KLBO', 'camea-BC_ZA-KL', 1584179700000, 1584180000000, 5, -1, '2020-03-14 10:05:07.293445+00', 'integration-engine', -1, '2020-03-15 04:00:21.650912+00', 'integration-engine', 2),
|
|
34
|
-
('camea-BC_ZA-KLBO', 'camea-BC_ZA-KL', 1584179400000, 1584179700000, 4, -1, '2020-03-14 10:00:09.034003+00', 'integration-engine', -1, '2020-03-15 04:00:21.650912+00', 'integration-engine', 2),
|
|
35
|
-
('camea-BC_ZA-KLBO', 'camea-BC_ZA-KL', 1584179100000, 1584179400000, 5, -1, '2020-03-14 09:55:06.595799+00', 'integration-engine', -1, '2020-03-15 04:00:21.650912+00', 'integration-engine', 1),
|
|
36
|
-
('camea-BC_ZA-KLBO', 'camea-BC_ZA-KL', 1584178800000, 1584179100000, 6, -1, '2020-03-14 09:50:08.878222+00', 'integration-engine', -1, '2020-03-15 04:00:21.650912+00', 'integration-engine', 0),
|
|
37
|
-
('camea-BC_VK-HRUP', 'camea-BC_VK-HR', 1584178800000, 1584179100000, 3, -1, '2020-03-14 09:50:08.235704+00', 'integration-engine', -1, '2020-03-15 04:00:20.646195+00', 'integration-engine', 2),
|
|
38
|
-
('camea-BC_VK-HRUP', 'camea-BC_VK-UP', 1584178800000, 1584179100000, 3, -1, '2020-03-14 09:50:08.235704+00', 'integration-engine', -1, '2020-03-15 04:00:20.646195+00', 'integration-engine', 0),
|
|
39
|
-
('camea-BC_ZA-KLBO', 'camea-BC_ZA-KL', 1584178500000, 1584178800000, 3, -1, '2020-03-14 09:45:07.985855+00', 'integration-engine', -1, '2020-03-15 04:00:21.650912+00', 'integration-engine', 1),
|
|
40
|
-
('camea-BC_ZA-KLBO', 'camea-BC_ZA-BO', 1584178500000, 1584178800000, 4, -1, '2020-03-14 09:45:07.985855+00', 'integration-engine', -1, '2020-03-15 04:00:21.650912+00', 'integration-engine', NULL),
|
|
41
|
-
('camea-BC_VK-HRUP', 'camea-BC_VK-UP', 1584178500000, 1584178800000, 3, -1, '2020-03-14 09:45:06.935666+00', 'integration-engine', -1, '2020-03-15 04:00:20.646195+00', 'integration-engine', 1),
|
|
42
|
-
('camea-BC_ZA-KLBO', 'camea-BC_ZA-KL', 1584178200000, 1584178500000, 4, -1, '2020-03-14 09:40:07.268232+00', 'integration-engine', -1, '2020-03-15 04:00:21.650912+00', 'integration-engine', 2),
|
|
43
|
-
('camea-BC_ZA-KLBO', 'camea-BC_ZA-KL', 1584177900000, 1584178200000, 3, -1, '2020-03-14 09:35:07.008885+00', 'integration-engine', -1, '2020-03-15 04:00:21.650912+00', 'integration-engine', 0),
|
|
44
|
-
('camea-BC_VK-HRUP', 'camea-BC_VK-HR', 1584177900000, 1584178200000, 3, -1, '2020-03-14 09:35:06.531007+00', 'integration-engine', -1, '2020-03-15 04:00:20.646195+00', 'integration-engine', 3);
|
|
45
|
-
|
|
46
|
-
INSERT INTO "bicyclecounters_temperatures" ("locations_id", "measured_from", "measured_to", "value", "create_batch_id", "created_at", "created_by", "update_batch_id", "updated_at", "updated_by") VALUES
|
|
47
|
-
('camea-BC_VK-HRUP', 1584177600000, 1584177900000, 10, -1, '2020-03-14 09:30:09.629185+00', 'integration-engine', -1, '2020-03-15 04:00:20.835272+00', 'integration-engine'),
|
|
48
|
-
('camea-BC_VK-HRUP', 1584177900000, 1584178200000, 10, -1, '2020-03-14 09:35:06.555745+00', 'integration-engine', -1, '2020-03-15 04:00:20.835272+00', 'integration-engine'),
|
|
49
|
-
('camea-BC_VK-HRUP', 1584178200000, 1584178500000, 10, -1, '2020-03-14 09:40:06.616807+00', 'integration-engine', -1, '2020-03-15 04:00:20.835272+00', 'integration-engine'),
|
|
50
|
-
('camea-BC_VK-HRUP', 1584178500000, 1584178800000, 10, -1, '2020-03-14 09:45:06.961899+00', 'integration-engine', -1, '2020-03-15 04:00:20.835272+00', 'integration-engine'),
|
|
51
|
-
('camea-BC_VK-HRUP', 1584178800000, 1584179100000, 10, -1, '2020-03-14 09:50:08.255987+00', 'integration-engine', -1, '2020-03-15 04:00:20.835272+00', 'integration-engine'),
|
|
52
|
-
('camea-BC_VK-HRUP', 1584179100000, 1584179400000, 10, -1, '2020-03-14 09:55:06.0094+00', 'integration-engine', -1, '2020-03-15 04:00:20.835272+00', 'integration-engine'),
|
|
53
|
-
('camea-BC_VK-HRUP', 1584179400000, 1584179700000, 10, -1, '2020-03-14 10:00:08.42887+00', 'integration-engine', -1, '2020-03-15 04:00:20.835272+00', 'integration-engine'),
|
|
54
|
-
('camea-BC_VK-HRUP', 1584179700000, 1584180000000, 10, -1, '2020-03-14 10:05:06.687607+00', 'integration-engine', -1, '2020-03-15 04:00:20.835272+00', 'integration-engine'),
|
|
55
|
-
('camea-BC_VK-HRUP', 1584180000000, 1584180300000, 10, -1, '2020-03-14 10:10:06.682393+00', 'integration-engine', -1, '2020-03-15 04:00:20.835272+00', 'integration-engine'),
|
|
56
|
-
('camea-BC_VK-HRUP', 1584180300000, 1584180600000, 11, -1, '2020-03-14 10:15:07.093541+00', 'integration-engine', -1, '2020-03-15 04:00:20.835272+00', 'integration-engine'),
|
|
57
|
-
('camea-BC_VK-HRUP', 1584180600000, 1584180900000, 11, -1, '2020-03-14 10:20:06.062893+00', 'integration-engine', -1, '2020-03-15 04:00:20.835272+00', 'integration-engine'),
|
|
58
|
-
('camea-BC_VK-HRUP', 1584180900000, 1584181200000, 11, -1, '2020-03-14 10:25:06.149189+00', 'integration-engine', -1, '2020-03-15 04:00:20.835272+00', 'integration-engine'),
|
|
59
|
-
('camea-BC_VK-HRUP', 1584181200000, 1584181500000, 10, -1, '2020-03-14 10:30:07.980846+00', 'integration-engine', -1, '2020-03-15 04:00:20.835272+00', 'integration-engine'),
|
|
60
|
-
('camea-BC_VK-HRUP', 1584181500000, 1584181800000, 10, -1, '2020-03-14 10:35:07.920386+00', 'integration-engine', -1, '2020-03-15 04:00:20.835272+00', 'integration-engine'),
|
|
61
|
-
('camea-BC_VK-HRUP', 1584181800000, 1584182100000, 10, -1, '2020-03-14 10:40:05.805547+00', 'integration-engine', -1, '2020-03-15 04:00:20.835272+00', 'integration-engine'),
|
|
62
|
-
('camea-BC_VK-HRUP', 1584182100000, 1584182400000, 10, -1, '2020-03-14 10:45:06.742474+00', 'integration-engine', -1, '2020-03-15 04:00:20.835272+00', 'integration-engine'),
|
|
63
|
-
('camea-BC_VK-HRUP', 1584182400000, 1584182700000, 10, -1, '2020-03-14 10:50:06.341474+00', 'integration-engine', -1, '2020-03-15 04:00:20.835272+00', 'integration-engine'),
|
|
64
|
-
('camea-BC_VK-HRUP', 1584182700000, 1584183000000, 11, -1, '2020-03-14 10:55:06.858758+00', 'integration-engine', -1, '2020-03-15 04:00:20.835272+00', 'integration-engine'),
|
|
65
|
-
('camea-BC_VK-HRUP', 1584183000000, 1584183300000, 10, -1, '2020-03-14 11:00:26.877299+00', 'integration-engine', -1, '2020-03-15 04:00:20.835272+00', 'integration-engine'),
|
|
66
|
-
('camea-BC_VK-HRUP', 1584183300000, 1584183600000, 11, -1, '2020-03-14 11:05:06.872869+00', 'integration-engine', -1, '2020-03-15 04:00:20.835272+00', 'integration-engine'),
|
|
67
|
-
('camea-BC_ZA-KLBO', 1584178200000, 1584178500000, 10, -1, '2020-03-14 09:40:07.290585+00', 'integration-engine', -1, '2020-03-15 04:00:21.740315+00', 'integration-engine'),
|
|
68
|
-
('camea-BC_ZA-KLBO', 1584178500000, 1584178800000, 10, -1, '2020-03-14 09:45:08.015288+00', 'integration-engine', -1, '2020-03-15 04:00:21.740315+00', 'integration-engine'),
|
|
69
|
-
('camea-BC_ZA-KLBO', 1584179400000, 1584179700000, 10, -1, '2020-03-14 10:00:09.070265+00', 'integration-engine', -1, '2020-03-15 04:00:21.740315+00', 'integration-engine'),
|
|
70
|
-
('camea-BC_ZA-KLBO', 1584179700000, 1584180000000, 10, -1, '2020-03-14 10:05:07.319131+00', 'integration-engine', -1, '2020-03-15 04:00:21.740315+00', 'integration-engine'),
|
|
71
|
-
('camea-BC_ZA-KLBO', 1584180000000, 1584180300000, 10, -1, '2020-03-14 10:10:07.440586+00', 'integration-engine', -1, '2020-03-15 04:00:21.740315+00', 'integration-engine'),
|
|
72
|
-
('camea-BC_ZA-KLBO', 1584180300000, 1584180600000, 10, -1, '2020-03-14 10:15:07.797602+00', 'integration-engine', -1, '2020-03-15 04:00:21.740315+00', 'integration-engine'),
|
|
73
|
-
('camea-BC_ZA-KLBO', 1584180600000, 1584180900000, 10, -1, '2020-03-14 10:20:06.882923+00', 'integration-engine', -1, '2020-03-15 04:00:21.740315+00', 'integration-engine'),
|
|
74
|
-
('camea-BC_ZA-KLBO', 1584180900000, 1584181200000, 10, -1, '2020-03-14 10:25:07.099943+00', 'integration-engine', -1, '2020-03-15 04:00:21.740315+00', 'integration-engine'),
|
|
75
|
-
('camea-BC_ZA-KLBO', 1584181200000, 1584181500000, 11, -1, '2020-03-14 10:30:08.835391+00', 'integration-engine', -1, '2020-03-15 04:00:21.740315+00', 'integration-engine'),
|
|
76
|
-
('camea-BC_ZA-KLBO', 1584181500000, 1584181800000, 11, -1, '2020-03-14 10:35:08.573236+00', 'integration-engine', -1, '2020-03-15 04:00:21.740315+00', 'integration-engine'),
|
|
77
|
-
('camea-BC_ZA-KLBO', 1584181800000, 1584182100000, 11, -1, '2020-03-14 10:40:06.581227+00', 'integration-engine', -1, '2020-03-15 04:00:21.740315+00', 'integration-engine'),
|
|
78
|
-
('camea-BC_ZA-KLBO', 1584182100000, 1584182400000, 11, -1, '2020-03-14 10:45:07.361461+00', 'integration-engine', -1, '2020-03-15 04:00:21.740315+00', 'integration-engine'),
|
|
79
|
-
('camea-BC_ZA-KLBO', 1584182400000, 1584182700000, 11, -1, '2020-03-14 10:50:07.481585+00', 'integration-engine', -1, '2020-03-15 04:00:21.740315+00', 'integration-engine'),
|
|
80
|
-
('camea-BC_ZA-KLBO', 1584182700000, 1584183000000, 10, -1, '2020-03-14 10:55:07.679932+00', 'integration-engine', -1, '2020-03-15 04:00:21.740315+00', 'integration-engine'),
|
|
81
|
-
('camea-BC_ZA-KLBO', 1584183000000, 1584183300000, 11, -1, '2020-03-14 11:00:27.87918+00', 'integration-engine', -1, '2020-03-15 04:00:21.740315+00', 'integration-engine'),
|
|
82
|
-
('camea-BC_ZA-KLBO', 1584183300000, 1584183600000, 11, -1, '2020-03-14 11:05:07.83522+00', 'integration-engine', -1, '2020-03-15 04:00:21.740315+00', 'integration-engine');
|
|
File without changes
|