]> git.mxchange.org Git - mailer.git/commitdiff
Array name fixed, unique index will be dropped and re-added while gen_refback.php...
authorRoland Häder <roland@mxchange.org>
Sat, 4 Oct 2008 13:01:32 +0000 (13:01 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 4 Oct 2008 13:01:32 +0000 (13:01 +0000)
inc/databases.php
inc/extensions/ext-refback.php
inc/gen_refback.php

index a8a6a86fc13069717b7eca7cb7e2b6b2f960bb57..8151bbf3addce8c541008b06ea747fff44175c37 100644 (file)
@@ -113,7 +113,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
-define('CURR_SVN_REVISION', "441");
+define('CURR_SVN_REVISION', "443");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index 446d0d6a525a16bb4b63768a2dfc54178ce5e701..3945f2ec560ef13987ad2696f85ff006f495f9a3 100644 (file)
@@ -69,7 +69,7 @@ KEY (`refid`)
 case "remove": // Do stuff when removing extension
        // SQL commands to run
        $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_refs";
-       $SQLS[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='refback' LIMIT 1";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='refback' LIMIT 1";
        break;
 
 case "activate": // Do stuff when admin activates this extension
index be1a3a768967ce01de2acce01c79c00b7a711b27..7c29ede371ad238ac5636d8269ac899e41f6caaa 100644 (file)
@@ -43,8 +43,14 @@ require_once(PATH."inc/libs/refback_functions.php");
 // Sanity-check: Do we have ref level 0?
 $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_refsystem WHERE level=0", __FILE__, __LINE__);
 if (SQL_NUMROWS($result) > 0) {
+       // Remove index temporaly
+       SQL_QUERY("ALTER TABLE `"._MYSQL_PREFIX."_refsystem` DROP INDEX `userid_level`", __FILE__, __LINE__);
+
        // Upgrade refsystem, ref-level 0 is silly here
        SQL_QUERY("UPDATE "._MYSQL_PREFIX."_refsystem SET level=level+1", __FILE__, __LINE__);
+
+       // Add it again
+       SQL_QUERY("ALTER TABLE `"._MYSQL_PREFIX."_refsystem` ADD UNIQUE `userid_level` ( `userid` , `level` )", __FILE__, __LINE__);
 } // END - if
 
 // Free result