<instruction type="file">files_update.tar</instruction>
<instruction type="template">templates_update.tar</instruction>
<instruction type="language">language/*.xml</instruction>
+
+ <instruction type="script" run="standalone">acp/update_rc3.php</instruction>
+
<instruction type="sql">update_rc3.sql</instruction>
<instruction type="option">option.xml</instruction>
/* d2fbb3b */
-UPDATE wcf1_user_rank CHANGE groupID groupID INT(10) NOT NULL;
-ALTER TABLE wcf1_user_rank DROP KEY groupID;
+ALTER TABLE wcf1_user_rank CHANGE groupID groupID INT(10) NOT NULL;
ALTER TABLE wcf1_user_rank ADD FOREIGN KEY (groupID) REFERENCES wcf1_user_group ON DELETE CASCADE;
+++ /dev/null
-<?php
-use wcf\system\database\util\PreparedStatementConditionBuilder;
-use wcf\system\WCF;
-
-/**
- * @author Alexander Ebert
- * @copyright 2001-2013 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package com.woltlab.wcf
- * @category Community Framework
- */
-
-// remove outdated language items
-$conditions = new PreparedStatementConditionBuilder();
-$conditions->add("languageItem IN (?)", array(array(
- 'wcf.date.month.jan',
- 'wcf.date.month.feb',
- 'wcf.date.month.mar',
- 'wcf.date.month.apr',
- // may is intentionally left out because it conflicts with the full month name
- 'wcf.date.month.jun',
- 'wcf.date.month.jul',
- 'wcf.date.month.aug',
- 'wcf.date.month.sep',
- 'wcf.date.month.oct',
- 'wcf.date.month.nov',
- 'wcf.date.month.dec'
-)));
-$sql = "DELETE FROM wcf".WCF_N."_language_item
- ".$conditions;
-$statement = WCF::getDB()->prepareStatement($sql);
-$statement->execute($conditions->getParameters());
--- /dev/null
+<?php
+use wcf\system\WCF;
+
+/**
+ * @author Alexander Ebert
+ * @copyright 2001-2013 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @category Community Framework
+ */
+
+// commit d2fbb3b
+
+// search for foreign key name and drop it
+$sql = "SHOW INDEX FROM wcf".WCF_N."_user_rank";
+$statement = WCF::getDB()->prepareStatement($sql);
+$statement->execute();
+while ($row = $statement->fetchArray()) {
+ if ($row['Column_name'] == 'groupID' && preg_match('~_fk$~', $row['Key_name'])) {
+ // drop key
+ WCF::getDB()->getEditor()->dropForeignKey("wcf".WCF_N."_user_rank", $row['Key_name']);
+
+ // remove key from sql log
+ $sql = "DELETE FROM wcf".WCF_N."_package_installation_sql_log
+ WHERE sqlTable = ?
+ AND sqlIndex = ?";
+ $statement = WCF::getDB()->prepareStatement($sql);
+ $statement->execute(array(
+ "wcf".WCF_N."_user_rank",
+ $row['Key_name']
+ ));
+
+ break;
+ }
+}