]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-sql_patches.php
Wrapper functions introduced for configuration, loaders refactured:
[mailer.git] / inc / extensions / ext-sql_patches.php
index 1549db5e50e4b9098d07613efa1c357a91f02531..2c2ce2db0110758846e06f4df72534c0635030fa 100644 (file)
@@ -116,7 +116,7 @@ switch (getExtensionMode()) {
                                break;
 
                        case '0.0.2': // SQL queries for v0.0.2
-                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `auto_purge` `auto_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getOneDay()*14)."");
+                               addConfigChangeSql('auto_purge', 'auto_purge', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (getOneDay()*14));
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("In der Tabelle <strong>{?_MYSQL_PREFIX?}_config</strong> musste die Spalte <strong>auto_purge</strong> (autom. L&ouml;schen von Best&auml;tigungsmails angepasst werden (war auf dem Testsystem auf TINYINT(4) gesetzt.)");
@@ -197,7 +197,7 @@ switch (getExtensionMode()) {
                                break;
 
                        case '0.1.3': // SQL queries for v0.1.3
-                               addConfigAddSql("refid_target ENUM('register','index') NOT NULL DEFAULT 'register'");
+                               addConfigAddSql('refid_target', "ENUM('register','index') NOT NULL DEFAULT 'register'");
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Auf welche Seite soll der Ref-Link zeigen? Eingangsseite oder Anmeldeformular?");
@@ -369,7 +369,7 @@ switch (getExtensionMode()) {
                        case '0.3.2': // SQL queries for v0.3.2
                                // Connection table between the menu system and the "logical area system"
                                addDropTableSql('admin_menu_las');
-                               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_admin_menu_las` (
+                               addCreateTableSql('admin_menu_las', "(
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `la_id` VARCHAR(255) NOT NULL DEFAULT '',
 `la_action` VARCHAR(255) NOT NULL DEFAULT '',
@@ -381,7 +381,7 @@ PRIMARY KEY (`id`)
 ) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Menu system -> LAS'");
                                // All "logical areas" together
                                addDropTableSql('admin_menu_las_data');
-                               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_admin_menu_las_data` (
+                               addCreateTableSql('admin_menu_las_data', "(
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `la_id` VARCHAR(255) NOT NULL DEFAULT '',
 `la_title` VARCHAR(255) NOT NULL DEFAULT '',
@@ -408,7 +408,7 @@ PRIMARY KEY (`id`)
 
                                // The statistics table
                                addDropTableSql('admin_las_stats');
-                               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_admin_las_stats` (
+                               addCreateTableSql('admin_las_stats', "(
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `type` ENUM('la','action','what') NOT NULL DEFAULT 'what',
@@ -616,7 +616,7 @@ PRIMARY KEY (`id`)
 
                        case '0.5.9': // SQL queries for v0.5.9
                                addDropTableSql('filters');
-                               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_filters` (
+                               addCreateTableSql('filters', "(
 `filter_id` BIGINT(20) UNSIGNED AUTO_INCREMENT,
 `filter_name` VARCHAR(50) NOT NULL DEFAULT '',
 `filter_function` VARCHAR(100) NOT NULL DEFAULT '',
@@ -671,7 +671,7 @@ PRIMARY KEY (`filter_id`)
                                break;
 
                        case '0.6.5': // SQL queries for v0.6.5
-                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `css_php` `css_php` ENUM('DIRECT','FILE','INLINE') NOT NULL DEFAULT 'FILE'");
+                               addConfigChangeSql('css_php', 'css_php', "ENUM('DIRECT','FILE','INLINE') NOT NULL DEFAULT 'FILE'");
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Ausgabe der CSS-Dateien entweder per css.php oder sie sind direkt eingebunden.");
@@ -687,7 +687,8 @@ PRIMARY KEY (`filter_id`)
                                break;
 
                        case '0.6.7': // SQL queries for v0.6.7
-                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `index_delay` `index_delay` TINYINT(3) NOT NULL DEFAULT 0");
+                               addConfigChangeSql('index_delay', 'index_delay', 'TINYINT(3) NOT NULL DEFAULT 0');
+
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Die Weiterleitungseinstellung muss auch Werte kleiner Null akzeptieren.");
                                break;
@@ -715,7 +716,7 @@ PRIMARY KEY (`filter_id`)
                        case '0.7.0': // SQL queries for 0.7.0
                                // Table definition
                                addDropTableSql('dns_cache');
-                               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_dns_cache` (
+                               addCreateTableSql('dns_cache', "(
 `hostname` VARCHAR(255) NOT NULL,
 `ip` VARCHAR(15) NOT NULL,
 `added` DATETIME NOT NULL,
@@ -724,7 +725,7 @@ INDEX (`ip`)
 ) ENGINE = {?_TABLE_TYPE?}");
 
                                // Configuration
-                               addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `dns_cache_timeout` BIGINT(20) NOT NULL DEFAULT ' . (60*60*24));
+                               addConfigAddSql('dns_cache_timeout', 'BIGINT(20) NOT NULL DEFAULT ' . (60*60*24));
 
                                // Register filter
                                registerFilter('reset', 'CLEANUP_DNS_CACHE', false, true, isExtensionDryRun());
@@ -771,8 +772,8 @@ INDEX (`ip`)
                                break;
 
                        case '0.7.6': // SQL queries for v0.7.6
-                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `last_month` `last_month` TINYINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT 00");
-                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `last_week` `last_week` TINYINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT 00");
+                               addConfigChangeSql('last_month', 'last_month', 'TINYINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT 00');
+                               addConfigChangeSql('last_week', 'last_week', 'TINYINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT 00');
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Spaltentyp fuer kleine Zahlen sollten auch z.B. TINYINT sein.");