1 | -- DATABASE STRUCTURE -- |
---|
2 | -- dmn_attribut_value -- |
---|
3 | CREATE TABLE `dmn_attribut_value` ( |
---|
4 | `ATTRIBUT_ID` int(11) NOT NULL, |
---|
5 | `CATALOG_ID` int(11) NOT NULL, |
---|
6 | PRIMARY KEY (`ATTRIBUT_ID`,`CATALOG_ID`) |
---|
7 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
8 | |
---|
9 | -- dmn_catalog -- |
---|
10 | CREATE TABLE `dmn_catalog` ( |
---|
11 | `CATALOG_ID` int(11) NOT NULL AUTO_INCREMENT, |
---|
12 | `CODE` varchar(50) DEFAULT NULL, |
---|
13 | `DESCRIPTION_0` varchar(255) DEFAULT NULL, |
---|
14 | `DESCRIPTION_1` varchar(255) DEFAULT NULL, |
---|
15 | `DESCRIPTION_2` varchar(255) DEFAULT NULL, |
---|
16 | `DESCRIPTION_3` varchar(255) DEFAULT NULL, |
---|
17 | `DESCRIPTION_4` varchar(255) DEFAULT NULL, |
---|
18 | PRIMARY KEY (`CATALOG_ID`) |
---|
19 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
20 | |
---|
21 | -- dmn_layer_attribut -- |
---|
22 | CREATE TABLE `dmn_layer_attribut` ( |
---|
23 | `ATTRIBUT_ID` int(11) NOT NULL AUTO_INCREMENT, |
---|
24 | `LAYER_INDEX` int(11) NOT NULL, |
---|
25 | `ATTRIBUT_NAME` varchar(100) DEFAULT NULL, |
---|
26 | PRIMARY KEY (`ATTRIBUT_ID`,`LAYER_INDEX`) |
---|
27 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
28 | |
---|
29 | -- dmn_layer_object -- |
---|
30 | CREATE TABLE `dmn_layer_object` ( |
---|
31 | `OBJECT_ID` bigint(20) NOT NULL AUTO_INCREMENT, |
---|
32 | `OBJECT_CD` varchar(50) NULL COMMENT 'Feature code', |
---|
33 | `OBJECT_TYPE_CD` int(10) unsigned NOT NULL COMMENT 'Spatial object code', |
---|
34 | `THEMATIC_LAYERS_LAYER_INDEX` int(10) unsigned NOT NULL COMMENT 'Associated thematic layer', |
---|
35 | `OBJECT_DESC_0` varchar(255) NOT NULL COMMENT 'Feature description', |
---|
36 | `OBJECT_DESC_1` varchar(255) DEFAULT NULL, |
---|
37 | `OBJECT_DESC_2` varchar(255) DEFAULT NULL, |
---|
38 | `OBJECT_DESC_3` varchar(255) DEFAULT NULL, |
---|
39 | `OBJECT_DESC_4` varchar(255) DEFAULT NULL, |
---|
40 | `OBJECT_ISFREQ` tinyint(1) NOT NULL DEFAULT '0', |
---|
41 | `SYMBOL_CD` varchar(20) DEFAULT NULL COMMENT 'Feature symbology', |
---|
42 | `RANK` int(11) DEFAULT NULL, |
---|
43 | `REMARK` varchar(100) DEFAULT NULL, |
---|
44 | PRIMARY KEY (`OBJECT_ID`), |
---|
45 | KEY `DMN_LAYER_OBJECT_FKIndex2` (`THEMATIC_LAYERS_LAYER_INDEX`,`OBJECT_ID`) |
---|
46 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
47 | |
---|
48 | -- dmn_layer_type -- |
---|
49 | CREATE TABLE `dmn_layer_type` ( |
---|
50 | `TYPE_CD` int(10) unsigned NOT NULL COMMENT 'Layer type code', |
---|
51 | `TYPE_DESCRIPTION` varchar(20) NOT NULL COMMENT 'Layer type description', |
---|
52 | PRIMARY KEY (`TYPE_CD`) |
---|
53 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
54 | |
---|
55 | |
---|
56 | INSERT INTO dmn_layer_type VALUES(0,"Line"); |
---|
57 | INSERT INTO dmn_layer_type VALUES(1,"Point"); |
---|
58 | INSERT INTO dmn_layer_type VALUES(2,"Polygon"); |
---|
59 | |
---|
60 | |
---|
61 | -- dmn_shortcut_key -- |
---|
62 | CREATE TABLE `dmn_shortcut_key` ( |
---|
63 | `SHORTCUT_CD` int(10) unsigned NOT NULL AUTO_INCREMENT, |
---|
64 | `SHORTCUT_KEY` varchar(20) NOT NULL, |
---|
65 | `SHORTCUT_DESC` varchar(255) DEFAULT NULL, |
---|
66 | PRIMARY KEY (`SHORTCUT_CD`) |
---|
67 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
68 | |
---|
69 | INSERT INTO dmn_shortcut_key VALUES(1,"F1",""); |
---|
70 | INSERT INTO dmn_shortcut_key VALUES(2,"F2",""); |
---|
71 | INSERT INTO dmn_shortcut_key VALUES(3,"F3",""); |
---|
72 | INSERT INTO dmn_shortcut_key VALUES(4,"F4",""); |
---|
73 | INSERT INTO dmn_shortcut_key VALUES(5,"F5",""); |
---|
74 | INSERT INTO dmn_shortcut_key VALUES(6,"F6",""); |
---|
75 | INSERT INTO dmn_shortcut_key VALUES(7,"F7",""); |
---|
76 | INSERT INTO dmn_shortcut_key VALUES(8,"F8",""); |
---|
77 | INSERT INTO dmn_shortcut_key VALUES(9,"F9",""); |
---|
78 | INSERT INTO dmn_shortcut_key VALUES(10,"F10",""); |
---|
79 | INSERT INTO dmn_shortcut_key VALUES(11,"F11",""); |
---|
80 | INSERT INTO dmn_shortcut_key VALUES(12,"F12",""); |
---|
81 | |
---|
82 | |
---|
83 | -- export_poly -- |
---|
84 | CREATE TABLE `export_poly` ( |
---|
85 | `LAYER_INDEX` int(11) NOT NULL, |
---|
86 | `RASTER_FACTOR` double DEFAULT NULL, |
---|
87 | `NB_EXPORT` int(11) DEFAULT NULL, |
---|
88 | `PERCENT_SKIPPED` double DEFAULT NULL, |
---|
89 | PRIMARY KEY (`LAYER_INDEX`) |
---|
90 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
91 | |
---|
92 | -- generic_aat -- |
---|
93 | CREATE TABLE `generic_aat` ( |
---|
94 | `OBJECT_VAL_ID` int(10) unsigned NOT NULL, |
---|
95 | `OBJECT_GEOM_ID` int(10) unsigned NOT NULL, |
---|
96 | PRIMARY KEY (`OBJECT_VAL_ID`,`OBJECT_GEOM_ID`), |
---|
97 | KEY `GENERIC_LINES_has_DMN_LAYER_OBJECT_FKIndex1` (`OBJECT_VAL_ID`), |
---|
98 | KEY `GENERIC_LINES_has_DMN_LAYER_OBJECT_FKIndex2` (`OBJECT_GEOM_ID`) |
---|
99 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
100 | |
---|
101 | -- generic_dmn -- |
---|
102 | CREATE TABLE `generic_dmn` ( |
---|
103 | `CODE` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Code value', |
---|
104 | `DESCRIPTION` varchar(255) DEFAULT NULL COMMENT 'Code description', |
---|
105 | PRIMARY KEY (`CODE`) |
---|
106 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
107 | |
---|
108 | -- generic_frame -- |
---|
109 | CREATE TABLE `generic_frame` ( |
---|
110 | `OBJECT_ID` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Feature identifier', |
---|
111 | `OBJECT_GEOMETRY` linestring NOT NULL COMMENT 'Feature geometry', |
---|
112 | PRIMARY KEY (`OBJECT_ID`) |
---|
113 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
114 | |
---|
115 | -- generic_labels -- |
---|
116 | CREATE TABLE `generic_labels` ( |
---|
117 | `OBJECT_ID` int(10) unsigned NOT NULL AUTO_INCREMENT, |
---|
118 | `OBJECT_GEOMETRY` multipoint NOT NULL, |
---|
119 | PRIMARY KEY (`OBJECT_ID`) |
---|
120 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
121 | |
---|
122 | -- generic_lat -- |
---|
123 | CREATE TABLE `generic_lat` ( |
---|
124 | `OBJECT_VAL_ID` int(10) unsigned NOT NULL, |
---|
125 | `OBJECT_GEOM_ID` int(10) unsigned NOT NULL, |
---|
126 | PRIMARY KEY (`OBJECT_VAL_ID`,`OBJECT_GEOM_ID`), |
---|
127 | KEY `GENERIC_LABELS_has_DMN_LAYER_OBJECT_FKIndex1` (`OBJECT_VAL_ID`), |
---|
128 | KEY `GENERIC_LABELS_has_DMN_LAYER_OBJECT_FKIndex2` (`OBJECT_GEOM_ID`) |
---|
129 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
130 | |
---|
131 | -- generic_lines -- |
---|
132 | CREATE TABLE `generic_lines` ( |
---|
133 | `OBJECT_ID` int(10) unsigned NOT NULL AUTO_INCREMENT, |
---|
134 | `OBJECT_GEOMETRY` linestring NOT NULL, |
---|
135 | PRIMARY KEY (`OBJECT_ID`) |
---|
136 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
137 | |
---|
138 | -- generic_notes -- |
---|
139 | CREATE TABLE `generic_notes` ( |
---|
140 | `OBJECT_ID` int(10) unsigned NOT NULL AUTO_INCREMENT, |
---|
141 | `OBJECT_GEOMETRY` multipoint NOT NULL, |
---|
142 | `PRIORITY_CD` tinyint(4) DEFAULT '0', |
---|
143 | `CODE_CD` tinyint(4) DEFAULT '0', |
---|
144 | `AUTHOR` varchar(255) DEFAULT NULL, |
---|
145 | `NOTE_DATE` timestamp NULL DEFAULT CURRENT_TIMESTAMP, |
---|
146 | `DESCRIPTION` text, |
---|
147 | `ISFIXED` tinyint(1) DEFAULT '0', |
---|
148 | PRIMARY KEY (`OBJECT_ID`) |
---|
149 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
150 | |
---|
151 | -- generic_pat -- |
---|
152 | CREATE TABLE `generic_pat` ( |
---|
153 | `OBJECT_VAL_ID` int(10) unsigned NOT NULL, |
---|
154 | `OBJECT_GEOM_ID` int(10) unsigned NOT NULL, |
---|
155 | PRIMARY KEY (`OBJECT_VAL_ID`,`OBJECT_GEOM_ID`), |
---|
156 | KEY `GENERIC_POINTS_has_DMN_LAYER_OBJECT_FKIndex1` (`OBJECT_VAL_ID`), |
---|
157 | KEY `GENERIC_POINTS_has_DMN_LAYER_OBJECT_FKIndex2` (`OBJECT_GEOM_ID`) |
---|
158 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
159 | |
---|
160 | -- generic_points -- |
---|
161 | CREATE TABLE `generic_points` ( |
---|
162 | `OBJECT_ID` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Feature identifier', |
---|
163 | `OBJECT_GEOMETRY` multipoint NOT NULL COMMENT 'Feature geometry', |
---|
164 | PRIMARY KEY (`OBJECT_ID`) |
---|
165 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
166 | |
---|
167 | -- lang_def -- |
---|
168 | CREATE TABLE `lang_def` ( |
---|
169 | `LANG_ID` int(11) NOT NULL, |
---|
170 | `LANG_NAME` varchar(50) DEFAULT NULL, |
---|
171 | PRIMARY KEY (`LANG_ID`) |
---|
172 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
173 | |
---|
174 | |
---|
175 | INSERT INTO lang_def VALUES(0,"Undefined"); |
---|
176 | INSERT INTO lang_def VALUES(1,"Undefined"); |
---|
177 | INSERT INTO lang_def VALUES(2,"Undefined"); |
---|
178 | INSERT INTO lang_def VALUES(3,"Undefined"); |
---|
179 | INSERT INTO lang_def VALUES(4,"Undefined"); |
---|
180 | |
---|
181 | |
---|
182 | -- prj_queries -- |
---|
183 | CREATE TABLE `prj_queries` ( |
---|
184 | `QUERIES_ID` int(11) NOT NULL AUTO_INCREMENT, |
---|
185 | `QUERIES_TARGET` int(11) NOT NULL, |
---|
186 | `QUERIES_NAME` varchar(255) NOT NULL, |
---|
187 | `QUERIES_CODE` varchar(1000) DEFAULT NULL, |
---|
188 | PRIMARY KEY (`QUERIES_ID`) |
---|
189 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
190 | |
---|
191 | INSERT INTO prj_queries VALUES(1,0,"Lines without attribution","SELECT o.OBJECT_ID FROM generic_lines AS o WHERE o.OBJECT_ID NOT IN (SELECT a.OBJECT_GEOM_ID FROM generic_aat AS a)"); |
---|
192 | INSERT INTO prj_queries VALUES(2,1,"Points without attribution","SELECT o.OBJECT_ID FROM generic_points AS o WHERE o.OBJECT_ID NOT IN (SELECT a.OBJECT_GEOM_ID FROM generic_pat AS a)"); |
---|
193 | INSERT INTO prj_queries VALUES(3,2,"Labels without attribution","SELECT o.OBJECT_ID FROM generic_labels AS o WHERE o.OBJECT_ID NOT IN (SELECT a.OBJECT_GEOM_ID FROM generic_lat AS a)"); |
---|
194 | |
---|
195 | |
---|
196 | -- prj_settings -- |
---|
197 | CREATE TABLE `prj_settings` ( |
---|
198 | `SETTING_DBK` int(11) NOT NULL AUTO_INCREMENT, |
---|
199 | `PRJ_UNIT` varchar(45) NOT NULL, |
---|
200 | `PRJ_PROJECTION` varchar(45) NOT NULL, |
---|
201 | `PRJ_NAME` varchar(45) NOT NULL, |
---|
202 | `PRJ_VERSION` int(11) NOT NULL, |
---|
203 | `PRJ_EXPORT_PATH` varchar(255) DEFAULT NULL, |
---|
204 | `PRJ_EXPORT_TYPE` int(11) DEFAULT '0', |
---|
205 | `PRJ_BACKUP_PATH` varchar(255) DEFAULT NULL, |
---|
206 | `PRJ_AUTHORS` varchar(255) DEFAULT NULL, |
---|
207 | `PRJ_SUMMARY` text, |
---|
208 | `PRJ_SNAP_TOLERENCE` int(11) NOT NULL DEFAULT '10', |
---|
209 | `PRJ_LANG_ACTIVE` int(11) NOT NULL DEFAULT '0', |
---|
210 | `PRJ_BEZIER_APPROX` float NOT NULL DEFAULT '0.5', |
---|
211 | `PRJ_BEZIER_WIDTH` float NOT NULL DEFAULT '1', |
---|
212 | `PRJ_BEZIER_NB_VERTEX` int(11) NOT NULL DEFAULT '10', |
---|
213 | `PRJ_BEZIER_METHOD` int(11) NOT NULL DEFAULT '0', |
---|
214 | PRIMARY KEY (`SETTING_DBK`) |
---|
215 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
216 | |
---|
217 | INSERT INTO prj_settings VALUES(1,"Degrees (DD)","World (WGS84)","Master",229,"",0,"","SWISSTOPO - CREALP", "", 10, 0, 0.5, 1, 10, 0); |
---|
218 | |
---|
219 | -- prj_snapping -- |
---|
220 | CREATE TABLE `prj_snapping` ( |
---|
221 | `TOC_ID` int(11) NOT NULL, |
---|
222 | `SNAPPING_TYPE` int(11) NOT NULL, |
---|
223 | PRIMARY KEY (`TOC_ID`) |
---|
224 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
225 | |
---|
226 | -- prj_stats -- |
---|
227 | CREATE TABLE `prj_stats` ( |
---|
228 | `STAT_ID` int(11) NOT NULL AUTO_INCREMENT, |
---|
229 | `DATE_START` datetime NOT NULL, |
---|
230 | `CLICK` bigint(20) unsigned DEFAULT '0', |
---|
231 | `ATTRIBUTION` bigint(20) unsigned DEFAULT '0', |
---|
232 | `INTERSECTION` bigint(20) unsigned DEFAULT '0', |
---|
233 | `DATE_END` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
---|
234 | PRIMARY KEY (`STAT_ID`) |
---|
235 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
236 | |
---|
237 | -- prj_toc -- |
---|
238 | CREATE TABLE `prj_toc` ( |
---|
239 | `CONTENT_ID` int(10) unsigned NOT NULL AUTO_INCREMENT, |
---|
240 | `TYPE_CD` int(10) unsigned NOT NULL, |
---|
241 | `CONTENT_PATH` varchar(255) DEFAULT NULL, |
---|
242 | `CONTENT_NAME` varchar(255) DEFAULT NULL, |
---|
243 | `CONTENT_STATUS` tinyint(1) DEFAULT '1', |
---|
244 | `GENERIC_LAYERS` tinyint(4) DEFAULT '100', |
---|
245 | `RANK` int(11) DEFAULT NULL, |
---|
246 | `SYMBOLOGY` mediumtext, |
---|
247 | `VERTEX_FLAGS` tinyint(4) DEFAULT NULL, |
---|
248 | PRIMARY KEY (`CONTENT_ID`), |
---|
249 | KEY `PRJ_TOC_FKIndex1` (`TYPE_CD`) |
---|
250 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
251 | |
---|
252 | |
---|
253 | INSERT INTO prj_toc VALUES(1,0,"","Lines",1,0,1,"",0); |
---|
254 | INSERT INTO prj_toc VALUES(2,1,"","Points",1,1,2,"",0); |
---|
255 | INSERT INTO prj_toc VALUES(3,1,"","Labels",1,2,3,"",0); |
---|
256 | INSERT INTO prj_toc VALUES(4,1,"","Notes",0,3,4,"",0); |
---|
257 | INSERT INTO prj_toc VALUES(5,0,"","Frame",1,4,5,"",0); |
---|
258 | |
---|
259 | |
---|
260 | -- shortcut_list -- |
---|
261 | CREATE TABLE `shortcut_list` ( |
---|
262 | `OBJECT_ID` int(10) unsigned NOT NULL, |
---|
263 | `SHORTCUT_CD` int(10) unsigned NOT NULL, |
---|
264 | PRIMARY KEY (`OBJECT_ID`,`SHORTCUT_CD`), |
---|
265 | KEY `SHORTCUT_KEYS_has_DMN_LAYER_OBJECT_FKIndex2` (`OBJECT_ID`), |
---|
266 | KEY `SHORTCUT_LIST_FKIndex2` (`SHORTCUT_CD`) |
---|
267 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
268 | |
---|
269 | -- thematic_layers -- |
---|
270 | CREATE TABLE `thematic_layers` ( |
---|
271 | `LAYER_INDEX` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Theme index', |
---|
272 | `TYPE_CD` int(10) unsigned NOT NULL, |
---|
273 | `LAYER_NAME` varchar(255) NOT NULL COMMENT 'Theme name', |
---|
274 | `LAYER_DESC` varchar(255) DEFAULT NULL COMMENT 'Theme description', |
---|
275 | `REMARK` varchar(255) DEFAULT NULL, |
---|
276 | PRIMARY KEY (`LAYER_INDEX`), |
---|
277 | KEY `THEMATIC_LAYERS_FKIndex1` (`TYPE_CD`) |
---|
278 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
279 | |
---|
280 | -- zoom_level -- |
---|
281 | CREATE TABLE `zoom_level` ( |
---|
282 | `ZOOM_ID` int(10) unsigned NOT NULL AUTO_INCREMENT, |
---|
283 | `SCALE_VALUE` int(10) unsigned NOT NULL, |
---|
284 | `RANK` int(11) DEFAULT NULL, |
---|
285 | PRIMARY KEY (`ZOOM_ID`) |
---|
286 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
---|
287 | |
---|
288 | INSERT INTO zoom_level VALUES(1,5000,2); |
---|
289 | INSERT INTO zoom_level VALUES(2,10000,3); |
---|
290 | INSERT INTO zoom_level VALUES(3,25000,4); |
---|
291 | INSERT INTO zoom_level VALUES(4,50000,5); |
---|
292 | INSERT INTO zoom_level VALUES(5,1000,0); |
---|
293 | INSERT INTO zoom_level VALUES(6,2000,1); |
---|
294 | |
---|