1CREATE TABLE users ( 2 userid bigint NOT NULL, 3 alias varchar(100) WITH DEFAULT '' NOT NULL, 4 name varchar(100) WITH DEFAULT '' NOT NULL, 5 surname varchar(100) WITH DEFAULT '' NOT NULL, 6 passwd varchar(32) WITH DEFAULT '' NOT NULL, 7 url varchar(255) WITH DEFAULT '' NOT NULL, 8 autologin integer WITH DEFAULT '0' NOT NULL, 9 autologout varchar(32) WITH DEFAULT '15m' NOT NULL, 10 lang varchar(5) WITH DEFAULT 'en_GB' NOT NULL, 11 refresh varchar(32) WITH DEFAULT '30s' NOT NULL, 12 type integer WITH DEFAULT '1' NOT NULL, 13 theme varchar(128) WITH DEFAULT 'default' NOT NULL, 14 attempt_failed integer WITH DEFAULT 0 NOT NULL, 15 attempt_ip varchar(39) WITH DEFAULT '' NOT NULL, 16 attempt_clock integer WITH DEFAULT 0 NOT NULL, 17 rows_per_page integer WITH DEFAULT 50 NOT NULL, 18 PRIMARY KEY (userid) 19); 20CREATE UNIQUE INDEX users_1 ON users (alias); 21CREATE TABLE maintenances ( 22 maintenanceid bigint NOT NULL, 23 name varchar(128) WITH DEFAULT '' NOT NULL, 24 maintenance_type integer WITH DEFAULT '0' NOT NULL, 25 description varchar(2048) WITH DEFAULT '' NOT NULL, 26 active_since integer WITH DEFAULT '0' NOT NULL, 27 active_till integer WITH DEFAULT '0' NOT NULL, 28 tags_evaltype integer WITH DEFAULT '0' NOT NULL, 29 PRIMARY KEY (maintenanceid) 30); 31CREATE INDEX maintenances_1 ON maintenances (active_since,active_till); 32CREATE UNIQUE INDEX maintenances_2 ON maintenances (name); 33CREATE TABLE hosts ( 34 hostid bigint NOT NULL, 35 proxy_hostid bigint NULL, 36 host varchar(128) WITH DEFAULT '' NOT NULL, 37 status integer WITH DEFAULT '0' NOT NULL, 38 disable_until integer WITH DEFAULT '0' NOT NULL, 39 error varchar(2048) WITH DEFAULT '' NOT NULL, 40 available integer WITH DEFAULT '0' NOT NULL, 41 errors_from integer WITH DEFAULT '0' NOT NULL, 42 lastaccess integer WITH DEFAULT '0' NOT NULL, 43 ipmi_authtype integer WITH DEFAULT '-1' NOT NULL, 44 ipmi_privilege integer WITH DEFAULT '2' NOT NULL, 45 ipmi_username varchar(16) WITH DEFAULT '' NOT NULL, 46 ipmi_password varchar(20) WITH DEFAULT '' NOT NULL, 47 ipmi_disable_until integer WITH DEFAULT '0' NOT NULL, 48 ipmi_available integer WITH DEFAULT '0' NOT NULL, 49 snmp_disable_until integer WITH DEFAULT '0' NOT NULL, 50 snmp_available integer WITH DEFAULT '0' NOT NULL, 51 maintenanceid bigint NULL, 52 maintenance_status integer WITH DEFAULT '0' NOT NULL, 53 maintenance_type integer WITH DEFAULT '0' NOT NULL, 54 maintenance_from integer WITH DEFAULT '0' NOT NULL, 55 ipmi_errors_from integer WITH DEFAULT '0' NOT NULL, 56 snmp_errors_from integer WITH DEFAULT '0' NOT NULL, 57 ipmi_error varchar(2048) WITH DEFAULT '' NOT NULL, 58 snmp_error varchar(2048) WITH DEFAULT '' NOT NULL, 59 jmx_disable_until integer WITH DEFAULT '0' NOT NULL, 60 jmx_available integer WITH DEFAULT '0' NOT NULL, 61 jmx_errors_from integer WITH DEFAULT '0' NOT NULL, 62 jmx_error varchar(2048) WITH DEFAULT '' NOT NULL, 63 name varchar(128) WITH DEFAULT '' NOT NULL, 64 flags integer WITH DEFAULT '0' NOT NULL, 65 templateid bigint NULL, 66 description varchar(2048) WITH DEFAULT '' NOT NULL, 67 tls_connect integer WITH DEFAULT '1' NOT NULL, 68 tls_accept integer WITH DEFAULT '1' NOT NULL, 69 tls_issuer varchar(1024) WITH DEFAULT '' NOT NULL, 70 tls_subject varchar(1024) WITH DEFAULT '' NOT NULL, 71 tls_psk_identity varchar(128) WITH DEFAULT '' NOT NULL, 72 tls_psk varchar(512) WITH DEFAULT '' NOT NULL, 73 proxy_address varchar(255) WITH DEFAULT '' NOT NULL, 74 auto_compress integer WITH DEFAULT '1' NOT NULL, 75 PRIMARY KEY (hostid) 76); 77CREATE INDEX hosts_1 ON hosts (host); 78CREATE INDEX hosts_2 ON hosts (status); 79CREATE INDEX hosts_3 ON hosts (proxy_hostid); 80CREATE INDEX hosts_4 ON hosts (name); 81CREATE INDEX hosts_5 ON hosts (maintenanceid); 82CREATE TABLE hstgrp ( 83 groupid bigint NOT NULL, 84 name varchar(255) WITH DEFAULT '' NOT NULL, 85 internal integer WITH DEFAULT '0' NOT NULL, 86 flags integer WITH DEFAULT '0' NOT NULL, 87 PRIMARY KEY (groupid) 88); 89CREATE INDEX hstgrp_1 ON hstgrp (name); 90CREATE TABLE group_prototype ( 91 group_prototypeid bigint NOT NULL, 92 hostid bigint NOT NULL, 93 name varchar(255) WITH DEFAULT '' NOT NULL, 94 groupid bigint NULL, 95 templateid bigint NULL, 96 PRIMARY KEY (group_prototypeid) 97); 98CREATE INDEX group_prototype_1 ON group_prototype (hostid); 99CREATE TABLE group_discovery ( 100 groupid bigint NOT NULL, 101 parent_group_prototypeid bigint NOT NULL, 102 name varchar(64) WITH DEFAULT '' NOT NULL, 103 lastcheck integer WITH DEFAULT '0' NOT NULL, 104 ts_delete integer WITH DEFAULT '0' NOT NULL, 105 PRIMARY KEY (groupid) 106); 107CREATE TABLE screens ( 108 screenid bigint NOT NULL, 109 name varchar(255) NOT NULL, 110 hsize integer WITH DEFAULT '1' NOT NULL, 111 vsize integer WITH DEFAULT '1' NOT NULL, 112 templateid bigint NULL, 113 userid bigint NULL, 114 private integer WITH DEFAULT '1' NOT NULL, 115 PRIMARY KEY (screenid) 116); 117CREATE INDEX screens_1 ON screens (templateid); 118CREATE TABLE screens_items ( 119 screenitemid bigint NOT NULL, 120 screenid bigint NOT NULL, 121 resourcetype integer WITH DEFAULT '0' NOT NULL, 122 resourceid bigint WITH DEFAULT '0' NOT NULL, 123 width integer WITH DEFAULT '320' NOT NULL, 124 height integer WITH DEFAULT '200' NOT NULL, 125 x integer WITH DEFAULT '0' NOT NULL, 126 y integer WITH DEFAULT '0' NOT NULL, 127 colspan integer WITH DEFAULT '1' NOT NULL, 128 rowspan integer WITH DEFAULT '1' NOT NULL, 129 elements integer WITH DEFAULT '25' NOT NULL, 130 valign integer WITH DEFAULT '0' NOT NULL, 131 halign integer WITH DEFAULT '0' NOT NULL, 132 style integer WITH DEFAULT '0' NOT NULL, 133 url varchar(255) WITH DEFAULT '' NOT NULL, 134 dynamic integer WITH DEFAULT '0' NOT NULL, 135 sort_triggers integer WITH DEFAULT '0' NOT NULL, 136 application varchar(255) WITH DEFAULT '' NOT NULL, 137 max_columns integer WITH DEFAULT '3' NOT NULL, 138 PRIMARY KEY (screenitemid) 139); 140CREATE INDEX screens_items_1 ON screens_items (screenid); 141CREATE TABLE screen_user ( 142 screenuserid bigint NOT NULL, 143 screenid bigint NOT NULL, 144 userid bigint NOT NULL, 145 permission integer WITH DEFAULT '2' NOT NULL, 146 PRIMARY KEY (screenuserid) 147); 148CREATE UNIQUE INDEX screen_user_1 ON screen_user (screenid,userid); 149CREATE TABLE screen_usrgrp ( 150 screenusrgrpid bigint NOT NULL, 151 screenid bigint NOT NULL, 152 usrgrpid bigint NOT NULL, 153 permission integer WITH DEFAULT '2' NOT NULL, 154 PRIMARY KEY (screenusrgrpid) 155); 156CREATE UNIQUE INDEX screen_usrgrp_1 ON screen_usrgrp (screenid,usrgrpid); 157CREATE TABLE slideshows ( 158 slideshowid bigint NOT NULL, 159 name varchar(255) WITH DEFAULT '' NOT NULL, 160 delay varchar(32) WITH DEFAULT '30s' NOT NULL, 161 userid bigint NOT NULL, 162 private integer WITH DEFAULT '1' NOT NULL, 163 PRIMARY KEY (slideshowid) 164); 165CREATE UNIQUE INDEX slideshows_1 ON slideshows (name); 166CREATE TABLE slideshow_user ( 167 slideshowuserid bigint NOT NULL, 168 slideshowid bigint NOT NULL, 169 userid bigint NOT NULL, 170 permission integer WITH DEFAULT '2' NOT NULL, 171 PRIMARY KEY (slideshowuserid) 172); 173CREATE UNIQUE INDEX slideshow_user_1 ON slideshow_user (slideshowid,userid); 174CREATE TABLE slideshow_usrgrp ( 175 slideshowusrgrpid bigint NOT NULL, 176 slideshowid bigint NOT NULL, 177 usrgrpid bigint NOT NULL, 178 permission integer WITH DEFAULT '2' NOT NULL, 179 PRIMARY KEY (slideshowusrgrpid) 180); 181CREATE UNIQUE INDEX slideshow_usrgrp_1 ON slideshow_usrgrp (slideshowid,usrgrpid); 182CREATE TABLE slides ( 183 slideid bigint NOT NULL, 184 slideshowid bigint NOT NULL, 185 screenid bigint NOT NULL, 186 step integer WITH DEFAULT '0' NOT NULL, 187 delay varchar(32) WITH DEFAULT '0' NOT NULL, 188 PRIMARY KEY (slideid) 189); 190CREATE INDEX slides_1 ON slides (slideshowid); 191CREATE INDEX slides_2 ON slides (screenid); 192CREATE TABLE drules ( 193 druleid bigint NOT NULL, 194 proxy_hostid bigint NULL, 195 name varchar(255) WITH DEFAULT '' NOT NULL, 196 iprange varchar(2048) WITH DEFAULT '' NOT NULL, 197 delay varchar(255) WITH DEFAULT '1h' NOT NULL, 198 nextcheck integer WITH DEFAULT '0' NOT NULL, 199 status integer WITH DEFAULT '0' NOT NULL, 200 PRIMARY KEY (druleid) 201); 202CREATE INDEX drules_1 ON drules (proxy_hostid); 203CREATE UNIQUE INDEX drules_2 ON drules (name); 204CREATE TABLE dchecks ( 205 dcheckid bigint NOT NULL, 206 druleid bigint NOT NULL, 207 type integer WITH DEFAULT '0' NOT NULL, 208 key_ varchar(512) WITH DEFAULT '' NOT NULL, 209 snmp_community varchar(255) WITH DEFAULT '' NOT NULL, 210 ports varchar(255) WITH DEFAULT '0' NOT NULL, 211 snmpv3_securityname varchar(64) WITH DEFAULT '' NOT NULL, 212 snmpv3_securitylevel integer WITH DEFAULT '0' NOT NULL, 213 snmpv3_authpassphrase varchar(64) WITH DEFAULT '' NOT NULL, 214 snmpv3_privpassphrase varchar(64) WITH DEFAULT '' NOT NULL, 215 uniq integer WITH DEFAULT '0' NOT NULL, 216 snmpv3_authprotocol integer WITH DEFAULT '0' NOT NULL, 217 snmpv3_privprotocol integer WITH DEFAULT '0' NOT NULL, 218 snmpv3_contextname varchar(255) WITH DEFAULT '' NOT NULL, 219 PRIMARY KEY (dcheckid) 220); 221CREATE INDEX dchecks_1 ON dchecks (druleid); 222CREATE TABLE applications ( 223 applicationid bigint NOT NULL, 224 hostid bigint NOT NULL, 225 name varchar(255) WITH DEFAULT '' NOT NULL, 226 flags integer WITH DEFAULT '0' NOT NULL, 227 PRIMARY KEY (applicationid) 228); 229CREATE UNIQUE INDEX applications_2 ON applications (hostid,name); 230CREATE TABLE httptest ( 231 httptestid bigint NOT NULL, 232 name varchar(64) WITH DEFAULT '' NOT NULL, 233 applicationid bigint NULL, 234 nextcheck integer WITH DEFAULT '0' NOT NULL, 235 delay varchar(255) WITH DEFAULT '1m' NOT NULL, 236 status integer WITH DEFAULT '0' NOT NULL, 237 agent varchar(255) WITH DEFAULT 'Zabbix' NOT NULL, 238 authentication integer WITH DEFAULT '0' NOT NULL, 239 http_user varchar(64) WITH DEFAULT '' NOT NULL, 240 http_password varchar(64) WITH DEFAULT '' NOT NULL, 241 hostid bigint NOT NULL, 242 templateid bigint NULL, 243 http_proxy varchar(255) WITH DEFAULT '' NOT NULL, 244 retries integer WITH DEFAULT '1' NOT NULL, 245 ssl_cert_file varchar(255) WITH DEFAULT '' NOT NULL, 246 ssl_key_file varchar(255) WITH DEFAULT '' NOT NULL, 247 ssl_key_password varchar(64) WITH DEFAULT '' NOT NULL, 248 verify_peer integer WITH DEFAULT '0' NOT NULL, 249 verify_host integer WITH DEFAULT '0' NOT NULL, 250 PRIMARY KEY (httptestid) 251); 252CREATE INDEX httptest_1 ON httptest (applicationid); 253CREATE UNIQUE INDEX httptest_2 ON httptest (hostid,name); 254CREATE INDEX httptest_3 ON httptest (status); 255CREATE INDEX httptest_4 ON httptest (templateid); 256CREATE TABLE httpstep ( 257 httpstepid bigint NOT NULL, 258 httptestid bigint NOT NULL, 259 name varchar(64) WITH DEFAULT '' NOT NULL, 260 no integer WITH DEFAULT '0' NOT NULL, 261 url varchar(2048) WITH DEFAULT '' NOT NULL, 262 timeout varchar(255) WITH DEFAULT '15s' NOT NULL, 263 posts varchar(2048) WITH DEFAULT '' NOT NULL, 264 required varchar(255) WITH DEFAULT '' NOT NULL, 265 status_codes varchar(255) WITH DEFAULT '' NOT NULL, 266 follow_redirects integer WITH DEFAULT '1' NOT NULL, 267 retrieve_mode integer WITH DEFAULT '0' NOT NULL, 268 post_type integer WITH DEFAULT '0' NOT NULL, 269 PRIMARY KEY (httpstepid) 270); 271CREATE INDEX httpstep_1 ON httpstep (httptestid); 272CREATE TABLE interface ( 273 interfaceid bigint NOT NULL, 274 hostid bigint NOT NULL, 275 main integer WITH DEFAULT '0' NOT NULL, 276 type integer WITH DEFAULT '0' NOT NULL, 277 useip integer WITH DEFAULT '1' NOT NULL, 278 ip varchar(64) WITH DEFAULT '127.0.0.1' NOT NULL, 279 dns varchar(255) WITH DEFAULT '' NOT NULL, 280 port varchar(64) WITH DEFAULT '10050' NOT NULL, 281 bulk integer WITH DEFAULT '1' NOT NULL, 282 PRIMARY KEY (interfaceid) 283); 284CREATE INDEX interface_1 ON interface (hostid,type); 285CREATE INDEX interface_2 ON interface (ip,dns); 286CREATE TABLE valuemaps ( 287 valuemapid bigint NOT NULL, 288 name varchar(64) WITH DEFAULT '' NOT NULL, 289 PRIMARY KEY (valuemapid) 290); 291CREATE UNIQUE INDEX valuemaps_1 ON valuemaps (name); 292CREATE TABLE items ( 293 itemid bigint NOT NULL, 294 type integer WITH DEFAULT '0' NOT NULL, 295 snmp_community varchar(64) WITH DEFAULT '' NOT NULL, 296 snmp_oid varchar(512) WITH DEFAULT '' NOT NULL, 297 hostid bigint NOT NULL, 298 name varchar(255) WITH DEFAULT '' NOT NULL, 299 key_ varchar(255) WITH DEFAULT '' NOT NULL, 300 delay varchar(1024) WITH DEFAULT '0' NOT NULL, 301 history varchar(255) WITH DEFAULT '90d' NOT NULL, 302 trends varchar(255) WITH DEFAULT '365d' NOT NULL, 303 status integer WITH DEFAULT '0' NOT NULL, 304 value_type integer WITH DEFAULT '0' NOT NULL, 305 trapper_hosts varchar(255) WITH DEFAULT '' NOT NULL, 306 units varchar(255) WITH DEFAULT '' NOT NULL, 307 snmpv3_securityname varchar(64) WITH DEFAULT '' NOT NULL, 308 snmpv3_securitylevel integer WITH DEFAULT '0' NOT NULL, 309 snmpv3_authpassphrase varchar(64) WITH DEFAULT '' NOT NULL, 310 snmpv3_privpassphrase varchar(64) WITH DEFAULT '' NOT NULL, 311 formula varchar(255) WITH DEFAULT '' NOT NULL, 312 error varchar(2048) WITH DEFAULT '' NOT NULL, 313 lastlogsize bigint WITH DEFAULT '0' NOT NULL, 314 logtimefmt varchar(64) WITH DEFAULT '' NOT NULL, 315 templateid bigint NULL, 316 valuemapid bigint NULL, 317 params varchar(2048) WITH DEFAULT '' NOT NULL, 318 ipmi_sensor varchar(128) WITH DEFAULT '' NOT NULL, 319 authtype integer WITH DEFAULT '0' NOT NULL, 320 username varchar(64) WITH DEFAULT '' NOT NULL, 321 password varchar(64) WITH DEFAULT '' NOT NULL, 322 publickey varchar(64) WITH DEFAULT '' NOT NULL, 323 privatekey varchar(64) WITH DEFAULT '' NOT NULL, 324 mtime integer WITH DEFAULT '0' NOT NULL, 325 flags integer WITH DEFAULT '0' NOT NULL, 326 interfaceid bigint NULL, 327 port varchar(64) WITH DEFAULT '' NOT NULL, 328 description varchar(2048) WITH DEFAULT '' NOT NULL, 329 inventory_link integer WITH DEFAULT '0' NOT NULL, 330 lifetime varchar(255) WITH DEFAULT '30d' NOT NULL, 331 snmpv3_authprotocol integer WITH DEFAULT '0' NOT NULL, 332 snmpv3_privprotocol integer WITH DEFAULT '0' NOT NULL, 333 state integer WITH DEFAULT '0' NOT NULL, 334 snmpv3_contextname varchar(255) WITH DEFAULT '' NOT NULL, 335 evaltype integer WITH DEFAULT '0' NOT NULL, 336 jmx_endpoint varchar(255) WITH DEFAULT '' NOT NULL, 337 master_itemid bigint NULL, 338 timeout varchar(255) WITH DEFAULT '3s' NOT NULL, 339 url varchar(2048) WITH DEFAULT '' NOT NULL, 340 query_fields varchar(2048) WITH DEFAULT '' NOT NULL, 341 posts varchar(2048) WITH DEFAULT '' NOT NULL, 342 status_codes varchar(255) WITH DEFAULT '200' NOT NULL, 343 follow_redirects integer WITH DEFAULT '1' NOT NULL, 344 post_type integer WITH DEFAULT '0' NOT NULL, 345 http_proxy varchar(255) WITH DEFAULT '' NOT NULL, 346 headers varchar(2048) WITH DEFAULT '' NOT NULL, 347 retrieve_mode integer WITH DEFAULT '0' NOT NULL, 348 request_method integer WITH DEFAULT '0' NOT NULL, 349 output_format integer WITH DEFAULT '0' NOT NULL, 350 ssl_cert_file varchar(255) WITH DEFAULT '' NOT NULL, 351 ssl_key_file varchar(255) WITH DEFAULT '' NOT NULL, 352 ssl_key_password varchar(64) WITH DEFAULT '' NOT NULL, 353 verify_peer integer WITH DEFAULT '0' NOT NULL, 354 verify_host integer WITH DEFAULT '0' NOT NULL, 355 allow_traps integer WITH DEFAULT '0' NOT NULL, 356 PRIMARY KEY (itemid) 357); 358CREATE UNIQUE INDEX items_1 ON items (hostid,key_); 359CREATE INDEX items_3 ON items (status); 360CREATE INDEX items_4 ON items (templateid); 361CREATE INDEX items_5 ON items (valuemapid); 362CREATE INDEX items_6 ON items (interfaceid); 363CREATE INDEX items_7 ON items (master_itemid); 364CREATE TABLE httpstepitem ( 365 httpstepitemid bigint NOT NULL, 366 httpstepid bigint NOT NULL, 367 itemid bigint NOT NULL, 368 type integer WITH DEFAULT '0' NOT NULL, 369 PRIMARY KEY (httpstepitemid) 370); 371CREATE UNIQUE INDEX httpstepitem_1 ON httpstepitem (httpstepid,itemid); 372CREATE INDEX httpstepitem_2 ON httpstepitem (itemid); 373CREATE TABLE httptestitem ( 374 httptestitemid bigint NOT NULL, 375 httptestid bigint NOT NULL, 376 itemid bigint NOT NULL, 377 type integer WITH DEFAULT '0' NOT NULL, 378 PRIMARY KEY (httptestitemid) 379); 380CREATE UNIQUE INDEX httptestitem_1 ON httptestitem (httptestid,itemid); 381CREATE INDEX httptestitem_2 ON httptestitem (itemid); 382CREATE TABLE media_type ( 383 mediatypeid bigint NOT NULL, 384 type integer WITH DEFAULT '0' NOT NULL, 385 description varchar(100) WITH DEFAULT '' NOT NULL, 386 smtp_server varchar(255) WITH DEFAULT '' NOT NULL, 387 smtp_helo varchar(255) WITH DEFAULT '' NOT NULL, 388 smtp_email varchar(255) WITH DEFAULT '' NOT NULL, 389 exec_path varchar(255) WITH DEFAULT '' NOT NULL, 390 gsm_modem varchar(255) WITH DEFAULT '' NOT NULL, 391 username varchar(255) WITH DEFAULT '' NOT NULL, 392 passwd varchar(255) WITH DEFAULT '' NOT NULL, 393 status integer WITH DEFAULT '0' NOT NULL, 394 smtp_port integer WITH DEFAULT '25' NOT NULL, 395 smtp_security integer WITH DEFAULT '0' NOT NULL, 396 smtp_verify_peer integer WITH DEFAULT '0' NOT NULL, 397 smtp_verify_host integer WITH DEFAULT '0' NOT NULL, 398 smtp_authentication integer WITH DEFAULT '0' NOT NULL, 399 exec_params varchar(255) WITH DEFAULT '' NOT NULL, 400 maxsessions integer WITH DEFAULT '1' NOT NULL, 401 maxattempts integer WITH DEFAULT '3' NOT NULL, 402 attempt_interval varchar(32) WITH DEFAULT '10s' NOT NULL, 403 PRIMARY KEY (mediatypeid) 404); 405CREATE UNIQUE INDEX media_type_1 ON media_type (description); 406CREATE TABLE usrgrp ( 407 usrgrpid bigint NOT NULL, 408 name varchar(64) WITH DEFAULT '' NOT NULL, 409 gui_access integer WITH DEFAULT '0' NOT NULL, 410 users_status integer WITH DEFAULT '0' NOT NULL, 411 debug_mode integer WITH DEFAULT '0' NOT NULL, 412 PRIMARY KEY (usrgrpid) 413); 414CREATE UNIQUE INDEX usrgrp_1 ON usrgrp (name); 415CREATE TABLE users_groups ( 416 id bigint NOT NULL, 417 usrgrpid bigint NOT NULL, 418 userid bigint NOT NULL, 419 PRIMARY KEY (id) 420); 421CREATE UNIQUE INDEX users_groups_1 ON users_groups (usrgrpid,userid); 422CREATE INDEX users_groups_2 ON users_groups (userid); 423CREATE TABLE scripts ( 424 scriptid bigint NOT NULL, 425 name varchar(255) WITH DEFAULT '' NOT NULL, 426 command varchar(255) WITH DEFAULT '' NOT NULL, 427 host_access integer WITH DEFAULT '2' NOT NULL, 428 usrgrpid bigint NULL, 429 groupid bigint NULL, 430 description varchar(2048) WITH DEFAULT '' NOT NULL, 431 confirmation varchar(255) WITH DEFAULT '' NOT NULL, 432 type integer WITH DEFAULT '0' NOT NULL, 433 execute_on integer WITH DEFAULT '2' NOT NULL, 434 PRIMARY KEY (scriptid) 435); 436CREATE INDEX scripts_1 ON scripts (usrgrpid); 437CREATE INDEX scripts_2 ON scripts (groupid); 438CREATE UNIQUE INDEX scripts_3 ON scripts (name); 439CREATE TABLE actions ( 440 actionid bigint NOT NULL, 441 name varchar(255) WITH DEFAULT '' NOT NULL, 442 eventsource integer WITH DEFAULT '0' NOT NULL, 443 evaltype integer WITH DEFAULT '0' NOT NULL, 444 status integer WITH DEFAULT '0' NOT NULL, 445 esc_period varchar(255) WITH DEFAULT '1h' NOT NULL, 446 def_shortdata varchar(255) WITH DEFAULT '' NOT NULL, 447 def_longdata varchar(2048) WITH DEFAULT '' NOT NULL, 448 r_shortdata varchar(255) WITH DEFAULT '' NOT NULL, 449 r_longdata varchar(2048) WITH DEFAULT '' NOT NULL, 450 formula varchar(255) WITH DEFAULT '' NOT NULL, 451 pause_suppressed integer WITH DEFAULT '1' NOT NULL, 452 ack_shortdata varchar(255) WITH DEFAULT '' NOT NULL, 453 ack_longdata varchar(2048) WITH DEFAULT '' NOT NULL, 454 PRIMARY KEY (actionid) 455); 456CREATE INDEX actions_1 ON actions (eventsource,status); 457CREATE UNIQUE INDEX actions_2 ON actions (name); 458CREATE TABLE operations ( 459 operationid bigint NOT NULL, 460 actionid bigint NOT NULL, 461 operationtype integer WITH DEFAULT '0' NOT NULL, 462 esc_period varchar(255) WITH DEFAULT '0' NOT NULL, 463 esc_step_from integer WITH DEFAULT '1' NOT NULL, 464 esc_step_to integer WITH DEFAULT '1' NOT NULL, 465 evaltype integer WITH DEFAULT '0' NOT NULL, 466 recovery integer WITH DEFAULT '0' NOT NULL, 467 PRIMARY KEY (operationid) 468); 469CREATE INDEX operations_1 ON operations (actionid); 470CREATE TABLE opmessage ( 471 operationid bigint NOT NULL, 472 default_msg integer WITH DEFAULT '0' NOT NULL, 473 subject varchar(255) WITH DEFAULT '' NOT NULL, 474 message varchar(2048) WITH DEFAULT '' NOT NULL, 475 mediatypeid bigint NULL, 476 PRIMARY KEY (operationid) 477); 478CREATE INDEX opmessage_1 ON opmessage (mediatypeid); 479CREATE TABLE opmessage_grp ( 480 opmessage_grpid bigint NOT NULL, 481 operationid bigint NOT NULL, 482 usrgrpid bigint NOT NULL, 483 PRIMARY KEY (opmessage_grpid) 484); 485CREATE UNIQUE INDEX opmessage_grp_1 ON opmessage_grp (operationid,usrgrpid); 486CREATE INDEX opmessage_grp_2 ON opmessage_grp (usrgrpid); 487CREATE TABLE opmessage_usr ( 488 opmessage_usrid bigint NOT NULL, 489 operationid bigint NOT NULL, 490 userid bigint NOT NULL, 491 PRIMARY KEY (opmessage_usrid) 492); 493CREATE UNIQUE INDEX opmessage_usr_1 ON opmessage_usr (operationid,userid); 494CREATE INDEX opmessage_usr_2 ON opmessage_usr (userid); 495CREATE TABLE opcommand ( 496 operationid bigint NOT NULL, 497 type integer WITH DEFAULT '0' NOT NULL, 498 scriptid bigint NULL, 499 execute_on integer WITH DEFAULT '0' NOT NULL, 500 port varchar(64) WITH DEFAULT '' NOT NULL, 501 authtype integer WITH DEFAULT '0' NOT NULL, 502 username varchar(64) WITH DEFAULT '' NOT NULL, 503 password varchar(64) WITH DEFAULT '' NOT NULL, 504 publickey varchar(64) WITH DEFAULT '' NOT NULL, 505 privatekey varchar(64) WITH DEFAULT '' NOT NULL, 506 command varchar(2048) WITH DEFAULT '' NOT NULL, 507 PRIMARY KEY (operationid) 508); 509CREATE INDEX opcommand_1 ON opcommand (scriptid); 510CREATE TABLE opcommand_hst ( 511 opcommand_hstid bigint NOT NULL, 512 operationid bigint NOT NULL, 513 hostid bigint NULL, 514 PRIMARY KEY (opcommand_hstid) 515); 516CREATE INDEX opcommand_hst_1 ON opcommand_hst (operationid); 517CREATE INDEX opcommand_hst_2 ON opcommand_hst (hostid); 518CREATE TABLE opcommand_grp ( 519 opcommand_grpid bigint NOT NULL, 520 operationid bigint NOT NULL, 521 groupid bigint NOT NULL, 522 PRIMARY KEY (opcommand_grpid) 523); 524CREATE INDEX opcommand_grp_1 ON opcommand_grp (operationid); 525CREATE INDEX opcommand_grp_2 ON opcommand_grp (groupid); 526CREATE TABLE opgroup ( 527 opgroupid bigint NOT NULL, 528 operationid bigint NOT NULL, 529 groupid bigint NOT NULL, 530 PRIMARY KEY (opgroupid) 531); 532CREATE UNIQUE INDEX opgroup_1 ON opgroup (operationid,groupid); 533CREATE INDEX opgroup_2 ON opgroup (groupid); 534CREATE TABLE optemplate ( 535 optemplateid bigint NOT NULL, 536 operationid bigint NOT NULL, 537 templateid bigint NOT NULL, 538 PRIMARY KEY (optemplateid) 539); 540CREATE UNIQUE INDEX optemplate_1 ON optemplate (operationid,templateid); 541CREATE INDEX optemplate_2 ON optemplate (templateid); 542CREATE TABLE opconditions ( 543 opconditionid bigint NOT NULL, 544 operationid bigint NOT NULL, 545 conditiontype integer WITH DEFAULT '0' NOT NULL, 546 operator integer WITH DEFAULT '0' NOT NULL, 547 value varchar(255) WITH DEFAULT '' NOT NULL, 548 PRIMARY KEY (opconditionid) 549); 550CREATE INDEX opconditions_1 ON opconditions (operationid); 551CREATE TABLE conditions ( 552 conditionid bigint NOT NULL, 553 actionid bigint NOT NULL, 554 conditiontype integer WITH DEFAULT '0' NOT NULL, 555 operator integer WITH DEFAULT '0' NOT NULL, 556 value varchar(255) WITH DEFAULT '' NOT NULL, 557 value2 varchar(255) WITH DEFAULT '' NOT NULL, 558 PRIMARY KEY (conditionid) 559); 560CREATE INDEX conditions_1 ON conditions (actionid); 561CREATE TABLE config ( 562 configid bigint NOT NULL, 563 refresh_unsupported varchar(32) WITH DEFAULT '10m' NOT NULL, 564 work_period varchar(255) WITH DEFAULT '1-5,09:00-18:00' NOT NULL, 565 alert_usrgrpid bigint NULL, 566 default_theme varchar(128) WITH DEFAULT 'blue-theme' NOT NULL, 567 authentication_type integer WITH DEFAULT '0' NOT NULL, 568 ldap_host varchar(255) WITH DEFAULT '' NOT NULL, 569 ldap_port integer WITH DEFAULT 389 NOT NULL, 570 ldap_base_dn varchar(255) WITH DEFAULT '' NOT NULL, 571 ldap_bind_dn varchar(255) WITH DEFAULT '' NOT NULL, 572 ldap_bind_password varchar(128) WITH DEFAULT '' NOT NULL, 573 ldap_search_attribute varchar(128) WITH DEFAULT '' NOT NULL, 574 dropdown_first_entry integer WITH DEFAULT '1' NOT NULL, 575 dropdown_first_remember integer WITH DEFAULT '1' NOT NULL, 576 discovery_groupid bigint NOT NULL, 577 max_in_table integer WITH DEFAULT '50' NOT NULL, 578 search_limit integer WITH DEFAULT '1000' NOT NULL, 579 severity_color_0 varchar(6) WITH DEFAULT '97AAB3' NOT NULL, 580 severity_color_1 varchar(6) WITH DEFAULT '7499FF' NOT NULL, 581 severity_color_2 varchar(6) WITH DEFAULT 'FFC859' NOT NULL, 582 severity_color_3 varchar(6) WITH DEFAULT 'FFA059' NOT NULL, 583 severity_color_4 varchar(6) WITH DEFAULT 'E97659' NOT NULL, 584 severity_color_5 varchar(6) WITH DEFAULT 'E45959' NOT NULL, 585 severity_name_0 varchar(32) WITH DEFAULT 'Not classified' NOT NULL, 586 severity_name_1 varchar(32) WITH DEFAULT 'Information' NOT NULL, 587 severity_name_2 varchar(32) WITH DEFAULT 'Warning' NOT NULL, 588 severity_name_3 varchar(32) WITH DEFAULT 'Average' NOT NULL, 589 severity_name_4 varchar(32) WITH DEFAULT 'High' NOT NULL, 590 severity_name_5 varchar(32) WITH DEFAULT 'Disaster' NOT NULL, 591 ok_period varchar(32) WITH DEFAULT '5m' NOT NULL, 592 blink_period varchar(32) WITH DEFAULT '2m' NOT NULL, 593 problem_unack_color varchar(6) WITH DEFAULT 'CC0000' NOT NULL, 594 problem_ack_color varchar(6) WITH DEFAULT 'CC0000' NOT NULL, 595 ok_unack_color varchar(6) WITH DEFAULT '009900' NOT NULL, 596 ok_ack_color varchar(6) WITH DEFAULT '009900' NOT NULL, 597 problem_unack_style integer WITH DEFAULT '1' NOT NULL, 598 problem_ack_style integer WITH DEFAULT '1' NOT NULL, 599 ok_unack_style integer WITH DEFAULT '1' NOT NULL, 600 ok_ack_style integer WITH DEFAULT '1' NOT NULL, 601 snmptrap_logging integer WITH DEFAULT '1' NOT NULL, 602 server_check_interval integer WITH DEFAULT '10' NOT NULL, 603 hk_events_mode integer WITH DEFAULT '1' NOT NULL, 604 hk_events_trigger varchar(32) WITH DEFAULT '365d' NOT NULL, 605 hk_events_internal varchar(32) WITH DEFAULT '1d' NOT NULL, 606 hk_events_discovery varchar(32) WITH DEFAULT '1d' NOT NULL, 607 hk_events_autoreg varchar(32) WITH DEFAULT '1d' NOT NULL, 608 hk_services_mode integer WITH DEFAULT '1' NOT NULL, 609 hk_services varchar(32) WITH DEFAULT '365d' NOT NULL, 610 hk_audit_mode integer WITH DEFAULT '1' NOT NULL, 611 hk_audit varchar(32) WITH DEFAULT '365d' NOT NULL, 612 hk_sessions_mode integer WITH DEFAULT '1' NOT NULL, 613 hk_sessions varchar(32) WITH DEFAULT '365d' NOT NULL, 614 hk_history_mode integer WITH DEFAULT '1' NOT NULL, 615 hk_history_global integer WITH DEFAULT '0' NOT NULL, 616 hk_history varchar(32) WITH DEFAULT '90d' NOT NULL, 617 hk_trends_mode integer WITH DEFAULT '1' NOT NULL, 618 hk_trends_global integer WITH DEFAULT '0' NOT NULL, 619 hk_trends varchar(32) WITH DEFAULT '365d' NOT NULL, 620 default_inventory_mode integer WITH DEFAULT '-1' NOT NULL, 621 custom_color integer WITH DEFAULT '0' NOT NULL, 622 http_auth_enabled integer WITH DEFAULT '0' NOT NULL, 623 http_login_form integer WITH DEFAULT '0' NOT NULL, 624 http_strip_domains varchar(2048) WITH DEFAULT '' NOT NULL, 625 http_case_sensitive integer WITH DEFAULT '1' NOT NULL, 626 ldap_configured integer WITH DEFAULT '0' NOT NULL, 627 ldap_case_sensitive integer WITH DEFAULT '1' NOT NULL, 628 PRIMARY KEY (configid) 629); 630CREATE INDEX config_1 ON config (alert_usrgrpid); 631CREATE INDEX config_2 ON config (discovery_groupid); 632CREATE TABLE triggers ( 633 triggerid bigint NOT NULL, 634 expression varchar(2048) WITH DEFAULT '' NOT NULL, 635 description varchar(255) WITH DEFAULT '' NOT NULL, 636 url varchar(255) WITH DEFAULT '' NOT NULL, 637 status integer WITH DEFAULT '0' NOT NULL, 638 value integer WITH DEFAULT '0' NOT NULL, 639 priority integer WITH DEFAULT '0' NOT NULL, 640 lastchange integer WITH DEFAULT '0' NOT NULL, 641 comments varchar(2048) WITH DEFAULT '' NOT NULL, 642 error varchar(2048) WITH DEFAULT '' NOT NULL, 643 templateid bigint NULL, 644 type integer WITH DEFAULT '0' NOT NULL, 645 state integer WITH DEFAULT '0' NOT NULL, 646 flags integer WITH DEFAULT '0' NOT NULL, 647 recovery_mode integer WITH DEFAULT '0' NOT NULL, 648 recovery_expression varchar(2048) WITH DEFAULT '' NOT NULL, 649 correlation_mode integer WITH DEFAULT '0' NOT NULL, 650 correlation_tag varchar(255) WITH DEFAULT '' NOT NULL, 651 manual_close integer WITH DEFAULT '0' NOT NULL, 652 PRIMARY KEY (triggerid) 653); 654CREATE INDEX triggers_1 ON triggers (status); 655CREATE INDEX triggers_2 ON triggers (value,lastchange); 656CREATE INDEX triggers_3 ON triggers (templateid); 657CREATE TABLE trigger_depends ( 658 triggerdepid bigint NOT NULL, 659 triggerid_down bigint NOT NULL, 660 triggerid_up bigint NOT NULL, 661 PRIMARY KEY (triggerdepid) 662); 663CREATE UNIQUE INDEX trigger_depends_1 ON trigger_depends (triggerid_down,triggerid_up); 664CREATE INDEX trigger_depends_2 ON trigger_depends (triggerid_up); 665CREATE TABLE functions ( 666 functionid bigint NOT NULL, 667 itemid bigint NOT NULL, 668 triggerid bigint NOT NULL, 669 name varchar(12) WITH DEFAULT '' NOT NULL, 670 parameter varchar(255) WITH DEFAULT '0' NOT NULL, 671 PRIMARY KEY (functionid) 672); 673CREATE INDEX functions_1 ON functions (triggerid); 674CREATE INDEX functions_2 ON functions (itemid,name,parameter); 675CREATE TABLE graphs ( 676 graphid bigint NOT NULL, 677 name varchar(128) WITH DEFAULT '' NOT NULL, 678 width integer WITH DEFAULT '900' NOT NULL, 679 height integer WITH DEFAULT '200' NOT NULL, 680 yaxismin decfloat(16) WITH DEFAULT '0' NOT NULL, 681 yaxismax decfloat(16) WITH DEFAULT '100' NOT NULL, 682 templateid bigint NULL, 683 show_work_period integer WITH DEFAULT '1' NOT NULL, 684 show_triggers integer WITH DEFAULT '1' NOT NULL, 685 graphtype integer WITH DEFAULT '0' NOT NULL, 686 show_legend integer WITH DEFAULT '1' NOT NULL, 687 show_3d integer WITH DEFAULT '0' NOT NULL, 688 percent_left decfloat(16) WITH DEFAULT '0' NOT NULL, 689 percent_right decfloat(16) WITH DEFAULT '0' NOT NULL, 690 ymin_type integer WITH DEFAULT '0' NOT NULL, 691 ymax_type integer WITH DEFAULT '0' NOT NULL, 692 ymin_itemid bigint NULL, 693 ymax_itemid bigint NULL, 694 flags integer WITH DEFAULT '0' NOT NULL, 695 PRIMARY KEY (graphid) 696); 697CREATE INDEX graphs_1 ON graphs (name); 698CREATE INDEX graphs_2 ON graphs (templateid); 699CREATE INDEX graphs_3 ON graphs (ymin_itemid); 700CREATE INDEX graphs_4 ON graphs (ymax_itemid); 701CREATE TABLE graphs_items ( 702 gitemid bigint NOT NULL, 703 graphid bigint NOT NULL, 704 itemid bigint NOT NULL, 705 drawtype integer WITH DEFAULT '0' NOT NULL, 706 sortorder integer WITH DEFAULT '0' NOT NULL, 707 color varchar(6) WITH DEFAULT '009600' NOT NULL, 708 yaxisside integer WITH DEFAULT '0' NOT NULL, 709 calc_fnc integer WITH DEFAULT '2' NOT NULL, 710 type integer WITH DEFAULT '0' NOT NULL, 711 PRIMARY KEY (gitemid) 712); 713CREATE INDEX graphs_items_1 ON graphs_items (itemid); 714CREATE INDEX graphs_items_2 ON graphs_items (graphid); 715CREATE TABLE graph_theme ( 716 graphthemeid bigint NOT NULL, 717 theme varchar(64) WITH DEFAULT '' NOT NULL, 718 backgroundcolor varchar(6) WITH DEFAULT '' NOT NULL, 719 graphcolor varchar(6) WITH DEFAULT '' NOT NULL, 720 gridcolor varchar(6) WITH DEFAULT '' NOT NULL, 721 maingridcolor varchar(6) WITH DEFAULT '' NOT NULL, 722 gridbordercolor varchar(6) WITH DEFAULT '' NOT NULL, 723 textcolor varchar(6) WITH DEFAULT '' NOT NULL, 724 highlightcolor varchar(6) WITH DEFAULT '' NOT NULL, 725 leftpercentilecolor varchar(6) WITH DEFAULT '' NOT NULL, 726 rightpercentilecolor varchar(6) WITH DEFAULT '' NOT NULL, 727 nonworktimecolor varchar(6) WITH DEFAULT '' NOT NULL, 728 colorpalette varchar(255) WITH DEFAULT '' NOT NULL, 729 PRIMARY KEY (graphthemeid) 730); 731CREATE UNIQUE INDEX graph_theme_1 ON graph_theme (theme); 732CREATE TABLE globalmacro ( 733 globalmacroid bigint NOT NULL, 734 macro varchar(255) WITH DEFAULT '' NOT NULL, 735 value varchar(255) WITH DEFAULT '' NOT NULL, 736 PRIMARY KEY (globalmacroid) 737); 738CREATE UNIQUE INDEX globalmacro_1 ON globalmacro (macro); 739CREATE TABLE hostmacro ( 740 hostmacroid bigint NOT NULL, 741 hostid bigint NOT NULL, 742 macro varchar(255) WITH DEFAULT '' NOT NULL, 743 value varchar(255) WITH DEFAULT '' NOT NULL, 744 PRIMARY KEY (hostmacroid) 745); 746CREATE UNIQUE INDEX hostmacro_1 ON hostmacro (hostid,macro); 747CREATE TABLE hosts_groups ( 748 hostgroupid bigint NOT NULL, 749 hostid bigint NOT NULL, 750 groupid bigint NOT NULL, 751 PRIMARY KEY (hostgroupid) 752); 753CREATE UNIQUE INDEX hosts_groups_1 ON hosts_groups (hostid,groupid); 754CREATE INDEX hosts_groups_2 ON hosts_groups (groupid); 755CREATE TABLE hosts_templates ( 756 hosttemplateid bigint NOT NULL, 757 hostid bigint NOT NULL, 758 templateid bigint NOT NULL, 759 PRIMARY KEY (hosttemplateid) 760); 761CREATE UNIQUE INDEX hosts_templates_1 ON hosts_templates (hostid,templateid); 762CREATE INDEX hosts_templates_2 ON hosts_templates (templateid); 763CREATE TABLE items_applications ( 764 itemappid bigint NOT NULL, 765 applicationid bigint NOT NULL, 766 itemid bigint NOT NULL, 767 PRIMARY KEY (itemappid) 768); 769CREATE UNIQUE INDEX items_applications_1 ON items_applications (applicationid,itemid); 770CREATE INDEX items_applications_2 ON items_applications (itemid); 771CREATE TABLE mappings ( 772 mappingid bigint NOT NULL, 773 valuemapid bigint NOT NULL, 774 value varchar(64) WITH DEFAULT '' NOT NULL, 775 newvalue varchar(64) WITH DEFAULT '' NOT NULL, 776 PRIMARY KEY (mappingid) 777); 778CREATE INDEX mappings_1 ON mappings (valuemapid); 779CREATE TABLE media ( 780 mediaid bigint NOT NULL, 781 userid bigint NOT NULL, 782 mediatypeid bigint NOT NULL, 783 sendto varchar(1024) WITH DEFAULT '' NOT NULL, 784 active integer WITH DEFAULT '0' NOT NULL, 785 severity integer WITH DEFAULT '63' NOT NULL, 786 period varchar(1024) WITH DEFAULT '1-7,00:00-24:00' NOT NULL, 787 PRIMARY KEY (mediaid) 788); 789CREATE INDEX media_1 ON media (userid); 790CREATE INDEX media_2 ON media (mediatypeid); 791CREATE TABLE rights ( 792 rightid bigint NOT NULL, 793 groupid bigint NOT NULL, 794 permission integer WITH DEFAULT '0' NOT NULL, 795 id bigint NOT NULL, 796 PRIMARY KEY (rightid) 797); 798CREATE INDEX rights_1 ON rights (groupid); 799CREATE INDEX rights_2 ON rights (id); 800CREATE TABLE services ( 801 serviceid bigint NOT NULL, 802 name varchar(128) WITH DEFAULT '' NOT NULL, 803 status integer WITH DEFAULT '0' NOT NULL, 804 algorithm integer WITH DEFAULT '0' NOT NULL, 805 triggerid bigint NULL, 806 showsla integer WITH DEFAULT '0' NOT NULL, 807 goodsla decfloat(16) WITH DEFAULT '99.9' NOT NULL, 808 sortorder integer WITH DEFAULT '0' NOT NULL, 809 PRIMARY KEY (serviceid) 810); 811CREATE INDEX services_1 ON services (triggerid); 812CREATE TABLE services_links ( 813 linkid bigint NOT NULL, 814 serviceupid bigint NOT NULL, 815 servicedownid bigint NOT NULL, 816 soft integer WITH DEFAULT '0' NOT NULL, 817 PRIMARY KEY (linkid) 818); 819CREATE INDEX services_links_1 ON services_links (servicedownid); 820CREATE UNIQUE INDEX services_links_2 ON services_links (serviceupid,servicedownid); 821CREATE TABLE services_times ( 822 timeid bigint NOT NULL, 823 serviceid bigint NOT NULL, 824 type integer WITH DEFAULT '0' NOT NULL, 825 ts_from integer WITH DEFAULT '0' NOT NULL, 826 ts_to integer WITH DEFAULT '0' NOT NULL, 827 note varchar(255) WITH DEFAULT '' NOT NULL, 828 PRIMARY KEY (timeid) 829); 830CREATE INDEX services_times_1 ON services_times (serviceid,type,ts_from,ts_to); 831CREATE TABLE icon_map ( 832 iconmapid bigint NOT NULL, 833 name varchar(64) WITH DEFAULT '' NOT NULL, 834 default_iconid bigint NOT NULL, 835 PRIMARY KEY (iconmapid) 836); 837CREATE UNIQUE INDEX icon_map_1 ON icon_map (name); 838CREATE INDEX icon_map_2 ON icon_map (default_iconid); 839CREATE TABLE icon_mapping ( 840 iconmappingid bigint NOT NULL, 841 iconmapid bigint NOT NULL, 842 iconid bigint NOT NULL, 843 inventory_link integer WITH DEFAULT '0' NOT NULL, 844 expression varchar(64) WITH DEFAULT '' NOT NULL, 845 sortorder integer WITH DEFAULT '0' NOT NULL, 846 PRIMARY KEY (iconmappingid) 847); 848CREATE INDEX icon_mapping_1 ON icon_mapping (iconmapid); 849CREATE INDEX icon_mapping_2 ON icon_mapping (iconid); 850CREATE TABLE sysmaps ( 851 sysmapid bigint NOT NULL, 852 name varchar(128) WITH DEFAULT '' NOT NULL, 853 width integer WITH DEFAULT '600' NOT NULL, 854 height integer WITH DEFAULT '400' NOT NULL, 855 backgroundid bigint NULL, 856 label_type integer WITH DEFAULT '2' NOT NULL, 857 label_location integer WITH DEFAULT '0' NOT NULL, 858 highlight integer WITH DEFAULT '1' NOT NULL, 859 expandproblem integer WITH DEFAULT '1' NOT NULL, 860 markelements integer WITH DEFAULT '0' NOT NULL, 861 show_unack integer WITH DEFAULT '0' NOT NULL, 862 grid_size integer WITH DEFAULT '50' NOT NULL, 863 grid_show integer WITH DEFAULT '1' NOT NULL, 864 grid_align integer WITH DEFAULT '1' NOT NULL, 865 label_format integer WITH DEFAULT '0' NOT NULL, 866 label_type_host integer WITH DEFAULT '2' NOT NULL, 867 label_type_hostgroup integer WITH DEFAULT '2' NOT NULL, 868 label_type_trigger integer WITH DEFAULT '2' NOT NULL, 869 label_type_map integer WITH DEFAULT '2' NOT NULL, 870 label_type_image integer WITH DEFAULT '2' NOT NULL, 871 label_string_host varchar(255) WITH DEFAULT '' NOT NULL, 872 label_string_hostgroup varchar(255) WITH DEFAULT '' NOT NULL, 873 label_string_trigger varchar(255) WITH DEFAULT '' NOT NULL, 874 label_string_map varchar(255) WITH DEFAULT '' NOT NULL, 875 label_string_image varchar(255) WITH DEFAULT '' NOT NULL, 876 iconmapid bigint NULL, 877 expand_macros integer WITH DEFAULT '0' NOT NULL, 878 severity_min integer WITH DEFAULT '0' NOT NULL, 879 userid bigint NOT NULL, 880 private integer WITH DEFAULT '1' NOT NULL, 881 show_suppressed integer WITH DEFAULT '0' NOT NULL, 882 PRIMARY KEY (sysmapid) 883); 884CREATE UNIQUE INDEX sysmaps_1 ON sysmaps (name); 885CREATE INDEX sysmaps_2 ON sysmaps (backgroundid); 886CREATE INDEX sysmaps_3 ON sysmaps (iconmapid); 887CREATE TABLE sysmaps_elements ( 888 selementid bigint NOT NULL, 889 sysmapid bigint NOT NULL, 890 elementid bigint WITH DEFAULT '0' NOT NULL, 891 elementtype integer WITH DEFAULT '0' NOT NULL, 892 iconid_off bigint NULL, 893 iconid_on bigint NULL, 894 label varchar(2048) WITH DEFAULT '' NOT NULL, 895 label_location integer WITH DEFAULT '-1' NOT NULL, 896 x integer WITH DEFAULT '0' NOT NULL, 897 y integer WITH DEFAULT '0' NOT NULL, 898 iconid_disabled bigint NULL, 899 iconid_maintenance bigint NULL, 900 elementsubtype integer WITH DEFAULT '0' NOT NULL, 901 areatype integer WITH DEFAULT '0' NOT NULL, 902 width integer WITH DEFAULT '200' NOT NULL, 903 height integer WITH DEFAULT '200' NOT NULL, 904 viewtype integer WITH DEFAULT '0' NOT NULL, 905 use_iconmap integer WITH DEFAULT '1' NOT NULL, 906 application varchar(255) WITH DEFAULT '' NOT NULL, 907 PRIMARY KEY (selementid) 908); 909CREATE INDEX sysmaps_elements_1 ON sysmaps_elements (sysmapid); 910CREATE INDEX sysmaps_elements_2 ON sysmaps_elements (iconid_off); 911CREATE INDEX sysmaps_elements_3 ON sysmaps_elements (iconid_on); 912CREATE INDEX sysmaps_elements_4 ON sysmaps_elements (iconid_disabled); 913CREATE INDEX sysmaps_elements_5 ON sysmaps_elements (iconid_maintenance); 914CREATE TABLE sysmaps_links ( 915 linkid bigint NOT NULL, 916 sysmapid bigint NOT NULL, 917 selementid1 bigint NOT NULL, 918 selementid2 bigint NOT NULL, 919 drawtype integer WITH DEFAULT '0' NOT NULL, 920 color varchar(6) WITH DEFAULT '000000' NOT NULL, 921 label varchar(2048) WITH DEFAULT '' NOT NULL, 922 PRIMARY KEY (linkid) 923); 924CREATE INDEX sysmaps_links_1 ON sysmaps_links (sysmapid); 925CREATE INDEX sysmaps_links_2 ON sysmaps_links (selementid1); 926CREATE INDEX sysmaps_links_3 ON sysmaps_links (selementid2); 927CREATE TABLE sysmaps_link_triggers ( 928 linktriggerid bigint NOT NULL, 929 linkid bigint NOT NULL, 930 triggerid bigint NOT NULL, 931 drawtype integer WITH DEFAULT '0' NOT NULL, 932 color varchar(6) WITH DEFAULT '000000' NOT NULL, 933 PRIMARY KEY (linktriggerid) 934); 935CREATE UNIQUE INDEX sysmaps_link_triggers_1 ON sysmaps_link_triggers (linkid,triggerid); 936CREATE INDEX sysmaps_link_triggers_2 ON sysmaps_link_triggers (triggerid); 937CREATE TABLE sysmap_element_url ( 938 sysmapelementurlid bigint NOT NULL, 939 selementid bigint NOT NULL, 940 name varchar(255) NOT NULL, 941 url varchar(255) WITH DEFAULT '' NOT NULL, 942 PRIMARY KEY (sysmapelementurlid) 943); 944CREATE UNIQUE INDEX sysmap_element_url_1 ON sysmap_element_url (selementid,name); 945CREATE TABLE sysmap_url ( 946 sysmapurlid bigint NOT NULL, 947 sysmapid bigint NOT NULL, 948 name varchar(255) NOT NULL, 949 url varchar(255) WITH DEFAULT '' NOT NULL, 950 elementtype integer WITH DEFAULT '0' NOT NULL, 951 PRIMARY KEY (sysmapurlid) 952); 953CREATE UNIQUE INDEX sysmap_url_1 ON sysmap_url (sysmapid,name); 954CREATE TABLE sysmap_user ( 955 sysmapuserid bigint NOT NULL, 956 sysmapid bigint NOT NULL, 957 userid bigint NOT NULL, 958 permission integer WITH DEFAULT '2' NOT NULL, 959 PRIMARY KEY (sysmapuserid) 960); 961CREATE UNIQUE INDEX sysmap_user_1 ON sysmap_user (sysmapid,userid); 962CREATE TABLE sysmap_usrgrp ( 963 sysmapusrgrpid bigint NOT NULL, 964 sysmapid bigint NOT NULL, 965 usrgrpid bigint NOT NULL, 966 permission integer WITH DEFAULT '2' NOT NULL, 967 PRIMARY KEY (sysmapusrgrpid) 968); 969CREATE UNIQUE INDEX sysmap_usrgrp_1 ON sysmap_usrgrp (sysmapid,usrgrpid); 970CREATE TABLE maintenances_hosts ( 971 maintenance_hostid bigint NOT NULL, 972 maintenanceid bigint NOT NULL, 973 hostid bigint NOT NULL, 974 PRIMARY KEY (maintenance_hostid) 975); 976CREATE UNIQUE INDEX maintenances_hosts_1 ON maintenances_hosts (maintenanceid,hostid); 977CREATE INDEX maintenances_hosts_2 ON maintenances_hosts (hostid); 978CREATE TABLE maintenances_groups ( 979 maintenance_groupid bigint NOT NULL, 980 maintenanceid bigint NOT NULL, 981 groupid bigint NOT NULL, 982 PRIMARY KEY (maintenance_groupid) 983); 984CREATE UNIQUE INDEX maintenances_groups_1 ON maintenances_groups (maintenanceid,groupid); 985CREATE INDEX maintenances_groups_2 ON maintenances_groups (groupid); 986CREATE TABLE timeperiods ( 987 timeperiodid bigint NOT NULL, 988 timeperiod_type integer WITH DEFAULT '0' NOT NULL, 989 every integer WITH DEFAULT '1' NOT NULL, 990 month integer WITH DEFAULT '0' NOT NULL, 991 dayofweek integer WITH DEFAULT '0' NOT NULL, 992 day integer WITH DEFAULT '0' NOT NULL, 993 start_time integer WITH DEFAULT '0' NOT NULL, 994 period integer WITH DEFAULT '0' NOT NULL, 995 start_date integer WITH DEFAULT '0' NOT NULL, 996 PRIMARY KEY (timeperiodid) 997); 998CREATE TABLE maintenances_windows ( 999 maintenance_timeperiodid bigint NOT NULL, 1000 maintenanceid bigint NOT NULL, 1001 timeperiodid bigint NOT NULL, 1002 PRIMARY KEY (maintenance_timeperiodid) 1003); 1004CREATE UNIQUE INDEX maintenances_windows_1 ON maintenances_windows (maintenanceid,timeperiodid); 1005CREATE INDEX maintenances_windows_2 ON maintenances_windows (timeperiodid); 1006CREATE TABLE regexps ( 1007 regexpid bigint NOT NULL, 1008 name varchar(128) WITH DEFAULT '' NOT NULL, 1009 test_string varchar(2048) WITH DEFAULT '' NOT NULL, 1010 PRIMARY KEY (regexpid) 1011); 1012CREATE UNIQUE INDEX regexps_1 ON regexps (name); 1013CREATE TABLE expressions ( 1014 expressionid bigint NOT NULL, 1015 regexpid bigint NOT NULL, 1016 expression varchar(255) WITH DEFAULT '' NOT NULL, 1017 expression_type integer WITH DEFAULT '0' NOT NULL, 1018 exp_delimiter varchar(1) WITH DEFAULT '' NOT NULL, 1019 case_sensitive integer WITH DEFAULT '0' NOT NULL, 1020 PRIMARY KEY (expressionid) 1021); 1022CREATE INDEX expressions_1 ON expressions (regexpid); 1023CREATE TABLE ids ( 1024 table_name varchar(64) WITH DEFAULT '' NOT NULL, 1025 field_name varchar(64) WITH DEFAULT '' NOT NULL, 1026 nextid bigint NOT NULL, 1027 PRIMARY KEY (table_name,field_name) 1028); 1029CREATE TABLE alerts ( 1030 alertid bigint NOT NULL, 1031 actionid bigint NOT NULL, 1032 eventid bigint NOT NULL, 1033 userid bigint NULL, 1034 clock integer WITH DEFAULT '0' NOT NULL, 1035 mediatypeid bigint NULL, 1036 sendto varchar(1024) WITH DEFAULT '' NOT NULL, 1037 subject varchar(255) WITH DEFAULT '' NOT NULL, 1038 message varchar(2048) WITH DEFAULT '' NOT NULL, 1039 status integer WITH DEFAULT '0' NOT NULL, 1040 retries integer WITH DEFAULT '0' NOT NULL, 1041 error varchar(2048) WITH DEFAULT '' NOT NULL, 1042 esc_step integer WITH DEFAULT '0' NOT NULL, 1043 alerttype integer WITH DEFAULT '0' NOT NULL, 1044 p_eventid bigint NULL, 1045 acknowledgeid bigint NULL, 1046 PRIMARY KEY (alertid) 1047); 1048CREATE INDEX alerts_1 ON alerts (actionid); 1049CREATE INDEX alerts_2 ON alerts (clock); 1050CREATE INDEX alerts_3 ON alerts (eventid); 1051CREATE INDEX alerts_4 ON alerts (status); 1052CREATE INDEX alerts_5 ON alerts (mediatypeid); 1053CREATE INDEX alerts_6 ON alerts (userid); 1054CREATE INDEX alerts_7 ON alerts (p_eventid); 1055CREATE TABLE history ( 1056 itemid bigint NOT NULL, 1057 clock integer WITH DEFAULT '0' NOT NULL, 1058 value decfloat(16) WITH DEFAULT '0.0000' NOT NULL, 1059 ns integer WITH DEFAULT '0' NOT NULL 1060); 1061CREATE INDEX history_1 ON history (itemid,clock); 1062CREATE TABLE history_uint ( 1063 itemid bigint NOT NULL, 1064 clock integer WITH DEFAULT '0' NOT NULL, 1065 value bigint WITH DEFAULT '0' NOT NULL, 1066 ns integer WITH DEFAULT '0' NOT NULL 1067); 1068CREATE INDEX history_uint_1 ON history_uint (itemid,clock); 1069CREATE TABLE history_str ( 1070 itemid bigint NOT NULL, 1071 clock integer WITH DEFAULT '0' NOT NULL, 1072 value varchar(255) WITH DEFAULT '' NOT NULL, 1073 ns integer WITH DEFAULT '0' NOT NULL 1074); 1075CREATE INDEX history_str_1 ON history_str (itemid,clock); 1076CREATE TABLE history_log ( 1077 itemid bigint NOT NULL, 1078 clock integer WITH DEFAULT '0' NOT NULL, 1079 timestamp integer WITH DEFAULT '0' NOT NULL, 1080 source varchar(64) WITH DEFAULT '' NOT NULL, 1081 severity integer WITH DEFAULT '0' NOT NULL, 1082 value varchar(2048) WITH DEFAULT '' NOT NULL, 1083 logeventid integer WITH DEFAULT '0' NOT NULL, 1084 ns integer WITH DEFAULT '0' NOT NULL 1085); 1086CREATE INDEX history_log_1 ON history_log (itemid,clock); 1087CREATE TABLE history_text ( 1088 itemid bigint NOT NULL, 1089 clock integer WITH DEFAULT '0' NOT NULL, 1090 value varchar(2048) WITH DEFAULT '' NOT NULL, 1091 ns integer WITH DEFAULT '0' NOT NULL 1092); 1093CREATE INDEX history_text_1 ON history_text (itemid,clock); 1094CREATE TABLE proxy_history ( 1095 id bigint NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 1), 1096 itemid bigint NOT NULL, 1097 clock integer WITH DEFAULT '0' NOT NULL, 1098 timestamp integer WITH DEFAULT '0' NOT NULL, 1099 source varchar(64) WITH DEFAULT '' NOT NULL, 1100 severity integer WITH DEFAULT '0' NOT NULL, 1101 value varchar(2048) WITH DEFAULT '' NOT NULL, 1102 logeventid integer WITH DEFAULT '0' NOT NULL, 1103 ns integer WITH DEFAULT '0' NOT NULL, 1104 state integer WITH DEFAULT '0' NOT NULL, 1105 lastlogsize bigint WITH DEFAULT '0' NOT NULL, 1106 mtime integer WITH DEFAULT '0' NOT NULL, 1107 flags integer WITH DEFAULT '0' NOT NULL, 1108 PRIMARY KEY (id) 1109); 1110CREATE INDEX proxy_history_1 ON proxy_history (clock); 1111CREATE TABLE proxy_dhistory ( 1112 id bigint NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 1), 1113 clock integer WITH DEFAULT '0' NOT NULL, 1114 druleid bigint NOT NULL, 1115 ip varchar(39) WITH DEFAULT '' NOT NULL, 1116 port integer WITH DEFAULT '0' NOT NULL, 1117 value varchar(255) WITH DEFAULT '' NOT NULL, 1118 status integer WITH DEFAULT '0' NOT NULL, 1119 dcheckid bigint NULL, 1120 dns varchar(255) WITH DEFAULT '' NOT NULL, 1121 PRIMARY KEY (id) 1122); 1123CREATE INDEX proxy_dhistory_1 ON proxy_dhistory (clock); 1124CREATE TABLE events ( 1125 eventid bigint NOT NULL, 1126 source integer WITH DEFAULT '0' NOT NULL, 1127 object integer WITH DEFAULT '0' NOT NULL, 1128 objectid bigint WITH DEFAULT '0' NOT NULL, 1129 clock integer WITH DEFAULT '0' NOT NULL, 1130 value integer WITH DEFAULT '0' NOT NULL, 1131 acknowledged integer WITH DEFAULT '0' NOT NULL, 1132 ns integer WITH DEFAULT '0' NOT NULL, 1133 name varchar(2048) WITH DEFAULT '' NOT NULL, 1134 severity integer WITH DEFAULT '0' NOT NULL, 1135 PRIMARY KEY (eventid) 1136); 1137CREATE INDEX events_1 ON events (source,object,objectid,clock); 1138CREATE INDEX events_2 ON events (source,object,clock); 1139CREATE TABLE trends ( 1140 itemid bigint NOT NULL, 1141 clock integer WITH DEFAULT '0' NOT NULL, 1142 num integer WITH DEFAULT '0' NOT NULL, 1143 value_min decfloat(16) WITH DEFAULT '0.0000' NOT NULL, 1144 value_avg decfloat(16) WITH DEFAULT '0.0000' NOT NULL, 1145 value_max decfloat(16) WITH DEFAULT '0.0000' NOT NULL, 1146 PRIMARY KEY (itemid,clock) 1147); 1148CREATE TABLE trends_uint ( 1149 itemid bigint NOT NULL, 1150 clock integer WITH DEFAULT '0' NOT NULL, 1151 num integer WITH DEFAULT '0' NOT NULL, 1152 value_min bigint WITH DEFAULT '0' NOT NULL, 1153 value_avg bigint WITH DEFAULT '0' NOT NULL, 1154 value_max bigint WITH DEFAULT '0' NOT NULL, 1155 PRIMARY KEY (itemid,clock) 1156); 1157CREATE TABLE acknowledges ( 1158 acknowledgeid bigint NOT NULL, 1159 userid bigint NOT NULL, 1160 eventid bigint NOT NULL, 1161 clock integer WITH DEFAULT '0' NOT NULL, 1162 message varchar(255) WITH DEFAULT '' NOT NULL, 1163 action integer WITH DEFAULT '0' NOT NULL, 1164 old_severity integer WITH DEFAULT '0' NOT NULL, 1165 new_severity integer WITH DEFAULT '0' NOT NULL, 1166 PRIMARY KEY (acknowledgeid) 1167); 1168CREATE INDEX acknowledges_1 ON acknowledges (userid); 1169CREATE INDEX acknowledges_2 ON acknowledges (eventid); 1170CREATE INDEX acknowledges_3 ON acknowledges (clock); 1171CREATE TABLE auditlog ( 1172 auditid bigint NOT NULL, 1173 userid bigint NOT NULL, 1174 clock integer WITH DEFAULT '0' NOT NULL, 1175 action integer WITH DEFAULT '0' NOT NULL, 1176 resourcetype integer WITH DEFAULT '0' NOT NULL, 1177 details varchar(128) WITH DEFAULT '0' NOT NULL, 1178 ip varchar(39) WITH DEFAULT '' NOT NULL, 1179 resourceid bigint WITH DEFAULT '0' NOT NULL, 1180 resourcename varchar(255) WITH DEFAULT '' NOT NULL, 1181 PRIMARY KEY (auditid) 1182); 1183CREATE INDEX auditlog_1 ON auditlog (userid,clock); 1184CREATE INDEX auditlog_2 ON auditlog (clock); 1185CREATE TABLE auditlog_details ( 1186 auditdetailid bigint NOT NULL, 1187 auditid bigint NOT NULL, 1188 table_name varchar(64) WITH DEFAULT '' NOT NULL, 1189 field_name varchar(64) WITH DEFAULT '' NOT NULL, 1190 oldvalue varchar(2048) WITH DEFAULT '' NOT NULL, 1191 newvalue varchar(2048) WITH DEFAULT '' NOT NULL, 1192 PRIMARY KEY (auditdetailid) 1193); 1194CREATE INDEX auditlog_details_1 ON auditlog_details (auditid); 1195CREATE TABLE service_alarms ( 1196 servicealarmid bigint NOT NULL, 1197 serviceid bigint NOT NULL, 1198 clock integer WITH DEFAULT '0' NOT NULL, 1199 value integer WITH DEFAULT '0' NOT NULL, 1200 PRIMARY KEY (servicealarmid) 1201); 1202CREATE INDEX service_alarms_1 ON service_alarms (serviceid,clock); 1203CREATE INDEX service_alarms_2 ON service_alarms (clock); 1204CREATE TABLE autoreg_host ( 1205 autoreg_hostid bigint NOT NULL, 1206 proxy_hostid bigint NULL, 1207 host varchar(64) WITH DEFAULT '' NOT NULL, 1208 listen_ip varchar(39) WITH DEFAULT '' NOT NULL, 1209 listen_port integer WITH DEFAULT '0' NOT NULL, 1210 listen_dns varchar(255) WITH DEFAULT '' NOT NULL, 1211 host_metadata varchar(255) WITH DEFAULT '' NOT NULL, 1212 PRIMARY KEY (autoreg_hostid) 1213); 1214CREATE INDEX autoreg_host_1 ON autoreg_host (host); 1215CREATE INDEX autoreg_host_2 ON autoreg_host (proxy_hostid); 1216CREATE TABLE proxy_autoreg_host ( 1217 id bigint NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 1), 1218 clock integer WITH DEFAULT '0' NOT NULL, 1219 host varchar(64) WITH DEFAULT '' NOT NULL, 1220 listen_ip varchar(39) WITH DEFAULT '' NOT NULL, 1221 listen_port integer WITH DEFAULT '0' NOT NULL, 1222 listen_dns varchar(255) WITH DEFAULT '' NOT NULL, 1223 host_metadata varchar(255) WITH DEFAULT '' NOT NULL, 1224 PRIMARY KEY (id) 1225); 1226CREATE INDEX proxy_autoreg_host_1 ON proxy_autoreg_host (clock); 1227CREATE TABLE dhosts ( 1228 dhostid bigint NOT NULL, 1229 druleid bigint NOT NULL, 1230 status integer WITH DEFAULT '0' NOT NULL, 1231 lastup integer WITH DEFAULT '0' NOT NULL, 1232 lastdown integer WITH DEFAULT '0' NOT NULL, 1233 PRIMARY KEY (dhostid) 1234); 1235CREATE INDEX dhosts_1 ON dhosts (druleid); 1236CREATE TABLE dservices ( 1237 dserviceid bigint NOT NULL, 1238 dhostid bigint NOT NULL, 1239 value varchar(255) WITH DEFAULT '' NOT NULL, 1240 port integer WITH DEFAULT '0' NOT NULL, 1241 status integer WITH DEFAULT '0' NOT NULL, 1242 lastup integer WITH DEFAULT '0' NOT NULL, 1243 lastdown integer WITH DEFAULT '0' NOT NULL, 1244 dcheckid bigint NOT NULL, 1245 ip varchar(39) WITH DEFAULT '' NOT NULL, 1246 dns varchar(255) WITH DEFAULT '' NOT NULL, 1247 PRIMARY KEY (dserviceid) 1248); 1249CREATE UNIQUE INDEX dservices_1 ON dservices (dcheckid,ip,port); 1250CREATE INDEX dservices_2 ON dservices (dhostid); 1251CREATE TABLE escalations ( 1252 escalationid bigint NOT NULL, 1253 actionid bigint NOT NULL, 1254 triggerid bigint NULL, 1255 eventid bigint NULL, 1256 r_eventid bigint NULL, 1257 nextcheck integer WITH DEFAULT '0' NOT NULL, 1258 esc_step integer WITH DEFAULT '0' NOT NULL, 1259 status integer WITH DEFAULT '0' NOT NULL, 1260 itemid bigint NULL, 1261 acknowledgeid bigint NULL, 1262 PRIMARY KEY (escalationid) 1263); 1264CREATE UNIQUE INDEX escalations_1 ON escalations (triggerid,itemid,escalationid); 1265CREATE INDEX escalations_2 ON escalations (eventid); 1266CREATE INDEX escalations_3 ON escalations (nextcheck); 1267CREATE TABLE globalvars ( 1268 globalvarid bigint NOT NULL, 1269 snmp_lastsize bigint WITH DEFAULT '0' NOT NULL, 1270 PRIMARY KEY (globalvarid) 1271); 1272CREATE TABLE graph_discovery ( 1273 graphid bigint NOT NULL, 1274 parent_graphid bigint NOT NULL, 1275 PRIMARY KEY (graphid) 1276); 1277CREATE INDEX graph_discovery_1 ON graph_discovery (parent_graphid); 1278CREATE TABLE host_inventory ( 1279 hostid bigint NOT NULL, 1280 inventory_mode integer WITH DEFAULT '0' NOT NULL, 1281 type varchar(64) WITH DEFAULT '' NOT NULL, 1282 type_full varchar(64) WITH DEFAULT '' NOT NULL, 1283 name varchar(64) WITH DEFAULT '' NOT NULL, 1284 alias varchar(64) WITH DEFAULT '' NOT NULL, 1285 os varchar(64) WITH DEFAULT '' NOT NULL, 1286 os_full varchar(255) WITH DEFAULT '' NOT NULL, 1287 os_short varchar(64) WITH DEFAULT '' NOT NULL, 1288 serialno_a varchar(64) WITH DEFAULT '' NOT NULL, 1289 serialno_b varchar(64) WITH DEFAULT '' NOT NULL, 1290 tag varchar(64) WITH DEFAULT '' NOT NULL, 1291 asset_tag varchar(64) WITH DEFAULT '' NOT NULL, 1292 macaddress_a varchar(64) WITH DEFAULT '' NOT NULL, 1293 macaddress_b varchar(64) WITH DEFAULT '' NOT NULL, 1294 hardware varchar(255) WITH DEFAULT '' NOT NULL, 1295 hardware_full varchar(2048) WITH DEFAULT '' NOT NULL, 1296 software varchar(255) WITH DEFAULT '' NOT NULL, 1297 software_full varchar(2048) WITH DEFAULT '' NOT NULL, 1298 software_app_a varchar(64) WITH DEFAULT '' NOT NULL, 1299 software_app_b varchar(64) WITH DEFAULT '' NOT NULL, 1300 software_app_c varchar(64) WITH DEFAULT '' NOT NULL, 1301 software_app_d varchar(64) WITH DEFAULT '' NOT NULL, 1302 software_app_e varchar(64) WITH DEFAULT '' NOT NULL, 1303 contact varchar(2048) WITH DEFAULT '' NOT NULL, 1304 location varchar(2048) WITH DEFAULT '' NOT NULL, 1305 location_lat varchar(16) WITH DEFAULT '' NOT NULL, 1306 location_lon varchar(16) WITH DEFAULT '' NOT NULL, 1307 notes varchar(2048) WITH DEFAULT '' NOT NULL, 1308 chassis varchar(64) WITH DEFAULT '' NOT NULL, 1309 model varchar(64) WITH DEFAULT '' NOT NULL, 1310 hw_arch varchar(32) WITH DEFAULT '' NOT NULL, 1311 vendor varchar(64) WITH DEFAULT '' NOT NULL, 1312 contract_number varchar(64) WITH DEFAULT '' NOT NULL, 1313 installer_name varchar(64) WITH DEFAULT '' NOT NULL, 1314 deployment_status varchar(64) WITH DEFAULT '' NOT NULL, 1315 url_a varchar(255) WITH DEFAULT '' NOT NULL, 1316 url_b varchar(255) WITH DEFAULT '' NOT NULL, 1317 url_c varchar(255) WITH DEFAULT '' NOT NULL, 1318 host_networks varchar(2048) WITH DEFAULT '' NOT NULL, 1319 host_netmask varchar(39) WITH DEFAULT '' NOT NULL, 1320 host_router varchar(39) WITH DEFAULT '' NOT NULL, 1321 oob_ip varchar(39) WITH DEFAULT '' NOT NULL, 1322 oob_netmask varchar(39) WITH DEFAULT '' NOT NULL, 1323 oob_router varchar(39) WITH DEFAULT '' NOT NULL, 1324 date_hw_purchase varchar(64) WITH DEFAULT '' NOT NULL, 1325 date_hw_install varchar(64) WITH DEFAULT '' NOT NULL, 1326 date_hw_expiry varchar(64) WITH DEFAULT '' NOT NULL, 1327 date_hw_decomm varchar(64) WITH DEFAULT '' NOT NULL, 1328 site_address_a varchar(128) WITH DEFAULT '' NOT NULL, 1329 site_address_b varchar(128) WITH DEFAULT '' NOT NULL, 1330 site_address_c varchar(128) WITH DEFAULT '' NOT NULL, 1331 site_city varchar(128) WITH DEFAULT '' NOT NULL, 1332 site_state varchar(64) WITH DEFAULT '' NOT NULL, 1333 site_country varchar(64) WITH DEFAULT '' NOT NULL, 1334 site_zip varchar(64) WITH DEFAULT '' NOT NULL, 1335 site_rack varchar(128) WITH DEFAULT '' NOT NULL, 1336 site_notes varchar(2048) WITH DEFAULT '' NOT NULL, 1337 poc_1_name varchar(128) WITH DEFAULT '' NOT NULL, 1338 poc_1_email varchar(128) WITH DEFAULT '' NOT NULL, 1339 poc_1_phone_a varchar(64) WITH DEFAULT '' NOT NULL, 1340 poc_1_phone_b varchar(64) WITH DEFAULT '' NOT NULL, 1341 poc_1_cell varchar(64) WITH DEFAULT '' NOT NULL, 1342 poc_1_screen varchar(64) WITH DEFAULT '' NOT NULL, 1343 poc_1_notes varchar(2048) WITH DEFAULT '' NOT NULL, 1344 poc_2_name varchar(128) WITH DEFAULT '' NOT NULL, 1345 poc_2_email varchar(128) WITH DEFAULT '' NOT NULL, 1346 poc_2_phone_a varchar(64) WITH DEFAULT '' NOT NULL, 1347 poc_2_phone_b varchar(64) WITH DEFAULT '' NOT NULL, 1348 poc_2_cell varchar(64) WITH DEFAULT '' NOT NULL, 1349 poc_2_screen varchar(64) WITH DEFAULT '' NOT NULL, 1350 poc_2_notes varchar(2048) WITH DEFAULT '' NOT NULL, 1351 PRIMARY KEY (hostid) 1352); 1353CREATE TABLE housekeeper ( 1354 housekeeperid bigint NOT NULL, 1355 tablename varchar(64) WITH DEFAULT '' NOT NULL, 1356 field varchar(64) WITH DEFAULT '' NOT NULL, 1357 value bigint NOT NULL, 1358 PRIMARY KEY (housekeeperid) 1359); 1360CREATE TABLE images ( 1361 imageid bigint NOT NULL, 1362 imagetype integer WITH DEFAULT '0' NOT NULL, 1363 name varchar(64) WITH DEFAULT '0' NOT NULL, 1364 image blob NOT NULL, 1365 PRIMARY KEY (imageid) 1366); 1367CREATE UNIQUE INDEX images_1 ON images (name); 1368CREATE TABLE item_discovery ( 1369 itemdiscoveryid bigint NOT NULL, 1370 itemid bigint NOT NULL, 1371 parent_itemid bigint NOT NULL, 1372 key_ varchar(255) WITH DEFAULT '' NOT NULL, 1373 lastcheck integer WITH DEFAULT '0' NOT NULL, 1374 ts_delete integer WITH DEFAULT '0' NOT NULL, 1375 PRIMARY KEY (itemdiscoveryid) 1376); 1377CREATE UNIQUE INDEX item_discovery_1 ON item_discovery (itemid,parent_itemid); 1378CREATE INDEX item_discovery_2 ON item_discovery (parent_itemid); 1379CREATE TABLE host_discovery ( 1380 hostid bigint NOT NULL, 1381 parent_hostid bigint NULL, 1382 parent_itemid bigint NULL, 1383 host varchar(64) WITH DEFAULT '' NOT NULL, 1384 lastcheck integer WITH DEFAULT '0' NOT NULL, 1385 ts_delete integer WITH DEFAULT '0' NOT NULL, 1386 PRIMARY KEY (hostid) 1387); 1388CREATE TABLE interface_discovery ( 1389 interfaceid bigint NOT NULL, 1390 parent_interfaceid bigint NOT NULL, 1391 PRIMARY KEY (interfaceid) 1392); 1393CREATE TABLE profiles ( 1394 profileid bigint NOT NULL, 1395 userid bigint NOT NULL, 1396 idx varchar(96) WITH DEFAULT '' NOT NULL, 1397 idx2 bigint WITH DEFAULT '0' NOT NULL, 1398 value_id bigint WITH DEFAULT '0' NOT NULL, 1399 value_int integer WITH DEFAULT '0' NOT NULL, 1400 value_str varchar(255) WITH DEFAULT '' NOT NULL, 1401 source varchar(96) WITH DEFAULT '' NOT NULL, 1402 type integer WITH DEFAULT '0' NOT NULL, 1403 PRIMARY KEY (profileid) 1404); 1405CREATE INDEX profiles_1 ON profiles (userid,idx,idx2); 1406CREATE INDEX profiles_2 ON profiles (userid,profileid); 1407CREATE TABLE sessions ( 1408 sessionid varchar(32) WITH DEFAULT '' NOT NULL, 1409 userid bigint NOT NULL, 1410 lastaccess integer WITH DEFAULT '0' NOT NULL, 1411 status integer WITH DEFAULT '0' NOT NULL, 1412 PRIMARY KEY (sessionid) 1413); 1414CREATE INDEX sessions_1 ON sessions (userid,status,lastaccess); 1415CREATE TABLE trigger_discovery ( 1416 triggerid bigint NOT NULL, 1417 parent_triggerid bigint NOT NULL, 1418 PRIMARY KEY (triggerid) 1419); 1420CREATE INDEX trigger_discovery_1 ON trigger_discovery (parent_triggerid); 1421CREATE TABLE application_template ( 1422 application_templateid bigint NOT NULL, 1423 applicationid bigint NOT NULL, 1424 templateid bigint NOT NULL, 1425 PRIMARY KEY (application_templateid) 1426); 1427CREATE UNIQUE INDEX application_template_1 ON application_template (applicationid,templateid); 1428CREATE INDEX application_template_2 ON application_template (templateid); 1429CREATE TABLE item_condition ( 1430 item_conditionid bigint NOT NULL, 1431 itemid bigint NOT NULL, 1432 operator integer WITH DEFAULT '8' NOT NULL, 1433 macro varchar(64) WITH DEFAULT '' NOT NULL, 1434 value varchar(255) WITH DEFAULT '' NOT NULL, 1435 PRIMARY KEY (item_conditionid) 1436); 1437CREATE INDEX item_condition_1 ON item_condition (itemid); 1438CREATE TABLE application_prototype ( 1439 application_prototypeid bigint NOT NULL, 1440 itemid bigint NOT NULL, 1441 templateid bigint NULL, 1442 name varchar(255) WITH DEFAULT '' NOT NULL, 1443 PRIMARY KEY (application_prototypeid) 1444); 1445CREATE INDEX application_prototype_1 ON application_prototype (itemid); 1446CREATE INDEX application_prototype_2 ON application_prototype (templateid); 1447CREATE TABLE item_application_prototype ( 1448 item_application_prototypeid bigint NOT NULL, 1449 application_prototypeid bigint NOT NULL, 1450 itemid bigint NOT NULL, 1451 PRIMARY KEY (item_application_prototypeid) 1452); 1453CREATE UNIQUE INDEX item_application_prototype_1 ON item_application_prototype (application_prototypeid,itemid); 1454CREATE INDEX item_application_prototype_2 ON item_application_prototype (itemid); 1455CREATE TABLE application_discovery ( 1456 application_discoveryid bigint NOT NULL, 1457 applicationid bigint NOT NULL, 1458 application_prototypeid bigint NOT NULL, 1459 name varchar(255) WITH DEFAULT '' NOT NULL, 1460 lastcheck integer WITH DEFAULT '0' NOT NULL, 1461 ts_delete integer WITH DEFAULT '0' NOT NULL, 1462 PRIMARY KEY (application_discoveryid) 1463); 1464CREATE INDEX application_discovery_1 ON application_discovery (applicationid); 1465CREATE INDEX application_discovery_2 ON application_discovery (application_prototypeid); 1466CREATE TABLE opinventory ( 1467 operationid bigint NOT NULL, 1468 inventory_mode integer WITH DEFAULT '0' NOT NULL, 1469 PRIMARY KEY (operationid) 1470); 1471CREATE TABLE trigger_tag ( 1472 triggertagid bigint NOT NULL, 1473 triggerid bigint NOT NULL, 1474 tag varchar(255) WITH DEFAULT '' NOT NULL, 1475 value varchar(255) WITH DEFAULT '' NOT NULL, 1476 PRIMARY KEY (triggertagid) 1477); 1478CREATE INDEX trigger_tag_1 ON trigger_tag (triggerid); 1479CREATE TABLE event_tag ( 1480 eventtagid bigint NOT NULL, 1481 eventid bigint NOT NULL, 1482 tag varchar(255) WITH DEFAULT '' NOT NULL, 1483 value varchar(255) WITH DEFAULT '' NOT NULL, 1484 PRIMARY KEY (eventtagid) 1485); 1486CREATE INDEX event_tag_1 ON event_tag (eventid); 1487CREATE TABLE problem ( 1488 eventid bigint NOT NULL, 1489 source integer WITH DEFAULT '0' NOT NULL, 1490 object integer WITH DEFAULT '0' NOT NULL, 1491 objectid bigint WITH DEFAULT '0' NOT NULL, 1492 clock integer WITH DEFAULT '0' NOT NULL, 1493 ns integer WITH DEFAULT '0' NOT NULL, 1494 r_eventid bigint NULL, 1495 r_clock integer WITH DEFAULT '0' NOT NULL, 1496 r_ns integer WITH DEFAULT '0' NOT NULL, 1497 correlationid bigint NULL, 1498 userid bigint NULL, 1499 name varchar(2048) WITH DEFAULT '' NOT NULL, 1500 acknowledged integer WITH DEFAULT '0' NOT NULL, 1501 severity integer WITH DEFAULT '0' NOT NULL, 1502 PRIMARY KEY (eventid) 1503); 1504CREATE INDEX problem_1 ON problem (source,object,objectid); 1505CREATE INDEX problem_2 ON problem (r_clock); 1506CREATE INDEX problem_3 ON problem (r_eventid); 1507CREATE TABLE problem_tag ( 1508 problemtagid bigint NOT NULL, 1509 eventid bigint NOT NULL, 1510 tag varchar(255) WITH DEFAULT '' NOT NULL, 1511 value varchar(255) WITH DEFAULT '' NOT NULL, 1512 PRIMARY KEY (problemtagid) 1513); 1514CREATE INDEX problem_tag_1 ON problem_tag (eventid,tag,value); 1515CREATE TABLE tag_filter ( 1516 tag_filterid bigint NOT NULL, 1517 usrgrpid bigint NOT NULL, 1518 groupid bigint NOT NULL, 1519 tag varchar(255) WITH DEFAULT '' NOT NULL, 1520 value varchar(255) WITH DEFAULT '' NOT NULL, 1521 PRIMARY KEY (tag_filterid) 1522); 1523CREATE TABLE event_recovery ( 1524 eventid bigint NOT NULL, 1525 r_eventid bigint NOT NULL, 1526 c_eventid bigint NULL, 1527 correlationid bigint NULL, 1528 userid bigint NULL, 1529 PRIMARY KEY (eventid) 1530); 1531CREATE INDEX event_recovery_1 ON event_recovery (r_eventid); 1532CREATE INDEX event_recovery_2 ON event_recovery (c_eventid); 1533CREATE TABLE correlation ( 1534 correlationid bigint NOT NULL, 1535 name varchar(255) WITH DEFAULT '' NOT NULL, 1536 description varchar(2048) WITH DEFAULT '' NOT NULL, 1537 evaltype integer WITH DEFAULT '0' NOT NULL, 1538 status integer WITH DEFAULT '0' NOT NULL, 1539 formula varchar(255) WITH DEFAULT '' NOT NULL, 1540 PRIMARY KEY (correlationid) 1541); 1542CREATE INDEX correlation_1 ON correlation (status); 1543CREATE UNIQUE INDEX correlation_2 ON correlation (name); 1544CREATE TABLE corr_condition ( 1545 corr_conditionid bigint NOT NULL, 1546 correlationid bigint NOT NULL, 1547 type integer WITH DEFAULT '0' NOT NULL, 1548 PRIMARY KEY (corr_conditionid) 1549); 1550CREATE INDEX corr_condition_1 ON corr_condition (correlationid); 1551CREATE TABLE corr_condition_tag ( 1552 corr_conditionid bigint NOT NULL, 1553 tag varchar(255) WITH DEFAULT '' NOT NULL, 1554 PRIMARY KEY (corr_conditionid) 1555); 1556CREATE TABLE corr_condition_group ( 1557 corr_conditionid bigint NOT NULL, 1558 operator integer WITH DEFAULT '0' NOT NULL, 1559 groupid bigint NOT NULL, 1560 PRIMARY KEY (corr_conditionid) 1561); 1562CREATE INDEX corr_condition_group_1 ON corr_condition_group (groupid); 1563CREATE TABLE corr_condition_tagpair ( 1564 corr_conditionid bigint NOT NULL, 1565 oldtag varchar(255) WITH DEFAULT '' NOT NULL, 1566 newtag varchar(255) WITH DEFAULT '' NOT NULL, 1567 PRIMARY KEY (corr_conditionid) 1568); 1569CREATE TABLE corr_condition_tagvalue ( 1570 corr_conditionid bigint NOT NULL, 1571 tag varchar(255) WITH DEFAULT '' NOT NULL, 1572 operator integer WITH DEFAULT '0' NOT NULL, 1573 value varchar(255) WITH DEFAULT '' NOT NULL, 1574 PRIMARY KEY (corr_conditionid) 1575); 1576CREATE TABLE corr_operation ( 1577 corr_operationid bigint NOT NULL, 1578 correlationid bigint NOT NULL, 1579 type integer WITH DEFAULT '0' NOT NULL, 1580 PRIMARY KEY (corr_operationid) 1581); 1582CREATE INDEX corr_operation_1 ON corr_operation (correlationid); 1583CREATE TABLE task ( 1584 taskid bigint NOT NULL, 1585 type integer NOT NULL, 1586 status integer WITH DEFAULT '0' NOT NULL, 1587 clock integer WITH DEFAULT '0' NOT NULL, 1588 ttl integer WITH DEFAULT '0' NOT NULL, 1589 proxy_hostid bigint NULL, 1590 PRIMARY KEY (taskid) 1591); 1592CREATE INDEX task_1 ON task (status,proxy_hostid); 1593CREATE TABLE task_close_problem ( 1594 taskid bigint NOT NULL, 1595 acknowledgeid bigint NOT NULL, 1596 PRIMARY KEY (taskid) 1597); 1598CREATE TABLE item_preproc ( 1599 item_preprocid bigint NOT NULL, 1600 itemid bigint NOT NULL, 1601 step integer WITH DEFAULT '0' NOT NULL, 1602 type integer WITH DEFAULT '0' NOT NULL, 1603 params varchar(255) WITH DEFAULT '' NOT NULL, 1604 PRIMARY KEY (item_preprocid) 1605); 1606CREATE INDEX item_preproc_1 ON item_preproc (itemid,step); 1607CREATE TABLE task_remote_command ( 1608 taskid bigint NOT NULL, 1609 command_type integer WITH DEFAULT '0' NOT NULL, 1610 execute_on integer WITH DEFAULT '0' NOT NULL, 1611 port integer WITH DEFAULT '0' NOT NULL, 1612 authtype integer WITH DEFAULT '0' NOT NULL, 1613 username varchar(64) WITH DEFAULT '' NOT NULL, 1614 password varchar(64) WITH DEFAULT '' NOT NULL, 1615 publickey varchar(64) WITH DEFAULT '' NOT NULL, 1616 privatekey varchar(64) WITH DEFAULT '' NOT NULL, 1617 command varchar(2048) WITH DEFAULT '' NOT NULL, 1618 alertid bigint NULL, 1619 parent_taskid bigint NOT NULL, 1620 hostid bigint NOT NULL, 1621 PRIMARY KEY (taskid) 1622); 1623CREATE TABLE task_remote_command_result ( 1624 taskid bigint NOT NULL, 1625 status integer WITH DEFAULT '0' NOT NULL, 1626 parent_taskid bigint NOT NULL, 1627 info varchar(2048) WITH DEFAULT '' NOT NULL, 1628 PRIMARY KEY (taskid) 1629); 1630CREATE TABLE task_acknowledge ( 1631 taskid bigint NOT NULL, 1632 acknowledgeid bigint NOT NULL, 1633 PRIMARY KEY (taskid) 1634); 1635CREATE TABLE sysmap_shape ( 1636 sysmap_shapeid bigint NOT NULL, 1637 sysmapid bigint NOT NULL, 1638 type integer WITH DEFAULT '0' NOT NULL, 1639 x integer WITH DEFAULT '0' NOT NULL, 1640 y integer WITH DEFAULT '0' NOT NULL, 1641 width integer WITH DEFAULT '200' NOT NULL, 1642 height integer WITH DEFAULT '200' NOT NULL, 1643 text varchar(2048) WITH DEFAULT '' NOT NULL, 1644 font integer WITH DEFAULT '9' NOT NULL, 1645 font_size integer WITH DEFAULT '11' NOT NULL, 1646 font_color varchar(6) WITH DEFAULT '000000' NOT NULL, 1647 text_halign integer WITH DEFAULT '0' NOT NULL, 1648 text_valign integer WITH DEFAULT '0' NOT NULL, 1649 border_type integer WITH DEFAULT '0' NOT NULL, 1650 border_width integer WITH DEFAULT '1' NOT NULL, 1651 border_color varchar(6) WITH DEFAULT '000000' NOT NULL, 1652 background_color varchar(6) WITH DEFAULT '' NOT NULL, 1653 zindex integer WITH DEFAULT '0' NOT NULL, 1654 PRIMARY KEY (sysmap_shapeid) 1655); 1656CREATE INDEX sysmap_shape_1 ON sysmap_shape (sysmapid); 1657CREATE TABLE sysmap_element_trigger ( 1658 selement_triggerid bigint NOT NULL, 1659 selementid bigint NOT NULL, 1660 triggerid bigint NOT NULL, 1661 PRIMARY KEY (selement_triggerid) 1662); 1663CREATE UNIQUE INDEX sysmap_element_trigger_1 ON sysmap_element_trigger (selementid,triggerid); 1664CREATE TABLE httptest_field ( 1665 httptest_fieldid bigint NOT NULL, 1666 httptestid bigint NOT NULL, 1667 type integer WITH DEFAULT '0' NOT NULL, 1668 name varchar(255) WITH DEFAULT '' NOT NULL, 1669 value varchar(2048) WITH DEFAULT '' NOT NULL, 1670 PRIMARY KEY (httptest_fieldid) 1671); 1672CREATE INDEX httptest_field_1 ON httptest_field (httptestid); 1673CREATE TABLE httpstep_field ( 1674 httpstep_fieldid bigint NOT NULL, 1675 httpstepid bigint NOT NULL, 1676 type integer WITH DEFAULT '0' NOT NULL, 1677 name varchar(255) WITH DEFAULT '' NOT NULL, 1678 value varchar(2048) WITH DEFAULT '' NOT NULL, 1679 PRIMARY KEY (httpstep_fieldid) 1680); 1681CREATE INDEX httpstep_field_1 ON httpstep_field (httpstepid); 1682CREATE TABLE dashboard ( 1683 dashboardid bigint NOT NULL, 1684 name varchar(255) NOT NULL, 1685 userid bigint NOT NULL, 1686 private integer WITH DEFAULT '1' NOT NULL, 1687 PRIMARY KEY (dashboardid) 1688); 1689CREATE TABLE dashboard_user ( 1690 dashboard_userid bigint NOT NULL, 1691 dashboardid bigint NOT NULL, 1692 userid bigint NOT NULL, 1693 permission integer WITH DEFAULT '2' NOT NULL, 1694 PRIMARY KEY (dashboard_userid) 1695); 1696CREATE UNIQUE INDEX dashboard_user_1 ON dashboard_user (dashboardid,userid); 1697CREATE TABLE dashboard_usrgrp ( 1698 dashboard_usrgrpid bigint NOT NULL, 1699 dashboardid bigint NOT NULL, 1700 usrgrpid bigint NOT NULL, 1701 permission integer WITH DEFAULT '2' NOT NULL, 1702 PRIMARY KEY (dashboard_usrgrpid) 1703); 1704CREATE UNIQUE INDEX dashboard_usrgrp_1 ON dashboard_usrgrp (dashboardid,usrgrpid); 1705CREATE TABLE widget ( 1706 widgetid bigint NOT NULL, 1707 dashboardid bigint NOT NULL, 1708 type varchar(255) WITH DEFAULT '' NOT NULL, 1709 name varchar(255) WITH DEFAULT '' NOT NULL, 1710 x integer WITH DEFAULT '0' NOT NULL, 1711 y integer WITH DEFAULT '0' NOT NULL, 1712 width integer WITH DEFAULT '1' NOT NULL, 1713 height integer WITH DEFAULT '1' NOT NULL, 1714 PRIMARY KEY (widgetid) 1715); 1716CREATE INDEX widget_1 ON widget (dashboardid); 1717CREATE TABLE widget_field ( 1718 widget_fieldid bigint NOT NULL, 1719 widgetid bigint NOT NULL, 1720 type integer WITH DEFAULT '0' NOT NULL, 1721 name varchar(255) WITH DEFAULT '' NOT NULL, 1722 value_int integer WITH DEFAULT '0' NOT NULL, 1723 value_str varchar(255) WITH DEFAULT '' NOT NULL, 1724 value_groupid bigint NULL, 1725 value_hostid bigint NULL, 1726 value_itemid bigint NULL, 1727 value_graphid bigint NULL, 1728 value_sysmapid bigint NULL, 1729 PRIMARY KEY (widget_fieldid) 1730); 1731CREATE INDEX widget_field_1 ON widget_field (widgetid); 1732CREATE INDEX widget_field_2 ON widget_field (value_groupid); 1733CREATE INDEX widget_field_3 ON widget_field (value_hostid); 1734CREATE INDEX widget_field_4 ON widget_field (value_itemid); 1735CREATE INDEX widget_field_5 ON widget_field (value_graphid); 1736CREATE INDEX widget_field_6 ON widget_field (value_sysmapid); 1737CREATE TABLE task_check_now ( 1738 taskid bigint NOT NULL, 1739 itemid bigint NOT NULL, 1740 PRIMARY KEY (taskid) 1741); 1742CREATE TABLE event_suppress ( 1743 event_suppressid bigint NOT NULL, 1744 eventid bigint NOT NULL, 1745 maintenanceid bigint NULL, 1746 suppress_until integer WITH DEFAULT '0' NOT NULL, 1747 PRIMARY KEY (event_suppressid) 1748); 1749CREATE UNIQUE INDEX event_suppress_1 ON event_suppress (eventid,maintenanceid); 1750CREATE INDEX event_suppress_2 ON event_suppress (suppress_until); 1751CREATE INDEX event_suppress_3 ON event_suppress (maintenanceid); 1752CREATE TABLE maintenance_tag ( 1753 maintenancetagid bigint NOT NULL, 1754 maintenanceid bigint NOT NULL, 1755 tag varchar(255) WITH DEFAULT '' NOT NULL, 1756 operator integer WITH DEFAULT '2' NOT NULL, 1757 value varchar(255) WITH DEFAULT '' NOT NULL, 1758 PRIMARY KEY (maintenancetagid) 1759); 1760CREATE INDEX maintenance_tag_1 ON maintenance_tag (maintenanceid); 1761CREATE TABLE dbversion ( 1762 mandatory integer WITH DEFAULT '0' NOT NULL, 1763 optional integer WITH DEFAULT '0' NOT NULL 1764); 1765INSERT INTO dbversion VALUES ('4000000','4000006'); 1766ALTER TABLE hosts ADD CONSTRAINT c_hosts_1 FOREIGN KEY (proxy_hostid) REFERENCES hosts (hostid); 1767ALTER TABLE hosts ADD CONSTRAINT c_hosts_2 FOREIGN KEY (maintenanceid) REFERENCES maintenances (maintenanceid); 1768ALTER TABLE hosts ADD CONSTRAINT c_hosts_3 FOREIGN KEY (templateid) REFERENCES hosts (hostid) ON DELETE CASCADE; 1769ALTER TABLE group_prototype ADD CONSTRAINT c_group_prototype_1 FOREIGN KEY (hostid) REFERENCES hosts (hostid) ON DELETE CASCADE; 1770ALTER TABLE group_prototype ADD CONSTRAINT c_group_prototype_2 FOREIGN KEY (groupid) REFERENCES hstgrp (groupid); 1771ALTER TABLE group_prototype ADD CONSTRAINT c_group_prototype_3 FOREIGN KEY (templateid) REFERENCES group_prototype (group_prototypeid) ON DELETE CASCADE; 1772ALTER TABLE group_discovery ADD CONSTRAINT c_group_discovery_1 FOREIGN KEY (groupid) REFERENCES hstgrp (groupid) ON DELETE CASCADE; 1773ALTER TABLE group_discovery ADD CONSTRAINT c_group_discovery_2 FOREIGN KEY (parent_group_prototypeid) REFERENCES group_prototype (group_prototypeid); 1774ALTER TABLE screens ADD CONSTRAINT c_screens_1 FOREIGN KEY (templateid) REFERENCES hosts (hostid) ON DELETE CASCADE; 1775ALTER TABLE screens ADD CONSTRAINT c_screens_3 FOREIGN KEY (userid) REFERENCES users (userid); 1776ALTER TABLE screens_items ADD CONSTRAINT c_screens_items_1 FOREIGN KEY (screenid) REFERENCES screens (screenid) ON DELETE CASCADE; 1777ALTER TABLE screen_user ADD CONSTRAINT c_screen_user_1 FOREIGN KEY (screenid) REFERENCES screens (screenid) ON DELETE CASCADE; 1778ALTER TABLE screen_user ADD CONSTRAINT c_screen_user_2 FOREIGN KEY (userid) REFERENCES users (userid) ON DELETE CASCADE; 1779ALTER TABLE screen_usrgrp ADD CONSTRAINT c_screen_usrgrp_1 FOREIGN KEY (screenid) REFERENCES screens (screenid) ON DELETE CASCADE; 1780ALTER TABLE screen_usrgrp ADD CONSTRAINT c_screen_usrgrp_2 FOREIGN KEY (usrgrpid) REFERENCES usrgrp (usrgrpid) ON DELETE CASCADE; 1781ALTER TABLE slideshows ADD CONSTRAINT c_slideshows_3 FOREIGN KEY (userid) REFERENCES users (userid); 1782ALTER TABLE slideshow_user ADD CONSTRAINT c_slideshow_user_1 FOREIGN KEY (slideshowid) REFERENCES slideshows (slideshowid) ON DELETE CASCADE; 1783ALTER TABLE slideshow_user ADD CONSTRAINT c_slideshow_user_2 FOREIGN KEY (userid) REFERENCES users (userid) ON DELETE CASCADE; 1784ALTER TABLE slideshow_usrgrp ADD CONSTRAINT c_slideshow_usrgrp_1 FOREIGN KEY (slideshowid) REFERENCES slideshows (slideshowid) ON DELETE CASCADE; 1785ALTER TABLE slideshow_usrgrp ADD CONSTRAINT c_slideshow_usrgrp_2 FOREIGN KEY (usrgrpid) REFERENCES usrgrp (usrgrpid) ON DELETE CASCADE; 1786ALTER TABLE slides ADD CONSTRAINT c_slides_1 FOREIGN KEY (slideshowid) REFERENCES slideshows (slideshowid) ON DELETE CASCADE; 1787ALTER TABLE slides ADD CONSTRAINT c_slides_2 FOREIGN KEY (screenid) REFERENCES screens (screenid) ON DELETE CASCADE; 1788ALTER TABLE drules ADD CONSTRAINT c_drules_1 FOREIGN KEY (proxy_hostid) REFERENCES hosts (hostid); 1789ALTER TABLE dchecks ADD CONSTRAINT c_dchecks_1 FOREIGN KEY (druleid) REFERENCES drules (druleid) ON DELETE CASCADE; 1790ALTER TABLE applications ADD CONSTRAINT c_applications_1 FOREIGN KEY (hostid) REFERENCES hosts (hostid) ON DELETE CASCADE; 1791ALTER TABLE httptest ADD CONSTRAINT c_httptest_1 FOREIGN KEY (applicationid) REFERENCES applications (applicationid); 1792ALTER TABLE httptest ADD CONSTRAINT c_httptest_2 FOREIGN KEY (hostid) REFERENCES hosts (hostid) ON DELETE CASCADE; 1793ALTER TABLE httptest ADD CONSTRAINT c_httptest_3 FOREIGN KEY (templateid) REFERENCES httptest (httptestid) ON DELETE CASCADE; 1794ALTER TABLE httpstep ADD CONSTRAINT c_httpstep_1 FOREIGN KEY (httptestid) REFERENCES httptest (httptestid) ON DELETE CASCADE; 1795ALTER TABLE interface ADD CONSTRAINT c_interface_1 FOREIGN KEY (hostid) REFERENCES hosts (hostid) ON DELETE CASCADE; 1796ALTER TABLE items ADD CONSTRAINT c_items_1 FOREIGN KEY (hostid) REFERENCES hosts (hostid) ON DELETE CASCADE; 1797ALTER TABLE items ADD CONSTRAINT c_items_2 FOREIGN KEY (templateid) REFERENCES items (itemid) ON DELETE CASCADE; 1798ALTER TABLE items ADD CONSTRAINT c_items_3 FOREIGN KEY (valuemapid) REFERENCES valuemaps (valuemapid); 1799ALTER TABLE items ADD CONSTRAINT c_items_4 FOREIGN KEY (interfaceid) REFERENCES interface (interfaceid); 1800ALTER TABLE items ADD CONSTRAINT c_items_5 FOREIGN KEY (master_itemid) REFERENCES items (itemid) ON DELETE CASCADE; 1801ALTER TABLE httpstepitem ADD CONSTRAINT c_httpstepitem_1 FOREIGN KEY (httpstepid) REFERENCES httpstep (httpstepid) ON DELETE CASCADE; 1802ALTER TABLE httpstepitem ADD CONSTRAINT c_httpstepitem_2 FOREIGN KEY (itemid) REFERENCES items (itemid) ON DELETE CASCADE; 1803ALTER TABLE httptestitem ADD CONSTRAINT c_httptestitem_1 FOREIGN KEY (httptestid) REFERENCES httptest (httptestid) ON DELETE CASCADE; 1804ALTER TABLE httptestitem ADD CONSTRAINT c_httptestitem_2 FOREIGN KEY (itemid) REFERENCES items (itemid) ON DELETE CASCADE; 1805ALTER TABLE users_groups ADD CONSTRAINT c_users_groups_1 FOREIGN KEY (usrgrpid) REFERENCES usrgrp (usrgrpid) ON DELETE CASCADE; 1806ALTER TABLE users_groups ADD CONSTRAINT c_users_groups_2 FOREIGN KEY (userid) REFERENCES users (userid) ON DELETE CASCADE; 1807ALTER TABLE scripts ADD CONSTRAINT c_scripts_1 FOREIGN KEY (usrgrpid) REFERENCES usrgrp (usrgrpid); 1808ALTER TABLE scripts ADD CONSTRAINT c_scripts_2 FOREIGN KEY (groupid) REFERENCES hstgrp (groupid); 1809ALTER TABLE operations ADD CONSTRAINT c_operations_1 FOREIGN KEY (actionid) REFERENCES actions (actionid) ON DELETE CASCADE; 1810ALTER TABLE opmessage ADD CONSTRAINT c_opmessage_1 FOREIGN KEY (operationid) REFERENCES operations (operationid) ON DELETE CASCADE; 1811ALTER TABLE opmessage ADD CONSTRAINT c_opmessage_2 FOREIGN KEY (mediatypeid) REFERENCES media_type (mediatypeid); 1812ALTER TABLE opmessage_grp ADD CONSTRAINT c_opmessage_grp_1 FOREIGN KEY (operationid) REFERENCES operations (operationid) ON DELETE CASCADE; 1813ALTER TABLE opmessage_grp ADD CONSTRAINT c_opmessage_grp_2 FOREIGN KEY (usrgrpid) REFERENCES usrgrp (usrgrpid); 1814ALTER TABLE opmessage_usr ADD CONSTRAINT c_opmessage_usr_1 FOREIGN KEY (operationid) REFERENCES operations (operationid) ON DELETE CASCADE; 1815ALTER TABLE opmessage_usr ADD CONSTRAINT c_opmessage_usr_2 FOREIGN KEY (userid) REFERENCES users (userid); 1816ALTER TABLE opcommand ADD CONSTRAINT c_opcommand_1 FOREIGN KEY (operationid) REFERENCES operations (operationid) ON DELETE CASCADE; 1817ALTER TABLE opcommand ADD CONSTRAINT c_opcommand_2 FOREIGN KEY (scriptid) REFERENCES scripts (scriptid); 1818ALTER TABLE opcommand_hst ADD CONSTRAINT c_opcommand_hst_1 FOREIGN KEY (operationid) REFERENCES operations (operationid) ON DELETE CASCADE; 1819ALTER TABLE opcommand_hst ADD CONSTRAINT c_opcommand_hst_2 FOREIGN KEY (hostid) REFERENCES hosts (hostid); 1820ALTER TABLE opcommand_grp ADD CONSTRAINT c_opcommand_grp_1 FOREIGN KEY (operationid) REFERENCES operations (operationid) ON DELETE CASCADE; 1821ALTER TABLE opcommand_grp ADD CONSTRAINT c_opcommand_grp_2 FOREIGN KEY (groupid) REFERENCES hstgrp (groupid); 1822ALTER TABLE opgroup ADD CONSTRAINT c_opgroup_1 FOREIGN KEY (operationid) REFERENCES operations (operationid) ON DELETE CASCADE; 1823ALTER TABLE opgroup ADD CONSTRAINT c_opgroup_2 FOREIGN KEY (groupid) REFERENCES hstgrp (groupid); 1824ALTER TABLE optemplate ADD CONSTRAINT c_optemplate_1 FOREIGN KEY (operationid) REFERENCES operations (operationid) ON DELETE CASCADE; 1825ALTER TABLE optemplate ADD CONSTRAINT c_optemplate_2 FOREIGN KEY (templateid) REFERENCES hosts (hostid); 1826ALTER TABLE opconditions ADD CONSTRAINT c_opconditions_1 FOREIGN KEY (operationid) REFERENCES operations (operationid) ON DELETE CASCADE; 1827ALTER TABLE conditions ADD CONSTRAINT c_conditions_1 FOREIGN KEY (actionid) REFERENCES actions (actionid) ON DELETE CASCADE; 1828ALTER TABLE config ADD CONSTRAINT c_config_1 FOREIGN KEY (alert_usrgrpid) REFERENCES usrgrp (usrgrpid); 1829ALTER TABLE config ADD CONSTRAINT c_config_2 FOREIGN KEY (discovery_groupid) REFERENCES hstgrp (groupid); 1830ALTER TABLE triggers ADD CONSTRAINT c_triggers_1 FOREIGN KEY (templateid) REFERENCES triggers (triggerid) ON DELETE CASCADE; 1831ALTER TABLE trigger_depends ADD CONSTRAINT c_trigger_depends_1 FOREIGN KEY (triggerid_down) REFERENCES triggers (triggerid) ON DELETE CASCADE; 1832ALTER TABLE trigger_depends ADD CONSTRAINT c_trigger_depends_2 FOREIGN KEY (triggerid_up) REFERENCES triggers (triggerid) ON DELETE CASCADE; 1833ALTER TABLE functions ADD CONSTRAINT c_functions_1 FOREIGN KEY (itemid) REFERENCES items (itemid) ON DELETE CASCADE; 1834ALTER TABLE functions ADD CONSTRAINT c_functions_2 FOREIGN KEY (triggerid) REFERENCES triggers (triggerid) ON DELETE CASCADE; 1835ALTER TABLE graphs ADD CONSTRAINT c_graphs_1 FOREIGN KEY (templateid) REFERENCES graphs (graphid) ON DELETE CASCADE; 1836ALTER TABLE graphs ADD CONSTRAINT c_graphs_2 FOREIGN KEY (ymin_itemid) REFERENCES items (itemid); 1837ALTER TABLE graphs ADD CONSTRAINT c_graphs_3 FOREIGN KEY (ymax_itemid) REFERENCES items (itemid); 1838ALTER TABLE graphs_items ADD CONSTRAINT c_graphs_items_1 FOREIGN KEY (graphid) REFERENCES graphs (graphid) ON DELETE CASCADE; 1839ALTER TABLE graphs_items ADD CONSTRAINT c_graphs_items_2 FOREIGN KEY (itemid) REFERENCES items (itemid) ON DELETE CASCADE; 1840ALTER TABLE hostmacro ADD CONSTRAINT c_hostmacro_1 FOREIGN KEY (hostid) REFERENCES hosts (hostid) ON DELETE CASCADE; 1841ALTER TABLE hosts_groups ADD CONSTRAINT c_hosts_groups_1 FOREIGN KEY (hostid) REFERENCES hosts (hostid) ON DELETE CASCADE; 1842ALTER TABLE hosts_groups ADD CONSTRAINT c_hosts_groups_2 FOREIGN KEY (groupid) REFERENCES hstgrp (groupid) ON DELETE CASCADE; 1843ALTER TABLE hosts_templates ADD CONSTRAINT c_hosts_templates_1 FOREIGN KEY (hostid) REFERENCES hosts (hostid) ON DELETE CASCADE; 1844ALTER TABLE hosts_templates ADD CONSTRAINT c_hosts_templates_2 FOREIGN KEY (templateid) REFERENCES hosts (hostid) ON DELETE CASCADE; 1845ALTER TABLE items_applications ADD CONSTRAINT c_items_applications_1 FOREIGN KEY (applicationid) REFERENCES applications (applicationid) ON DELETE CASCADE; 1846ALTER TABLE items_applications ADD CONSTRAINT c_items_applications_2 FOREIGN KEY (itemid) REFERENCES items (itemid) ON DELETE CASCADE; 1847ALTER TABLE mappings ADD CONSTRAINT c_mappings_1 FOREIGN KEY (valuemapid) REFERENCES valuemaps (valuemapid) ON DELETE CASCADE; 1848ALTER TABLE media ADD CONSTRAINT c_media_1 FOREIGN KEY (userid) REFERENCES users (userid) ON DELETE CASCADE; 1849ALTER TABLE media ADD CONSTRAINT c_media_2 FOREIGN KEY (mediatypeid) REFERENCES media_type (mediatypeid) ON DELETE CASCADE; 1850ALTER TABLE rights ADD CONSTRAINT c_rights_1 FOREIGN KEY (groupid) REFERENCES usrgrp (usrgrpid) ON DELETE CASCADE; 1851ALTER TABLE rights ADD CONSTRAINT c_rights_2 FOREIGN KEY (id) REFERENCES hstgrp (groupid) ON DELETE CASCADE; 1852ALTER TABLE services ADD CONSTRAINT c_services_1 FOREIGN KEY (triggerid) REFERENCES triggers (triggerid) ON DELETE CASCADE; 1853ALTER TABLE services_links ADD CONSTRAINT c_services_links_1 FOREIGN KEY (serviceupid) REFERENCES services (serviceid) ON DELETE CASCADE; 1854ALTER TABLE services_links ADD CONSTRAINT c_services_links_2 FOREIGN KEY (servicedownid) REFERENCES services (serviceid) ON DELETE CASCADE; 1855ALTER TABLE services_times ADD CONSTRAINT c_services_times_1 FOREIGN KEY (serviceid) REFERENCES services (serviceid) ON DELETE CASCADE; 1856ALTER TABLE icon_map ADD CONSTRAINT c_icon_map_1 FOREIGN KEY (default_iconid) REFERENCES images (imageid); 1857ALTER TABLE icon_mapping ADD CONSTRAINT c_icon_mapping_1 FOREIGN KEY (iconmapid) REFERENCES icon_map (iconmapid) ON DELETE CASCADE; 1858ALTER TABLE icon_mapping ADD CONSTRAINT c_icon_mapping_2 FOREIGN KEY (iconid) REFERENCES images (imageid); 1859ALTER TABLE sysmaps ADD CONSTRAINT c_sysmaps_1 FOREIGN KEY (backgroundid) REFERENCES images (imageid); 1860ALTER TABLE sysmaps ADD CONSTRAINT c_sysmaps_2 FOREIGN KEY (iconmapid) REFERENCES icon_map (iconmapid); 1861ALTER TABLE sysmaps ADD CONSTRAINT c_sysmaps_3 FOREIGN KEY (userid) REFERENCES users (userid); 1862ALTER TABLE sysmaps_elements ADD CONSTRAINT c_sysmaps_elements_1 FOREIGN KEY (sysmapid) REFERENCES sysmaps (sysmapid) ON DELETE CASCADE; 1863ALTER TABLE sysmaps_elements ADD CONSTRAINT c_sysmaps_elements_2 FOREIGN KEY (iconid_off) REFERENCES images (imageid); 1864ALTER TABLE sysmaps_elements ADD CONSTRAINT c_sysmaps_elements_3 FOREIGN KEY (iconid_on) REFERENCES images (imageid); 1865ALTER TABLE sysmaps_elements ADD CONSTRAINT c_sysmaps_elements_4 FOREIGN KEY (iconid_disabled) REFERENCES images (imageid); 1866ALTER TABLE sysmaps_elements ADD CONSTRAINT c_sysmaps_elements_5 FOREIGN KEY (iconid_maintenance) REFERENCES images (imageid); 1867ALTER TABLE sysmaps_links ADD CONSTRAINT c_sysmaps_links_1 FOREIGN KEY (sysmapid) REFERENCES sysmaps (sysmapid) ON DELETE CASCADE; 1868ALTER TABLE sysmaps_links ADD CONSTRAINT c_sysmaps_links_2 FOREIGN KEY (selementid1) REFERENCES sysmaps_elements (selementid) ON DELETE CASCADE; 1869ALTER TABLE sysmaps_links ADD CONSTRAINT c_sysmaps_links_3 FOREIGN KEY (selementid2) REFERENCES sysmaps_elements (selementid) ON DELETE CASCADE; 1870ALTER TABLE sysmaps_link_triggers ADD CONSTRAINT c_sysmaps_link_triggers_1 FOREIGN KEY (linkid) REFERENCES sysmaps_links (linkid) ON DELETE CASCADE; 1871ALTER TABLE sysmaps_link_triggers ADD CONSTRAINT c_sysmaps_link_triggers_2 FOREIGN KEY (triggerid) REFERENCES triggers (triggerid) ON DELETE CASCADE; 1872ALTER TABLE sysmap_element_url ADD CONSTRAINT c_sysmap_element_url_1 FOREIGN KEY (selementid) REFERENCES sysmaps_elements (selementid) ON DELETE CASCADE; 1873ALTER TABLE sysmap_url ADD CONSTRAINT c_sysmap_url_1 FOREIGN KEY (sysmapid) REFERENCES sysmaps (sysmapid) ON DELETE CASCADE; 1874ALTER TABLE sysmap_user ADD CONSTRAINT c_sysmap_user_1 FOREIGN KEY (sysmapid) REFERENCES sysmaps (sysmapid) ON DELETE CASCADE; 1875ALTER TABLE sysmap_user ADD CONSTRAINT c_sysmap_user_2 FOREIGN KEY (userid) REFERENCES users (userid) ON DELETE CASCADE; 1876ALTER TABLE sysmap_usrgrp ADD CONSTRAINT c_sysmap_usrgrp_1 FOREIGN KEY (sysmapid) REFERENCES sysmaps (sysmapid) ON DELETE CASCADE; 1877ALTER TABLE sysmap_usrgrp ADD CONSTRAINT c_sysmap_usrgrp_2 FOREIGN KEY (usrgrpid) REFERENCES usrgrp (usrgrpid) ON DELETE CASCADE; 1878ALTER TABLE maintenances_hosts ADD CONSTRAINT c_maintenances_hosts_1 FOREIGN KEY (maintenanceid) REFERENCES maintenances (maintenanceid) ON DELETE CASCADE; 1879ALTER TABLE maintenances_hosts ADD CONSTRAINT c_maintenances_hosts_2 FOREIGN KEY (hostid) REFERENCES hosts (hostid) ON DELETE CASCADE; 1880ALTER TABLE maintenances_groups ADD CONSTRAINT c_maintenances_groups_1 FOREIGN KEY (maintenanceid) REFERENCES maintenances (maintenanceid) ON DELETE CASCADE; 1881ALTER TABLE maintenances_groups ADD CONSTRAINT c_maintenances_groups_2 FOREIGN KEY (groupid) REFERENCES hstgrp (groupid) ON DELETE CASCADE; 1882ALTER TABLE maintenances_windows ADD CONSTRAINT c_maintenances_windows_1 FOREIGN KEY (maintenanceid) REFERENCES maintenances (maintenanceid) ON DELETE CASCADE; 1883ALTER TABLE maintenances_windows ADD CONSTRAINT c_maintenances_windows_2 FOREIGN KEY (timeperiodid) REFERENCES timeperiods (timeperiodid) ON DELETE CASCADE; 1884ALTER TABLE expressions ADD CONSTRAINT c_expressions_1 FOREIGN KEY (regexpid) REFERENCES regexps (regexpid) ON DELETE CASCADE; 1885ALTER TABLE alerts ADD CONSTRAINT c_alerts_1 FOREIGN KEY (actionid) REFERENCES actions (actionid) ON DELETE CASCADE; 1886ALTER TABLE alerts ADD CONSTRAINT c_alerts_2 FOREIGN KEY (eventid) REFERENCES events (eventid) ON DELETE CASCADE; 1887ALTER TABLE alerts ADD CONSTRAINT c_alerts_3 FOREIGN KEY (userid) REFERENCES users (userid) ON DELETE CASCADE; 1888ALTER TABLE alerts ADD CONSTRAINT c_alerts_4 FOREIGN KEY (mediatypeid) REFERENCES media_type (mediatypeid) ON DELETE CASCADE; 1889ALTER TABLE alerts ADD CONSTRAINT c_alerts_5 FOREIGN KEY (p_eventid) REFERENCES events (eventid) ON DELETE CASCADE; 1890ALTER TABLE alerts ADD CONSTRAINT c_alerts_6 FOREIGN KEY (acknowledgeid) REFERENCES acknowledges (acknowledgeid) ON DELETE CASCADE; 1891ALTER TABLE acknowledges ADD CONSTRAINT c_acknowledges_1 FOREIGN KEY (userid) REFERENCES users (userid) ON DELETE CASCADE; 1892ALTER TABLE acknowledges ADD CONSTRAINT c_acknowledges_2 FOREIGN KEY (eventid) REFERENCES events (eventid) ON DELETE CASCADE; 1893ALTER TABLE auditlog ADD CONSTRAINT c_auditlog_1 FOREIGN KEY (userid) REFERENCES users (userid) ON DELETE CASCADE; 1894ALTER TABLE auditlog_details ADD CONSTRAINT c_auditlog_details_1 FOREIGN KEY (auditid) REFERENCES auditlog (auditid) ON DELETE CASCADE; 1895ALTER TABLE service_alarms ADD CONSTRAINT c_service_alarms_1 FOREIGN KEY (serviceid) REFERENCES services (serviceid) ON DELETE CASCADE; 1896ALTER TABLE autoreg_host ADD CONSTRAINT c_autoreg_host_1 FOREIGN KEY (proxy_hostid) REFERENCES hosts (hostid) ON DELETE CASCADE; 1897ALTER TABLE dhosts ADD CONSTRAINT c_dhosts_1 FOREIGN KEY (druleid) REFERENCES drules (druleid) ON DELETE CASCADE; 1898ALTER TABLE dservices ADD CONSTRAINT c_dservices_1 FOREIGN KEY (dhostid) REFERENCES dhosts (dhostid) ON DELETE CASCADE; 1899ALTER TABLE dservices ADD CONSTRAINT c_dservices_2 FOREIGN KEY (dcheckid) REFERENCES dchecks (dcheckid) ON DELETE CASCADE; 1900ALTER TABLE graph_discovery ADD CONSTRAINT c_graph_discovery_1 FOREIGN KEY (graphid) REFERENCES graphs (graphid) ON DELETE CASCADE; 1901ALTER TABLE graph_discovery ADD CONSTRAINT c_graph_discovery_2 FOREIGN KEY (parent_graphid) REFERENCES graphs (graphid); 1902ALTER TABLE host_inventory ADD CONSTRAINT c_host_inventory_1 FOREIGN KEY (hostid) REFERENCES hosts (hostid) ON DELETE CASCADE; 1903ALTER TABLE item_discovery ADD CONSTRAINT c_item_discovery_1 FOREIGN KEY (itemid) REFERENCES items (itemid) ON DELETE CASCADE; 1904ALTER TABLE item_discovery ADD CONSTRAINT c_item_discovery_2 FOREIGN KEY (parent_itemid) REFERENCES items (itemid) ON DELETE CASCADE; 1905ALTER TABLE host_discovery ADD CONSTRAINT c_host_discovery_1 FOREIGN KEY (hostid) REFERENCES hosts (hostid) ON DELETE CASCADE; 1906ALTER TABLE host_discovery ADD CONSTRAINT c_host_discovery_2 FOREIGN KEY (parent_hostid) REFERENCES hosts (hostid); 1907ALTER TABLE host_discovery ADD CONSTRAINT c_host_discovery_3 FOREIGN KEY (parent_itemid) REFERENCES items (itemid); 1908ALTER TABLE interface_discovery ADD CONSTRAINT c_interface_discovery_1 FOREIGN KEY (interfaceid) REFERENCES interface (interfaceid) ON DELETE CASCADE; 1909ALTER TABLE interface_discovery ADD CONSTRAINT c_interface_discovery_2 FOREIGN KEY (parent_interfaceid) REFERENCES interface (interfaceid) ON DELETE CASCADE; 1910ALTER TABLE profiles ADD CONSTRAINT c_profiles_1 FOREIGN KEY (userid) REFERENCES users (userid) ON DELETE CASCADE; 1911ALTER TABLE sessions ADD CONSTRAINT c_sessions_1 FOREIGN KEY (userid) REFERENCES users (userid) ON DELETE CASCADE; 1912ALTER TABLE trigger_discovery ADD CONSTRAINT c_trigger_discovery_1 FOREIGN KEY (triggerid) REFERENCES triggers (triggerid) ON DELETE CASCADE; 1913ALTER TABLE trigger_discovery ADD CONSTRAINT c_trigger_discovery_2 FOREIGN KEY (parent_triggerid) REFERENCES triggers (triggerid); 1914ALTER TABLE application_template ADD CONSTRAINT c_application_template_1 FOREIGN KEY (applicationid) REFERENCES applications (applicationid) ON DELETE CASCADE; 1915ALTER TABLE application_template ADD CONSTRAINT c_application_template_2 FOREIGN KEY (templateid) REFERENCES applications (applicationid) ON DELETE CASCADE; 1916ALTER TABLE item_condition ADD CONSTRAINT c_item_condition_1 FOREIGN KEY (itemid) REFERENCES items (itemid) ON DELETE CASCADE; 1917ALTER TABLE application_prototype ADD CONSTRAINT c_application_prototype_1 FOREIGN KEY (itemid) REFERENCES items (itemid) ON DELETE CASCADE; 1918ALTER TABLE application_prototype ADD CONSTRAINT c_application_prototype_2 FOREIGN KEY (templateid) REFERENCES application_prototype (application_prototypeid) ON DELETE CASCADE; 1919ALTER TABLE item_application_prototype ADD CONSTRAINT c_item_application_prototype_1 FOREIGN KEY (application_prototypeid) REFERENCES application_prototype (application_prototypeid) ON DELETE CASCADE; 1920ALTER TABLE item_application_prototype ADD CONSTRAINT c_item_application_prototype_2 FOREIGN KEY (itemid) REFERENCES items (itemid) ON DELETE CASCADE; 1921ALTER TABLE application_discovery ADD CONSTRAINT c_application_discovery_1 FOREIGN KEY (applicationid) REFERENCES applications (applicationid) ON DELETE CASCADE; 1922ALTER TABLE application_discovery ADD CONSTRAINT c_application_discovery_2 FOREIGN KEY (application_prototypeid) REFERENCES application_prototype (application_prototypeid) ON DELETE CASCADE; 1923ALTER TABLE opinventory ADD CONSTRAINT c_opinventory_1 FOREIGN KEY (operationid) REFERENCES operations (operationid) ON DELETE CASCADE; 1924ALTER TABLE trigger_tag ADD CONSTRAINT c_trigger_tag_1 FOREIGN KEY (triggerid) REFERENCES triggers (triggerid) ON DELETE CASCADE; 1925ALTER TABLE event_tag ADD CONSTRAINT c_event_tag_1 FOREIGN KEY (eventid) REFERENCES events (eventid) ON DELETE CASCADE; 1926ALTER TABLE problem ADD CONSTRAINT c_problem_1 FOREIGN KEY (eventid) REFERENCES events (eventid) ON DELETE CASCADE; 1927ALTER TABLE problem ADD CONSTRAINT c_problem_2 FOREIGN KEY (r_eventid) REFERENCES events (eventid) ON DELETE CASCADE; 1928ALTER TABLE problem_tag ADD CONSTRAINT c_problem_tag_1 FOREIGN KEY (eventid) REFERENCES problem (eventid) ON DELETE CASCADE; 1929ALTER TABLE tag_filter ADD CONSTRAINT c_tag_filter_1 FOREIGN KEY (usrgrpid) REFERENCES usrgrp (usrgrpid) ON DELETE CASCADE; 1930ALTER TABLE tag_filter ADD CONSTRAINT c_tag_filter_2 FOREIGN KEY (groupid) REFERENCES hstgrp (groupid) ON DELETE CASCADE; 1931ALTER TABLE event_recovery ADD CONSTRAINT c_event_recovery_1 FOREIGN KEY (eventid) REFERENCES events (eventid) ON DELETE CASCADE; 1932ALTER TABLE event_recovery ADD CONSTRAINT c_event_recovery_2 FOREIGN KEY (r_eventid) REFERENCES events (eventid) ON DELETE CASCADE; 1933ALTER TABLE event_recovery ADD CONSTRAINT c_event_recovery_3 FOREIGN KEY (c_eventid) REFERENCES events (eventid) ON DELETE CASCADE; 1934ALTER TABLE corr_condition ADD CONSTRAINT c_corr_condition_1 FOREIGN KEY (correlationid) REFERENCES correlation (correlationid) ON DELETE CASCADE; 1935ALTER TABLE corr_condition_tag ADD CONSTRAINT c_corr_condition_tag_1 FOREIGN KEY (corr_conditionid) REFERENCES corr_condition (corr_conditionid) ON DELETE CASCADE; 1936ALTER TABLE corr_condition_group ADD CONSTRAINT c_corr_condition_group_1 FOREIGN KEY (corr_conditionid) REFERENCES corr_condition (corr_conditionid) ON DELETE CASCADE; 1937ALTER TABLE corr_condition_group ADD CONSTRAINT c_corr_condition_group_2 FOREIGN KEY (groupid) REFERENCES hstgrp (groupid); 1938ALTER TABLE corr_condition_tagpair ADD CONSTRAINT c_corr_condition_tagpair_1 FOREIGN KEY (corr_conditionid) REFERENCES corr_condition (corr_conditionid) ON DELETE CASCADE; 1939ALTER TABLE corr_condition_tagvalue ADD CONSTRAINT c_corr_condition_tagvalue_1 FOREIGN KEY (corr_conditionid) REFERENCES corr_condition (corr_conditionid) ON DELETE CASCADE; 1940ALTER TABLE corr_operation ADD CONSTRAINT c_corr_operation_1 FOREIGN KEY (correlationid) REFERENCES correlation (correlationid) ON DELETE CASCADE; 1941ALTER TABLE task ADD CONSTRAINT c_task_1 FOREIGN KEY (proxy_hostid) REFERENCES hosts (hostid) ON DELETE CASCADE; 1942ALTER TABLE task_close_problem ADD CONSTRAINT c_task_close_problem_1 FOREIGN KEY (taskid) REFERENCES task (taskid) ON DELETE CASCADE; 1943ALTER TABLE item_preproc ADD CONSTRAINT c_item_preproc_1 FOREIGN KEY (itemid) REFERENCES items (itemid) ON DELETE CASCADE; 1944ALTER TABLE task_remote_command ADD CONSTRAINT c_task_remote_command_1 FOREIGN KEY (taskid) REFERENCES task (taskid) ON DELETE CASCADE; 1945ALTER TABLE task_remote_command_result ADD CONSTRAINT c_task_remote_command_result_1 FOREIGN KEY (taskid) REFERENCES task (taskid) ON DELETE CASCADE; 1946ALTER TABLE task_acknowledge ADD CONSTRAINT c_task_acknowledge_1 FOREIGN KEY (taskid) REFERENCES task (taskid) ON DELETE CASCADE; 1947ALTER TABLE sysmap_shape ADD CONSTRAINT c_sysmap_shape_1 FOREIGN KEY (sysmapid) REFERENCES sysmaps (sysmapid) ON DELETE CASCADE; 1948ALTER TABLE sysmap_element_trigger ADD CONSTRAINT c_sysmap_element_trigger_1 FOREIGN KEY (selementid) REFERENCES sysmaps_elements (selementid) ON DELETE CASCADE; 1949ALTER TABLE sysmap_element_trigger ADD CONSTRAINT c_sysmap_element_trigger_2 FOREIGN KEY (triggerid) REFERENCES triggers (triggerid) ON DELETE CASCADE; 1950ALTER TABLE httptest_field ADD CONSTRAINT c_httptest_field_1 FOREIGN KEY (httptestid) REFERENCES httptest (httptestid) ON DELETE CASCADE; 1951ALTER TABLE httpstep_field ADD CONSTRAINT c_httpstep_field_1 FOREIGN KEY (httpstepid) REFERENCES httpstep (httpstepid) ON DELETE CASCADE; 1952ALTER TABLE dashboard ADD CONSTRAINT c_dashboard_1 FOREIGN KEY (userid) REFERENCES users (userid); 1953ALTER TABLE dashboard_user ADD CONSTRAINT c_dashboard_user_1 FOREIGN KEY (dashboardid) REFERENCES dashboard (dashboardid) ON DELETE CASCADE; 1954ALTER TABLE dashboard_user ADD CONSTRAINT c_dashboard_user_2 FOREIGN KEY (userid) REFERENCES users (userid) ON DELETE CASCADE; 1955ALTER TABLE dashboard_usrgrp ADD CONSTRAINT c_dashboard_usrgrp_1 FOREIGN KEY (dashboardid) REFERENCES dashboard (dashboardid) ON DELETE CASCADE; 1956ALTER TABLE dashboard_usrgrp ADD CONSTRAINT c_dashboard_usrgrp_2 FOREIGN KEY (usrgrpid) REFERENCES usrgrp (usrgrpid) ON DELETE CASCADE; 1957ALTER TABLE widget ADD CONSTRAINT c_widget_1 FOREIGN KEY (dashboardid) REFERENCES dashboard (dashboardid) ON DELETE CASCADE; 1958ALTER TABLE widget_field ADD CONSTRAINT c_widget_field_1 FOREIGN KEY (widgetid) REFERENCES widget (widgetid) ON DELETE CASCADE; 1959ALTER TABLE widget_field ADD CONSTRAINT c_widget_field_2 FOREIGN KEY (value_groupid) REFERENCES hstgrp (groupid) ON DELETE CASCADE; 1960ALTER TABLE widget_field ADD CONSTRAINT c_widget_field_3 FOREIGN KEY (value_hostid) REFERENCES hosts (hostid) ON DELETE CASCADE; 1961ALTER TABLE widget_field ADD CONSTRAINT c_widget_field_4 FOREIGN KEY (value_itemid) REFERENCES items (itemid) ON DELETE CASCADE; 1962ALTER TABLE widget_field ADD CONSTRAINT c_widget_field_5 FOREIGN KEY (value_graphid) REFERENCES graphs (graphid) ON DELETE CASCADE; 1963ALTER TABLE widget_field ADD CONSTRAINT c_widget_field_6 FOREIGN KEY (value_sysmapid) REFERENCES sysmaps (sysmapid) ON DELETE CASCADE; 1964ALTER TABLE task_check_now ADD CONSTRAINT c_task_check_now_1 FOREIGN KEY (taskid) REFERENCES task (taskid) ON DELETE CASCADE; 1965ALTER TABLE event_suppress ADD CONSTRAINT c_event_suppress_1 FOREIGN KEY (eventid) REFERENCES events (eventid) ON DELETE CASCADE; 1966ALTER TABLE event_suppress ADD CONSTRAINT c_event_suppress_2 FOREIGN KEY (maintenanceid) REFERENCES maintenances (maintenanceid) ON DELETE CASCADE; 1967ALTER TABLE maintenance_tag ADD CONSTRAINT c_maintenance_tag_1 FOREIGN KEY (maintenanceid) REFERENCES maintenances (maintenanceid) ON DELETE CASCADE; 1968