Source
if (ZBX_DB_OK > zbx_db_execute("update services set algorithm=case algorithm when 1 then 2 when 2 then 1 else 0 end"))
/*
** Copyright (C) 2001-2024 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/*
* 6.0 development database patches
*/
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},
{0}
},
NULL
};
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)
{