diff options
-rw-r--r-- | create/src/schema.tmpl | 4 | ||||
-rw-r--r-- | src/libs/zbxdbupgrade/dbupgrade_5050.c | 29 | ||||
-rw-r--r-- | ui/include/defines.inc.php | 2 |
3 files changed, 32 insertions, 3 deletions
diff --git a/create/src/schema.tmpl b/create/src/schema.tmpl index 23597970758..bb48dfdc172 100644 --- a/create/src/schema.tmpl +++ b/create/src/schema.tmpl @@ -1608,7 +1608,7 @@ FIELD |value_hostid |t_id | |NULL |0 |3|hosts |hostid FIELD |value_itemid |t_id | |NULL |0 |4|items |itemid FIELD |value_graphid |t_id | |NULL |0 |5|graphs |graphid FIELD |value_sysmapid |t_id | |NULL |0 |6|sysmaps |sysmapid -FIELD |value_serviceid|t_id | |NULL |0 |7|service |serviceid +FIELD |value_serviceid|t_id | |NULL |0 |7|services |serviceid FIELD |value_slaid |t_id | |NULL |0 |8|sla |slaid INDEX |1 |widgetid INDEX |2 |value_groupid @@ -1933,4 +1933,4 @@ TABLE|dbversion|dbversionid| FIELD |dbversionid |t_id | |NOT NULL |0 FIELD |mandatory |t_integer |'0' |NOT NULL | FIELD |optional |t_integer |'0' |NOT NULL | -ROW |1 |5050130 |5050130 +ROW |1 |5050134 |5050134 diff --git a/src/libs/zbxdbupgrade/dbupgrade_5050.c b/src/libs/zbxdbupgrade/dbupgrade_5050.c index 9c10f661ec5..5dd3ee3a317 100644 --- a/src/libs/zbxdbupgrade/dbupgrade_5050.c +++ b/src/libs/zbxdbupgrade/dbupgrade_5050.c @@ -1685,6 +1685,31 @@ static int DBpatch_5050130(void) return SUCCEED; } +static int DBpatch_5050131(void) +{ + return DBcreate_index("widget_field", "widget_field_7", "value_serviceid", 0); +} + +static int DBpatch_5050132(void) +{ + const ZBX_FIELD field = {"value_serviceid", NULL, "services", "serviceid", 0, ZBX_TYPE_ID, 0, + ZBX_FK_CASCADE_DELETE}; + + return DBadd_foreign_key("widget_field", 7, &field); +} + +static int DBpatch_5050133(void) +{ + return DBcreate_index("widget_field", "widget_field_8", "value_slaid", 0); +} + +static int DBpatch_5050134(void) +{ + const ZBX_FIELD field = {"value_slaid", NULL, "sla", "slaid", 0, ZBX_TYPE_ID, 0, ZBX_FK_CASCADE_DELETE}; + + return DBadd_foreign_key("widget_field", 8, &field); +} + #endif @@ -1810,5 +1835,9 @@ DBPATCH_ADD(5050127, 0, 1) DBPATCH_ADD(5050128, 0, 1) DBPATCH_ADD(5050129, 0, 1) DBPATCH_ADD(5050130, 0, 1) +DBPATCH_ADD(5050131, 0, 1) +DBPATCH_ADD(5050132, 0, 1) +DBPATCH_ADD(5050133, 0, 1) +DBPATCH_ADD(5050134, 0, 1) DBPATCH_END() diff --git a/ui/include/defines.inc.php b/ui/include/defines.inc.php index d85d92e82fa..c9b7089f8e2 100644 --- a/ui/include/defines.inc.php +++ b/ui/include/defines.inc.php @@ -22,7 +22,7 @@ define('ZABBIX_VERSION', '6.0.0alpha7'); define('ZABBIX_API_VERSION', '6.0.0'); define('ZABBIX_EXPORT_VERSION', '6.0'); -define('ZABBIX_DB_VERSION', 5050130); +define('ZABBIX_DB_VERSION', 5050134); define('DB_VERSION_SUPPORTED', 0); define('DB_VERSION_LOWER_THAN_MINIMUM', 1); |