]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions-functions.php
Always change column name
[mailer.git] / inc / extensions-functions.php
index 90b2bd495df94252c973e6c72a9bd5241d997fd8..9aca9cf4141a34308c0e1864be12ac31ec312c21 100644 (file)
@@ -1910,8 +1910,27 @@ function addConfigAddSql ($columnName, $columnSql) {
        }
 }
 
+// Drop configuration entry if found for actual extension
+function addConfigDropSql ($columnName) {
+       // Is the column there?
+       if (isSqlTableColumnFound('{?_MYSQL_PREFIX?}_config', $columnName)) {
+               // Found, so add it
+               addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_config` DROP `' . $columnName . '`');
+       } else {
+               // Add debug line, debug_report_bug() would cause some extenion updates fail
+               logDebugMessage(__FUNCTION__, __LINE__, 'Configuration entry ' . $columnName . ' not found.');
+       }
+}
+
+// Change configuration entry for actual extension
+function addConfigChangeSql ($oldColumnName, $newColumnName, $columnSql) {
+       // Add the SQL statement
+       addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `' . $oldColumnName . '` `' . $newColumnName . '` ' . $columnSql);
+}
+
 // Enables/disables productive mode for current extension (used only while
 // registration).
+// @TODO This should be rewrittten to allow, more development states, e.g. 'planing','alpha','beta','beta2','stable'
 function enableExtensionProductive ($isProductive = true) {
        // Log debug message
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("ext_name=%s,isProductive=%d", getCurrentExtensionName(), intval($isProductive)));