* @property-read integer $userID id of the user who created the like
* @property-read integer $time timestamp at which the like has been created
* @property-read integer $likeValue value of the like (`+1` = like, `-1` = dislike, see `Like::LIKE` and `Like::Dislike`)
+ * @property-read integer $reactionTypeID reactionTypeID of the reaction
*/
class Like extends DatabaseObject {
/**
userID INT(10) NOT NULL,
time INT(10) NOT NULL DEFAULT 1,
likeValue TINYINT(1) NOT NULL DEFAULT 1,
+ reactionTypeID INT(10) NOT NULL,
UNIQUE KEY (objectTypeID, objectID, userID)
);
ALTER TABLE wcf1_like ADD FOREIGN KEY (objectTypeID) REFERENCES wcf1_object_type (objectTypeID) ON DELETE CASCADE;
ALTER TABLE wcf1_like ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE CASCADE;
ALTER TABLE wcf1_like ADD FOREIGN KEY (objectUserID) REFERENCES wcf1_user (userID) ON DELETE SET NULL;
+ALTER TABLE wcf1_like ADD FOREIGN KEY (reactionTypeID) REFERENCES wcf1_reaction_type (reactionTypeID) ON DELETE CASCADE;
ALTER TABLE wcf1_like_object ADD FOREIGN KEY (objectTypeID) REFERENCES wcf1_object_type (objectTypeID) ON DELETE CASCADE;
ALTER TABLE wcf1_like_object ADD FOREIGN KEY (objectUserID) REFERENCES wcf1_user (userID) ON DELETE SET NULL;