From f1a062e5775eee57b982edf232b603812c5a996a Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 5 Sep 2021 16:28:21 +0200 Subject: Don't error if obsolete indexes or keys are already deleted. --- includes/admin/register_db_tables.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/admin/register_db_tables.php b/includes/admin/register_db_tables.php index 8080578..8b5f044 100644 --- a/includes/admin/register_db_tables.php +++ b/includes/admin/register_db_tables.php @@ -348,10 +348,10 @@ if ( !function_exists( "giglog_register_db_tables") ) ADD COLUMN IF NOT EXISTS `wpgconcert_type` INT NOT NULL DEFAULT '1' COMMENT '1 concert, 2 festival';"); $wpdb->query( - "ALTER TABLE `wpg_concerts` DROP INDEX `wpgconcert_band`;"); + "ALTER TABLE `wpg_concerts` DROP INDEX IF EXISTS `wpgconcert_band`;"); $wpdb->query( - "ALTER TABLE `wpg_concerts` DROP FOREIGN KEY `wpgconcert_band`;"); + "ALTER TABLE `wpg_concerts` DROP FOREIGN KEY IF EXISTS `wpgconcert_band`;"); } if ($db_version == NULL || $db_version < 6) -- cgit v1.2.3