-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhugo.sql
59 lines (52 loc) · 2.04 KB
/
hugo.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
BEGIN;
select lw_initialise('hugo',3448);
select lw_addedgeparticipant('hugo','{
"schemaname":"hugo_",
"tablename": "ugprimaryline",
"primarykey":"objectid",
"geomcolumn": "wkb_geometry",
"labelcolumn": "hugo_id",
"phasecolumn": "phasingcode",
"phasemap":{"ABC":"7","AB":"6","AC":"5","BC":"3","A":"4","B":"2","C":"1"}
}') ;
select lw_addedgeparticipant('hugo','{
"schemaname":"hugo_",
"tablename": "ohprimaryline",
"primarykey":"objectid",
"geomcolumn": "wkb_geometry",
"labelcolumn": "hugo_id",
"phasecolumn": "phasingcode",
"phasemap":{"ABC":"7","AB":"6","AC":"5","BC":"3","A":"4","B":"2","C":"1"}
}') ;
select lw_addnodeparticipant('hugo', $${
"schemaname":"hugo_",
"tablename": "switchdevicebank",
"primarykey":"facilityid",
"geomcolumn": "wkb_geometry",
"sourcequery": "\"devicetype\" = 'FDR'",
"blockquery": "0 =ANY (array[\"enabled\",\"normalposa\",\"normalposb\",\"normalposc\"])",
"phasecolumn": "phasingcode",
"phasemap":{"ABC":"7","AB":"6","AC":"5","BC":"3","A":"4","B":"2","C":"1"}
}$$);
select lw_addnodeparticipant('hugo', $${
"schemaname":"hugo_",
"tablename": "overcurrentdevicebank",
"primarykey":"facilityid",
"geomcolumn": "wkb_geometry",
"sourcequery": "\"devicetype\" = 'FDR'",
"blockquery": "0 =ANY (array[\"enabled\",\"normalposa\",\"normalposb\",\"normalposc\"])",
"phasecolumn": "phasingcode",
"phasemap":{"ABC":"7","AB":"6","AC":"5","BC":"3","A":"4","B":"2","C":"1"}
}$$);
select lw_addnodeparticipant('hugo', $${
"schemaname":"hugo_",
"tablename": "transformerbank",
"primarykey":"facilityid",
"geomcolumn": "wkb_geometry",
"sourcequery": "1 = 2",
"blockquery": "\"enabled\" = 0",
"phasecolumn": "phasingcode",
"phasemap":{"ABC":"7","AB":"6","AC":"5","BC":"3","A":"4","B":"2","C":"1"}
}$$);
select lw_generate('hugo');
commit;