More default values rewritten, UNSIGNED added to many numerical database columns...
[mailer.git] / inc / extensions / ext-sql_patches.php
index d8a8920f89e9c173eb25a2143728f8a1a192d904..8d8b5cc467dd29350f5112d9b4a3fd27129eeb97 100644 (file)
@@ -155,7 +155,7 @@ case "update": // Update an extension
                $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config CHANGE auto_purge auto_purge BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day']*14)."";
 
                // Update notes (these will be set as task text!)
-               $UPDATE_NOTES = "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 tiny(4) gesetzt.)";
+               $UPDATE_NOTES = "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.)";
                break;
 
        case "0.0.3": // SQL queries for v0.0.3
@@ -218,7 +218,7 @@ case "update": // Update an extension
        case "0.1.1": // SQL queries for v0.1.1
                $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title='Home-/Eingangsseite', descr='Stellen Sie hier ein, welcher Men&uuml;punkt (what-welcome ist Standart) als Einstiegspunkt in das Men&uuml;system genutzt werden soll und wie die automatische Weiterleitung in der Eingangsseite funktionieren soll.' WHERE `what`='config_home' LIMIT 1";
                $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD index_delay TINYINT(3) UNSIGNED NOT NULL DEFAULT '-1'";
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD index_cookie BIGINT(20) UNSIGNED NOT NULL DEFAULT '31536000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD index_cookie BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day']*365)."";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Sie k&ouml;nnen nun <A href=\"".URL."/modules.php?module=admin&amp;`what`=config_home\">hier</A> die Verz&ouml;gerungszeit in der <A href=\"".URL."/index.php\">Eingangsseite</A> einstellen.";
@@ -296,14 +296,14 @@ PRIMARY KEY(id)
                break;
 
        case "0.2.0": // SQL queries for v0.2.0
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_jackpot CHANGE points points DOUBLE(22,5) NOT NULL DEFAULT 0.00000";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_jackpot CHANGE points points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000";
 
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payments CHANGE payment payment DOUBLE(22,5) NOT NULL DEFAULT 0.00000";
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payments CHANGE price price DOUBLE(22,5) NOT NULL DEFAULT 0.00000";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payments CHANGE payment payment FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payments CHANGE price price FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000";
 
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE used_points used_points DOUBLE(22,5) NOT NULL DEFAULT 0.00000";
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_points CHANGE points points DOUBLE(22,5) NOT NULL DEFAULT 0.00000";
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_points CHANGE locked_points locked_points DOUBLE(22,5) NOT NULL DEFAULT 0.00000";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE used_points used_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_points CHANGE points points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_points CHANGE locked_points locked_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "5 Nachkommastellen implementiert";
@@ -654,7 +654,7 @@ PRIMARY KEY (id)
                break;
 
        case "0.5.2": // SQL queries for v0.5.2
-               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refdepths` CHANGE `percents` `percents` FLOAT(8,5) NOT NULL DEFAULT 0.00000";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refdepths` CHANGE `percents` `percents` FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Prozents&aum;tze k&ouml;nnen nun f&uuml;nf Stelle hinter dem Komma sein.";
@@ -688,8 +688,8 @@ PRIMARY KEY (id)
        case "0.5.6": // SQL queries for v0.5.6
                $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_stats_data`";
                $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_user_stats_data` (
-`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
-`userid` BIGINT(20) NOT NULL DEFAULT 0,
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `stats_type` VARCHAR(255) NOT NULL DEFAULT 'unknown',
 `stats_data` VARCHAR(255) NOT NULL DEFAULT '',
 `inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,