Source
/*
** Zabbix
** Copyright (C) 2001-2023 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
/*
* 3.4 maintenance database patches
*/
static int DBpatch_3040000(void)
{
return SUCCEED;
}
static int DBpatch_3040001(void)
{
return delete_problems_with_nonexistent_object();
}
static int DBpatch_3040002(void)
{
return DBdrop_foreign_key("sessions", 1);
}
static int DBpatch_3040003(void)
{
return DBdrop_index("sessions", "sessions_1");
}
static int DBpatch_3040004(void)
{
return DBcreate_index("sessions", "sessions_1", "userid,status,lastaccess", 0);
}
static int DBpatch_3040005(void)
{
const zbx_db_field_t field = {"userid", NULL, "users", "userid", 0, 0, 0, ZBX_FK_CASCADE_DELETE};
return DBadd_foreign_key("sessions", 1, &field);
}
static int DBpatch_3040006(void)