From: Marcel Werk Date: Tue, 9 Dec 2014 13:34:59 +0000 (+0100) Subject: Changed default value of the time column in wcf1_like to 1 X-Git-Tag: 2.1.0_Beta_1~80 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1ba3f564a64c4c00e9c9ff1c4e17dc600c4ba2fc;p=GitHub%2FWoltLab%2FWCF.git Changed default value of the time column in wcf1_like to 1 --- diff --git a/com.woltlab.wcf/update_2.1.0_alpha_1.sql b/com.woltlab.wcf/update_2.1.0_alpha_1.sql index 36ef05db94..043f538279 100644 --- a/com.woltlab.wcf/update_2.1.0_alpha_1.sql +++ b/com.woltlab.wcf/update_2.1.0_alpha_1.sql @@ -191,6 +191,9 @@ ALTER TABLE wcf1_moderation_queue DROP FOREIGN KEY objectTypeID; ALTER TABLE wcf1_moderation_queue DROP KEY affectedObject; ALTER TABLE wcf1_moderation_queue ADD FOREIGN KEY (objectTypeID) REFERENCES wcf1_object_type (objectTypeID) ON DELETE CASCADE; +/* change default value to '1' */ +ALTER TABLE wcf1_like CHANGE time time INT(10) NOT NULL DEFAULT 1; + ALTER TABLE wcf1_page_menu_item ADD originIsSystem TINYINT(1) NOT NULL DEFAULT 0; /* truncate table to ensure consistency */ @@ -284,3 +287,12 @@ DELETE FROM wcf1_style_variable WHERE variableName = 'wcfMainMenuHoverBackground */ INSERT INTO wcf1_bbcode_media_provider (title, regex, html) VALUES ('Soundcloud set', 'https?://soundcloud.com/(?P[a-zA-Z0-9_-]+)/sets/(?P[a-zA-Z0-9_-]+)', ''); + +/* + * ######################## + * ### MINOR UPDATES ###### + * ######################## + */ + +/* change default value to '1' */ +UPDATE wcf1_like SET time = 1 WHERE time = 0; \ No newline at end of file diff --git a/wcfsetup/install/files/lib/system/importer/AbstractLikeImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractLikeImporter.class.php index 9793e23605..72a1dea698 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractLikeImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractLikeImporter.class.php @@ -31,7 +31,7 @@ class AbstractLikeImporter extends AbstractImporter { if ($data['objectUserID']) $data['objectUserID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['objectUserID']); $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']); if (!$data['userID']) return 0; - if (empty($data['time'])) $data['time'] = 0; + if (empty($data['time'])) $data['time'] = 1; $sql = "INSERT IGNORE INTO wcf".WCF_N."_like (objectID, objectTypeID, objectUserID, userID, time, likeValue) diff --git a/wcfsetup/setup/db/install.sql b/wcfsetup/setup/db/install.sql index bcd0b80289..dd99d8dcaa 100644 --- a/wcfsetup/setup/db/install.sql +++ b/wcfsetup/setup/db/install.sql @@ -470,7 +470,7 @@ CREATE TABLE wcf1_like ( objectTypeID INT(10) NOT NULL, objectUserID INT(10), userID INT(10) NOT NULL, - time INT(10) NOT NULL DEFAULT 0, + time INT(10) NOT NULL DEFAULT 1, likeValue TINYINT(1) NOT NULL DEFAULT 1, UNIQUE KEY (objectTypeID, objectID, userID) );