From 31281c21661cd6329c45305a0544268388801791 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 9 Aug 2011 17:59:06 +0000 Subject: [PATCH] ADD UNIQUE ... what? INDEX now. And auto-unregistration of missing filter functions is logged --- inc/db/lib-mysql3.php | 10 +++++----- inc/extensions/ext-coupon.php | 2 +- inc/extensions/ext-earning.php | 4 ++-- inc/extensions/ext-grade.php | 2 +- inc/extensions/ext-network.php | 20 ++++++++++---------- inc/extensions/ext-newsletter.php | 2 +- inc/extensions/ext-sponsor.php | 2 +- inc/extensions/ext-sql_patches.php | 12 ++++++------ inc/extensions/ext-surfbar.php | 10 +++++----- inc/extensions/ext-user.php | 4 ++-- inc/extensions/ext-yoomedia.php | 2 +- inc/filter-functions.php | 3 +++ inc/filters.php | 6 +++++- inc/fix_filters.php | 2 +- inc/fix_menu.php | 4 ++-- inc/fix_refsystem.php | 2 +- 16 files changed, 47 insertions(+), 40 deletions(-) diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index 85069429d1..1024b238d5 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -366,11 +366,11 @@ function SQL_ALTER_TABLE ($sql, $F, $L, $enableCodes = true) { $isAlterIndex = ( ( isInString('INDEX', $sql) - ) && ( + ) || ( isInString('KEY', $sql) - ) && ( + ) || ( isInString('FULLTEXT', $sql) - ) && ( + ) || ( isInString('UNIQUE', $sql) ) ); @@ -579,7 +579,7 @@ function isSqlTableCreated ($tableName) { // Is a table column there? function isSqlTableColumnFound ($tableName, $columnName) { - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'tableName=' . $tableName . ',columnName=' . $columName . ' - ENTERED!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'tableName=' . $tableName . ',columnName=' . $columnName . ' - ENTERED!'); // Do we have cache? if (!isset($GLOBALS[__FUNCTION__][$tableName][$columnName])) { // And column name as well @@ -598,7 +598,7 @@ function isSqlTableColumnFound ($tableName, $columnName) { } // END - if // Return cache - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'tableName=' . $tableName . ',columnName=' . $columName . ',result=' . intval($GLOBALS[__FUNCTION__][$tableName][$columnName]) . ' - EXIT!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'tableName=' . $tableName . ',columnName=' . $columnName . ',result=' . intval($GLOBALS[__FUNCTION__][$tableName][$columnName]) . ' - EXIT!'); return $GLOBALS[__FUNCTION__][$tableName][$columnName]; } diff --git a/inc/extensions/ext-coupon.php b/inc/extensions/ext-coupon.php index 2d2bae2824..77143b8ac3 100644 --- a/inc/extensions/ext-coupon.php +++ b/inc/extensions/ext-coupon.php @@ -77,7 +77,7 @@ PRIMARY KEY (`id`)", `coupon_code` VARCHAR(30) NULL DEFAULT NULL, `cashed_on` TIMESTAMP NULL DEFAULT NULL, PRIMARY KEY (`id`), -UNIQUE `coupon_user` (`coupon_id`,`userid`), +UNIQUE INDEX `coupon_user` (`coupon_id`,`userid`), UNIQUE (`coupon_code`)", 'Coupon->user connection'); diff --git a/inc/extensions/ext-earning.php b/inc/extensions/ext-earning.php index 4ef86a53cf..cd8f3a9f4a 100644 --- a/inc/extensions/ext-earning.php +++ b/inc/extensions/ext-earning.php @@ -65,7 +65,7 @@ switch (getExtensionMode()) { `earning_provider` VARCHAR(255) NOT NULL DEFAULT 'INVALID', `earning_sorting` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`earning_id`), -UNIQUE `earning_group_name` (`earning_group`,`earning_provider`)", +UNIQUE INDEX `earning_group_name` (`earning_group`,`earning_provider`)", 'Registered (extra) earnings'); // User->earnings connection table @@ -81,7 +81,7 @@ UNIQUE `earning_group_name` (`earning_group`,`earning_provider`)", `earning_current_amount` SMALLINT(7) NOT NULL DEFAULT 0, `earning_points` FLOAT(20,5) NOT NULL DEFAULT 0.00000, PRIMARY KEY (`id`), -UNIQUE `user_earning` (`earning_id`,`earning_userid`), +UNIQUE INDEX `user_earning` (`earning_id`,`earning_userid`), INDEX (`earning_userid`)", 'User->Earning connections'); diff --git a/inc/extensions/ext-grade.php b/inc/extensions/ext-grade.php index 687bc0d618..3eff1425ed 100644 --- a/inc/extensions/ext-grade.php +++ b/inc/extensions/ext-grade.php @@ -83,7 +83,7 @@ UNIQUE (`grade_cash_name`)", `grade_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `grade_cash_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`id`), -UNIQUE `grade_cash` (`grade_id`,`grade_cash_id`), +UNIQUE INDEX `grade_cash` (`grade_id`,`grade_cash_id`), INDEX (`grade_cash_id`)", 'Grade<->cash data connection'); diff --git a/inc/extensions/ext-network.php b/inc/extensions/ext-network.php index 9419d9ff20..14a18b8d6f 100644 --- a/inc/extensions/ext-network.php +++ b/inc/extensions/ext-network.php @@ -100,7 +100,7 @@ UNIQUE (`network_short_name`)", `network_type_click_url` VARCHAR(255) NOT NULL DEFAULT '', `network_type_banner_url` VARCHAR(255) NULL DEFAULT NULL, PRIMARY KEY (`network_type_id`), -UNIQUE `provider_type` (`network_id`,`network_type_handle`)", +UNIQUE INDEX `provider_type` (`network_id`,`network_type_handle`)", 'Types provideable by networks'); // HTTP parameters (names) for URLs @@ -113,8 +113,8 @@ UNIQUE `provider_type` (`network_id`,`network_type_handle`)", `request_param_value` VARCHAR(20) NOT NULL DEFAULT 'invalid', `request_param_default` VARCHAR(255) NULL DEFAULT NULL, PRIMARY KEY (`network_param_id`), -UNIQUE `provider_type_key` (`network_id`,`network_type_id`,`request_param_key`), -UNIQUE `provider_type_value` (`network_id`,`network_type_id`,`request_param_value`),", +UNIQUE INDEX `provider_type_key` (`network_id`,`network_type_id`,`request_param_key`), +UNIQUE INDEX `provider_type_value` (`network_id`,`network_type_id`,`request_param_value`),", 'Request parameters for GET/POST request'); // Error status codes @@ -125,7 +125,7 @@ UNIQUE `provider_type_value` (`network_id`,`network_type_id`,`request_param_valu `network_type_code_value` VARCHAR(50) NOT NULL DEFAULT '', `network_type_code_type` VARCHAR(100) NOT NULL DEFAULT 'INVALID_TYPE', PRIMARY KEY (`network_type_code_id`), -UNIQUE `code_type` (`network_type_code_value`,`network_type_id`), +UNIQUE INDEX `code_type` (`network_type_code_value`,`network_type_id`), INDEX (`network_type_id`)", 'Error codes for all types'); @@ -156,7 +156,7 @@ UNIQUE (`network_translation_name`)", `network_api_index` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0, `sort` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`network_api_id`), -UNIQUE `provider_type_key` (`network_id`,`network_type_id`,`network_api_index`), +UNIQUE INDEX `provider_type_key` (`network_id`,`network_type_id`,`network_api_index`), INDEX (`sort`)", 'Translation of API responses, generic data, DO NOT ALTER!'); @@ -170,8 +170,8 @@ INDEX (`sort`)", `network_query_amount` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `network_active` ENUM('Y','N') NOT NULL DEFAULT 'Y', PRIMARY KEY (`network_id`), -UNIQUE `network_affiliate` (`network_id`,`network_affiliate_id`), -UNIQUE `affiliate_site` (`network_affiliate_id`,`network_site_id`)", +UNIQUE INDEX `network_affiliate` (`network_id`,`network_affiliate_id`), +UNIQUE INDEX `affiliate_site` (`network_affiliate_id`,`network_site_id`)", 'Configuration data from the webmaster (you!)'); // Configuration data for e.g. reload-time @@ -186,7 +186,7 @@ UNIQUE `affiliate_site` (`network_affiliate_id`,`network_site_id`)", `min_payment` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000, `allow_erotic` VARCHAR(10) NOT NULL DEFAULT '', PRIMARY KEY (`network_data_id`), -UNIQUE `provider_type` (`network_id`,`network_type_id`)", +UNIQUE INDEX `provider_type` (`network_id`,`network_type_id`)", 'Configuration data for every type (e.g. reload-time)'); // Cache for queried APIs. Re-check depends on config @@ -200,7 +200,7 @@ UNIQUE `provider_type` (`network_id`,`network_type_id`)", `network_cache_data` MEDIUMBLOB, `network_cache_timestamp` TIMESTAMP NULL DEFAULT NULL, PRIMARY KEY (`network_cache_id`), -UNIQUE `provider_type` (`network_id`,`network_type_id`)", +UNIQUE INDEX `provider_type` (`network_id`,`network_type_id`)", 'Cache for all queried APIs'); // Reload locks for several types @@ -212,7 +212,7 @@ UNIQUE `provider_type` (`network_id`,`network_type_id`)", `network_reload_lock` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0, `network_inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`network_reload_id`), -UNIQUE `provider_type` (`network_id`,`network_type_id`)", +UNIQUE INDEX `provider_type` (`network_id`,`network_type_id`)", 'Reload locks'); // Insert API response array translations, these will be used for calling the right filter function diff --git a/inc/extensions/ext-newsletter.php b/inc/extensions/ext-newsletter.php index edb0159919..895f1f6d4f 100644 --- a/inc/extensions/ext-newsletter.php +++ b/inc/extensions/ext-newsletter.php @@ -179,7 +179,7 @@ INDEX `newsletter_id` (`nl_id`)", `nl_order_placed` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `nl_order_accepted` ENUM('Y','N') NOT NULL DEFAULT 'N', PRIMARY KEY (`nl_order_id`), -UNIQUE `sponsor_nl_topic` (`nl_sponsor_id`,`nl_id`,`nl_topic_id`), +UNIQUE INDEX `sponsor_nl_topic` (`nl_sponsor_id`,`nl_id`,`nl_topic_id`), INDEX `topic` (`nl_topic_id`)", 'Newsletter orders'); diff --git a/inc/extensions/ext-sponsor.php b/inc/extensions/ext-sponsor.php index 43ffd19261..f82a2a697a 100644 --- a/inc/extensions/ext-sponsor.php +++ b/inc/extensions/ext-sponsor.php @@ -155,7 +155,7 @@ INDEX (`ext_name`)", `active` ENUM('Y','N') NOT NULL DEFAULT 'N', `sort` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`id`), -UNIQUE `action_what` (`action`,`what`), +UNIQUE INDEX `action_what` (`action`,`what`), UNIQUE (`what`), INDEX (`action`)", 'Sponsor menu'); diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index 875228577f..e9cb0920e9 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -335,13 +335,13 @@ IN ( break; case '0.3.1': // SQL queries for v0.3.1 - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_extensions` ADD UNIQUE `ext_name` (`ext_name`)"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` ADD UNIQUE `login` (`login`)"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_extensions` ADD UNIQUE INDEX `ext_name` (`ext_name`)"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` ADD UNIQUE INDEX `login` (`login`)"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_refbanner` ADD INDEX `visible` (`visible`)"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_refdepths` ADD UNIQUE `level` (`level`)"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_refdepths` ADD UNIQUE INDEX `level` (`level`)"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` ADD INDEX `level` (`level`)"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_pool` ADD INDEX `data_type` (`data_type`)"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_mod_reg` ADD UNIQUE `module` (`module`)"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_mod_reg` ADD UNIQUE INDEX `module` (`module`)"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admin_menu` ADD INDEX `action` (`action`)"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admin_menu` ADD INDEX `what` (`what`)"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_task_system` ADD INDEX `task_type` (`task_type`)"); @@ -552,7 +552,7 @@ INDEX (`admin_id`)", case '0.5.0': // SQL queries for v0.5.0 addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` DROP INDEX `level`'); addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` DROP INDEX `userid`'); - addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` ADD UNIQUE `userid_level` (`userid`,`level`)'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` ADD UNIQUE INDEX `userid_level` (`userid`,`level`)'); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Referal-System unterstützt nun detailierte Referal-Übersicht und vieles mehr."); @@ -622,7 +622,7 @@ INDEX (`admin_id`)", `filter_active` ENUM('N','Y') NOT NULL DEFAULT 'Y', `filter_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`filter_id`), -UNIQUE `name_function` (`filter_name` , `filter_function`)", +UNIQUE INDEX `name_function` (`filter_name` , `filter_function`)", 'Filter system'); // Admin menu diff --git a/inc/extensions/ext-surfbar.php b/inc/extensions/ext-surfbar.php index d6ec60abc2..61e4262d9a 100644 --- a/inc/extensions/ext-surfbar.php +++ b/inc/extensions/ext-surfbar.php @@ -68,7 +68,7 @@ switch (getExtensionMode()) { `url_reject_reason` VARCHAR(255) NOT NULL DEFAULT '', `url_fixed_reload` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`url_id`), -UNIQUE `userid_url` (`url_userid`,`url`), +UNIQUE INDEX `userid_url` (`url_userid`,`url`), INDEX `status_userid` (`url_status`,`url_userid`)", 'Visitor add-on URLs'); @@ -80,7 +80,7 @@ INDEX `status_userid` (`url_status`,`url_userid`)", `locks_url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `locks_last_surfed` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`locks_id`), -UNIQUE `userid_url` (`locks_userid`,`locks_url_id`), +UNIQUE INDEX `userid_url` (`locks_userid`,`locks_url_id`), INDEX (`locks_url_id`)", 'Vistor-addon reload locks'); @@ -92,7 +92,7 @@ INDEX (`locks_url_id`)", `salts_url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `salts_last_salt` VARCHAR(255) NOT NULL DEFAULT '', PRIMARY KEY (`salts_id`), -UNIQUE `salts_userid_url` (`salts_userid`,`salts_url_id`), +UNIQUE INDEX `salts_userid_url` (`salts_userid`,`salts_url_id`), INDEX (`salts_url_id`)", 'Visitor add-on last used salts'); @@ -105,7 +105,7 @@ INDEX (`salts_url_id`)", `stats_count` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `stats_last_surfed` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`stats_id`), -UNIQUE `userid_url` (`stats_userid`,`stats_url_id`), +UNIQUE INDEX `userid_url` (`stats_userid`,`stats_url_id`), INDEX (`stats_url_id`)", 'Visitor add-on Statistics'); @@ -117,7 +117,7 @@ INDEX (`stats_url_id`)", `actions_action` ENUM('EDIT','DELETE','PAUSE','UNPAUSE','FRAMETEST','RETREAT','RESUBMIT','BOOKNOW') NULL DEFAULT NULL, `actions_new_status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NULL DEFAULT NULL, PRIMARY KEY (`actions_id`), -UNIQUE `status_action` (`actions_status`,`actions_action`)", +UNIQUE INDEX `status_action` (`actions_status`,`actions_action`)", 'Visitor add-on Member Actions'); // Member actions diff --git a/inc/extensions/ext-user.php b/inc/extensions/ext-user.php index a8f0afbeb3..9405d91046 100644 --- a/inc/extensions/ext-user.php +++ b/inc/extensions/ext-user.php @@ -372,7 +372,7 @@ INDEX (`userid`)", case '0.3.6': // SQL queries for v0.3.6 addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` DROP INDEX `userid`'); - addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` ADD UNIQUE `userid_catid` (`userid` , `cat_id`)'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` ADD UNIQUE INDEX `userid_catid` (`userid` , `cat_id`)'); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Der Sperrgrund wird nun mit abgespeichert und beim Löschen des Users mit ausgesendet."); @@ -464,7 +464,7 @@ INDEX (`userid`)", `level` smallINT(6) UNSIGNED NOT NULL DEFAULT 0, `refid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`id`), -UNIQUE `user_refid` (`userid`,`level`,`refid`), +UNIQUE INDEX `user_refid` (`userid`,`level`,`refid`), INDEX (`level`), INDEX (`refid`)", 'User referals'); diff --git a/inc/extensions/ext-yoomedia.php b/inc/extensions/ext-yoomedia.php index 7b0dec36d8..851921132e 100644 --- a/inc/extensions/ext-yoomedia.php +++ b/inc/extensions/ext-yoomedia.php @@ -80,7 +80,7 @@ switch (getExtensionMode()) { `y_reload` SMALLINT(6) UNSIGNED NOT NULL DEFAULT 0, `inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), -UNIQUE `y_type` (`type`,`y_id`)", +UNIQUE INDEX `y_type` (`type`,`y_id`)", 'Reload lock reminder for Yoo!Media campaigns'); break; diff --git a/inc/filter-functions.php b/inc/filter-functions.php index a292ca2647..ddecb475cb 100644 --- a/inc/filter-functions.php +++ b/inc/filter-functions.php @@ -288,6 +288,9 @@ function runFilterChain ($filterName, $filterData = NULL) { if (($active == 'Y') || ($active == 'A') || ((in_array($filterName, array('shutdown','extension_remove','post_extension_run_sql'))) && ($active == 'R'))) { // Is this filter there? if (!function_exists($filterFunction)) { + // Should be logged + logDebugMessage(__FUNCTION__, __LINE__, 'filterName=' . $filterName . ',filterFunction=' . $filterFunction . ' - AUTO-UNREGISTERED!'); + // Unregister it unregisterFilter(__FUNCTION__, __LINE__, $filterName, $filterFunction); diff --git a/inc/filters.php b/inc/filters.php index b4726417fe..872936cbda 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -60,8 +60,12 @@ function FILTER_FLUSH_FILTERS () { // Is the extension ext-sql_patches updated? if ((!isExtensionInstalled('sql_patches')) || (isExtensionInstalledAndOlder('sql_patches', '0.5.9'))) { + // Log only in debug mode + if (isDebugModeEnabled()) { + logDebugMessage(__FUNCTION__, __LINE__, 'Cannot flush filters, sql_patches might be missing. isExtensionInstalled()=' . intval(isExtensionInstalled('sql_patches')) . ',isExtensionInstalledAndOlder()=' . intval(isExtensionInstalledAndOlder('sql_patches', '0.5.9'))); + } // END - if + // Abort silently here - logDebugMessage(__FUNCTION__, __LINE__, 'Cannot flush filters, sql_patches might be missing. isExtensionInstalled()=' . isExtensionInstalled('sql_patches') . ',isExtensionInstalledAndOlder()=' . isExtensionInstalledAndOlder('sql_patches', '0.5.9')); return false; } // END - if diff --git a/inc/fix_filters.php b/inc/fix_filters.php index 547616edd5..b7dc7a9f40 100644 --- a/inc/fix_filters.php +++ b/inc/fix_filters.php @@ -72,7 +72,7 @@ SQL_FREERESULT($result); // Now insert our unqiue key addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_filters` DROP KEY `name_function`'); -addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_filters` ADD UNIQUE `name_function` (`filter_name` , `filter_function`)'); +addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_filters` ADD UNIQUE INDEX `name_function` (`filter_name` , `filter_function`)'); // [EOF] ?> diff --git a/inc/fix_menu.php b/inc/fix_menu.php index 99fda9dab2..da6e5dcf97 100644 --- a/inc/fix_menu.php +++ b/inc/fix_menu.php @@ -99,11 +99,11 @@ foreach (array('guest','member','admin') as $menu) { // Now insert our unqiue key for action-what combination addSql(sprintf("ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` DROP KEY `action_what`", $menu)); - addSql(sprintf("ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` ADD UNIQUE `action_what` (`action` , `what`)", $menu)); + addSql(sprintf("ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` ADD UNIQUE INDEX `action_what` (`action` , `what`)", $menu)); // Now insert our unqiue key for what addSql(sprintf("ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` DROP KEY `what`", $menu)); - addSql(sprintf("ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` ADD UNIQUE `what` (`what`)", $menu)); + addSql(sprintf("ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` ADD UNIQUE INDEX `what` (`what`)", $menu)); // And run all runFilterChain('run_sqls'); diff --git a/inc/fix_refsystem.php b/inc/fix_refsystem.php index 31bbf1d420..916795cd0f 100644 --- a/inc/fix_refsystem.php +++ b/inc/fix_refsystem.php @@ -50,7 +50,7 @@ if (!SQL_HASZERONUMS($result)) { SQL_QUERY('UPDATE `{?_MYSQL_PREFIX?}_refsystem` SET `level`=`level`+1', __FILE__, __LINE__); // Add it again - SQL_ALTER_TABLE('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` ADD UNIQUE `userid_level` (`userid`,`level`)', __FILE__, __LINE__); + SQL_ALTER_TABLE('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` ADD UNIQUE INDEX `userid_level` (`userid`,`level`)', __FILE__, __LINE__); // Rebuild cache rebuildCache('refsystem', 'refsystem'); -- 2.39.5