]> git.mxchange.org Git - mailer.git/commitdiff
Some more rewrites to better functions
authorRoland Häder <roland@mxchange.org>
Mon, 12 Nov 2012 19:18:03 +0000 (19:18 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 12 Nov 2012 19:18:03 +0000 (19:18 +0000)
inc/db/lib-mysql3.php
inc/extensions/ext-bonus.php
inc/extensions/ext-sql_patches.php

index c9370f33a802c90ad79ffe75161aae5186d1dab2..4dfca09fd0a1bb53fe2b6bb4b24323125217ffd6 100644 (file)
@@ -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])) {
index 40ac53e02f2aace5a2a458de652ff34fa09b3eff..f6b69eff7755c79aa24a5b3e141cdd8d0bd39c44 100644 (file)
@@ -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).");
index c309afee2bea104ef5af6716e1e8291842479937..0331351f5a1980abd633c474b7a599ae5107650c 100644 (file)
@@ -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&uuml;rzt, damit die Schl&uuml;ssel passen.");