X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fextensions%2Fext-sql_patches.php;h=4517ec3a44a4e0e67ad814080da95abdb2c01a8c;hp=7e99c8bfa41e23f59f7ca55c0a6608d9c055e665;hb=f7f6e55ee0d90558ad773ce6168767c0af816696;hpb=36a31ecf3137283ddd5d7aad121bacf3df54e2e1 diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index 7e99c8bfa4..4517ec3a44 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -38,13 +38,13 @@ if (!defined('__SECURITY')) { } // Version number -$EXT_VERSION = "0.4.9"; +$EXT_VERSION = "0.5.0"; // Auto-set extension version if (!isset($EXT_VER)) $EXT_VER = $EXT_VERSION; // Version history array (add more with , "0.1" and so on) -$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7", "0.4.8", "0.4.9"); +$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7", "0.4.8", "0.4.9", "0.5.0"); switch ($EXT_LOAD_MODE) { @@ -85,6 +85,7 @@ action='account'"; $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las"; $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las_data"; $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_stats"; + $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_refs"; // Drop indexes $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions DROP UNIQUE KEY (ext_name)"; @@ -147,7 +148,7 @@ case "update": // Update an extension $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config CHANGE auto_purge auto_purge BIGINT(20) UNSIGNED NOT NULL DEFAULT '1209600'"; // Update notes (these will be set as task text!) - $UPDATE_NOTES = "In der Tabelle mxchange_config musste die Spalte auto_purge (autom. Löschen von Bestätigungsmails angepasst werden (war auf dem Testsystem auf tiny(4) gesetzt.)"; + $UPDATE_NOTES = "In der Tabelle "._MYSQL_PREFIX."_config musste die Spalte auto_purge (autom. Löschen von Bestätigungsmails angepasst werden (war auf dem Testsystem auf tiny(4) gesetzt.)"; break; case "0.0.3": // SQL queries for v0.0.3 @@ -632,13 +633,37 @@ PRIMARY KEY (id) // Update notes (these will be set as task text!) $UPDATE_NOTES = "User-Hash zum Bestätigen wird auf NULL gesetzt, wenn Account bestätigt wird."; break; + + case "0.5.0": // SQL queries for v0.5.0 + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refsystem` DROP INDEX `level`"; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refsystem` DROP INDEX `userid`, ADD UNIQUE `userid_level` (`userid`,`level`)"; + $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_refs`"; + $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_user_refs` ( +`id` bigint(20) NOT NULL auto_increment, +`userid` bigint(20) NOT NULL DEFAULT 0, +`level` smallint(6) NOT NULL DEFAULT 0, +`refid` bigint(20) NOT NULL DEFAULT 0, +`refback` float(4,1) NOT NULL DEFAULT 0.0, +PRIMARY KEY (`id`), +UNIQUE `user_refid` (`userid`,`level`,`refid`), +KEY (`level`), +KEY (`refid`), +) ENGINE=MyISAM COMMENT='User Referals With Refback'"; + + // Update notes (these will be set as task text!) + $UPDATE_NOTES = "Referal-System unterstützt nun detailierte Referal-Übersicht und vieles mehr."; + + // Execute this special file on this update + $INC_POOL[] = PATH."inc/gen_refback.php"; + break; } break; default: // Do stuff when extension is loaded // When the sql_patches is not installed we cannot load it's configuration... *sigh* if (GET_EXT_VERSION("sql_patches") != '') { - $_CONFIG['secret_key'] = ""; + // Init key + $_CONFIG['secret_key'] = ""; // Read key from secret file if ((empty($_CONFIG['file_hash'])) || (empty($_CONFIG['master_salt'])) || (empty($_CONFIG['pass_scramble']))) { @@ -697,4 +722,4 @@ $EXT_LANG_PREFIX = "sql_patches"; $EXT_ALWAYS_ACTIVE = "Y"; // -?> \ No newline at end of file +?>