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);
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
// 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