#include "dbupgrade_macros.h"
static int DBpatch_5050001(void)
const zbx_db_table_t table =
{"service_problem_tag", "service_problem_tagid", 0,
{"service_problem_tagid", NULL, NULL, NULL, 0, ZBX_TYPE_ID, ZBX_NOTNULL, 0},
{"serviceid", NULL, NULL, NULL, 0, ZBX_TYPE_ID, ZBX_NOTNULL, 0},
{"tag", "", NULL, NULL, 255, ZBX_TYPE_CHAR, ZBX_NOTNULL, 0},
{"operator", "0", NULL, NULL, 0, ZBX_TYPE_INT, ZBX_NOTNULL, 0},
{"value", "", NULL, NULL, 255, ZBX_TYPE_CHAR, ZBX_NOTNULL, 0},
return DBcreate_table(&table);
static int DBpatch_5050002(void)
const zbx_db_field_t field = {"serviceid", NULL, "services", "serviceid", 0, 0, 0, ZBX_FK_CASCADE_DELETE};
return DBadd_foreign_key("service_problem_tag", 1, &field);
static int DBpatch_5050003(void)
return DBcreate_index("service_problem_tag", "service_problem_tag_1", "serviceid", 0);
static int DBpatch_5050004(void)
const zbx_db_table_t table =
{"service_problem", "service_problemid", 0,
{"service_problemid", NULL, NULL, NULL, 0, ZBX_TYPE_ID, ZBX_NOTNULL, 0},
{"eventid", NULL, NULL, NULL, 0, ZBX_TYPE_ID, ZBX_NOTNULL, 0},
{"serviceid", NULL, NULL, NULL, 0, ZBX_TYPE_ID, ZBX_NOTNULL, 0},
{"severity", "0", NULL, NULL, 0, ZBX_TYPE_INT, ZBX_NOTNULL, 0},
return DBcreate_table(&table);
static int DBpatch_5050005(void)
return DBcreate_index("service_problem", "service_problem_1", "eventid", 0);
static int DBpatch_5050006(void)
return DBcreate_index("service_problem", "service_problem_2", "serviceid", 0);
static int DBpatch_5050007(void)
const zbx_db_field_t field = {"eventid", NULL, "problem", "eventid", 0, 0, 0, ZBX_FK_CASCADE_DELETE};
return DBadd_foreign_key("service_problem", 1, &field);