From 1724b6287d9be24e9267fd66b30d0204badec288 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 12 Nov 2012 19:18:03 +0000 Subject: [PATCH] Some more rewrites to better functions --- inc/db/lib-mysql3.php | 6 +++--- inc/extensions/ext-bonus.php | 6 +++--- inc/extensions/ext-sql_patches.php | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index c9370f33a8..4dfca09fd0 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -501,11 +501,11 @@ function SQL_ALTER_TABLE ($sql, $F, $L, $enableCodes = TRUE) { // Shall we run it? //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'tableName=' . $tableName . ', tableArray[3]=' . $tableArray[3] . ',keyName=' . $keyName); - if (($tableArray[3] == 'ADD') && (!isSqlTableIndexFound($tableName, $keyName))) { + if (($tableArray[3] == 'ADD') && (!ifSqlTableIndexExist($tableName, $keyName))) { // Send it to the SQL_QUERY() function to add it //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sql=' . $sql . ' - ADDING!'); $result = SQL_QUERY($sql, $F, $L, $enableCodes); - } elseif (($tableArray[3] == 'DROP') && (isSqlTableIndexFound($tableName, $keyName))) { + } elseif (($tableArray[3] == 'DROP') && (ifSqlTableIndexExist($tableName, $keyName))) { // Send it to the SQL_QUERY() function to drop it //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sql=' . $sql . ' - DROPPING!'); $result = SQL_QUERY($sql, $F, $L, $enableCodes); @@ -710,7 +710,7 @@ function ifSqlColumnExists ($tableName, $columnName) { } // Checks depending on the mode if the index is there -function isSqlTableIndexFound ($tableName, $keyName) { +function ifSqlTableIndexExist ($tableName, $keyName) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'tableName=' . $tableName . ',columnName=' . $keyName . ' - ENTERED!'); // Is there cache? if (!isset($GLOBALS[__FUNCTION__][$tableName][$keyName])) { diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index 40ac53e02f..f6b69eff77 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -581,9 +581,9 @@ ORDER BY break; case '0.9.2': // SQL queries for v0.9.2 - addExtensionChangeTableColumnSql('user_data', 'bonus_ral_en_notify` `bonus_ralley_enable_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0'); - addExtensionChangeTableColumnSql('user_data', 'bonus_ral_di_notify` `bonus_ralley_disable_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0'); - addExtensionChangeTableColumnSql('user_data', 'bonus_ral_notify` `bonus_rallley_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0'); + addExtensionChangeTableColumnSql('user_data', 'bonus_ral_en_notify', 'bonus_ralley_enable_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0'); + addExtensionChangeTableColumnSql('user_data', 'bonus_ral_di_notify', 'bonus_ralley_disable_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0'); + addExtensionChangeTableColumnSql('user_data', 'bonus_ral_notify', 'bonus_rallley_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0'); // Update notes setExtensionUpdateNotes("Umbenannt nach neuer Konvention (bitte Einstellungen kontrollieren)."); diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index c309afee2b..0331351f5a 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -706,12 +706,12 @@ UNIQUE INDEX `name_function` (`filter_name`, `filter_function`)", break; case '0.6.8': // SQL queries for v0.6.8 - addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_admin_menu` CHANGE `action` `action` VARCHAR(50) NOT NULL'); - addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_admin_menu` CHANGE `what` `what` VARCHAR(50) NULL DEFAULT NULL'); - addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_guest_menu` CHANGE `action` `action` VARCHAR(50) NOT NULL'); - addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_admin_menu` CHANGE `what` `what` VARCHAR(50) NULL DEFAULT NULL'); - addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_member_menu` CHANGE `action` `action` VARCHAR(50) NOT NULL'); - addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_admin_menu` CHANGE `what` `what` VARCHAR(50) NULL DEFAULT NULL'); + addExtensionChangeTableColumnSql('admin_menu', 'action', 'action` VARCHAR(50) NOT NULL'); + addExtensionChangeTableColumnSql('admin_menu', 'what', 'what` VARCHAR(50) NULL DEFAULT NULL'); + addExtensionChangeTableColumnSql('guest_menu', 'action', 'action` VARCHAR(50) NOT NULL'); + addExtensionChangeTableColumnSql('admin_menu', 'what', 'what` VARCHAR(50) NULL DEFAULT NULL'); + addExtensionChangeTableColumnSql('member_menu', 'action', 'action` VARCHAR(50) NOT NULL'); + addExtensionChangeTableColumnSql('admin_menu', 'what', 'what` VARCHAR(50) NULL DEFAULT NULL'); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Spalten verkürzt, damit die Schlüssel passen."); -- 2.39.5