From 1ba3f564a64c4c00e9c9ff1c4e17dc600c4ba2fc Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Tue, 9 Dec 2014 14:34:59 +0100 Subject: [PATCH] Changed default value of the time column in wcf1_like to 1 --- com.woltlab.wcf/update_2.1.0_alpha_1.sql | 12 ++++++++++++ .../system/importer/AbstractLikeImporter.class.php | 2 +- wcfsetup/setup/db/install.sql | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) 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) ); -- 2.20.1