From: Matthias Schmidt Date: Fri, 12 Aug 2011 13:34:24 +0000 (+0200) Subject: Adjusted database table name of user storage X-Git-Tag: 2.0.0_Beta_1~1882^2~1^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=461a69eab124961c068c68b83a7dd4a1008c45a6;p=GitHub%2FWoltLab%2FWCF.git Adjusted database table name of user storage --- diff --git a/wcfsetup/install/files/lib/system/user/storage/UserStorageHandler.class.php b/wcfsetup/install/files/lib/system/user/storage/UserStorageHandler.class.php index e3f03cbba7..feafa11beb 100644 --- a/wcfsetup/install/files/lib/system/user/storage/UserStorageHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/storage/UserStorageHandler.class.php @@ -53,7 +53,7 @@ class UserStorageHandler extends SingletonFactory { $conditions->add("packageID = ?", array(PACKAGE_ID)); $sql = "SELECT * - FROM wcf".WCF_N."_storage + FROM wcf".WCF_N."_user_storage ".$conditions; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); @@ -139,7 +139,7 @@ class UserStorageHandler extends SingletonFactory { * @param integer $packageID */ public function resetAll($field, $packageID = PACKAGE_ID) { - $sql = "DELETE FROM wcf".WCF_N."_storage + $sql = "DELETE FROM wcf".WCF_N."_user_storage WHERE field = ? AND packageID = ?"; $statement = WCF::getDB()->prepareStatement($sql); @@ -155,7 +155,7 @@ class UserStorageHandler extends SingletonFactory { public function shutdown() { // remove outdated entries if (count($this->resetFields)) { - $sql = "DELETE FROM wcf".WCF_N."_storage + $sql = "DELETE FROM wcf".WCF_N."_user_storage WHERE userID = ? AND field = ? AND packageID = ?"; @@ -176,7 +176,7 @@ class UserStorageHandler extends SingletonFactory { // insert data if (count($this->updateFields)) { - $sql = "INSERT INTO wcf".WCF_N."_storage + $sql = "INSERT INTO wcf".WCF_N."_user_storage (userID, field, fieldValue, packageID) VALUES (?, ?, ?, ?)"; $statement = WCF::getDB()->prepareStatement($sql); diff --git a/wcfsetup/setup/db/install.sql b/wcfsetup/setup/db/install.sql index 6d74acbaa3..6b6aff650d 100644 --- a/wcfsetup/setup/db/install.sql +++ b/wcfsetup/setup/db/install.sql @@ -667,13 +667,13 @@ CREATE TABLE wcf1_template_listener ( KEY templateName (environment, templateName) ); -DROP TABLE IF EXISTS wcf1_storage; -CREATE TABLE wcf1_storage ( +DROP TABLE IF EXISTS wcf1_user_storage; +CREATE TABLE wcf1_user_storage ( userID INT(10) NOT NULL, field VARCHAR(80) NOT NULL DEFAULT '', fieldValue TEXT, packageID INT(10), - UNIQUE KEY storageData (userID, field, packageID) + UNIQUE KEY userStorageData (userID, field, packageID) ); /**** foreign keys ****/ @@ -762,8 +762,8 @@ ALTER TABLE wcf1_session ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ALTER TABLE wcf1_session_data ADD FOREIGN KEY (sessionID) REFERENCES wcf1_session (sessionID) ON DELETE CASCADE; -ALTER TABLE wcf1_storage ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE CASCADE; -ALTER TABLE wcf1_storage ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE; +ALTER TABLE wcf1_user_storage ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE CASCADE; +ALTER TABLE wcf1_user_storage ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE; ALTER TABLE wcf1_style ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;