$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());
* @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);
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 = ?";
// 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);
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 ****/
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;