Coalesce migration of Reactions.ChannelId to '' if Post does not exist. (#20643)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
059ea7eb44
Коммит
5c929c4952
@@ -14,7 +14,7 @@ EXECUTE addColumnIfNotExists;
|
|||||||
DEALLOCATE PREPARE addColumnIfNotExists;
|
DEALLOCATE PREPARE addColumnIfNotExists;
|
||||||
|
|
||||||
|
|
||||||
UPDATE Reactions SET ChannelId = (select ChannelId from Posts where Posts.Id = Reactions.PostId) WHERE ChannelId="";
|
UPDATE Reactions SET ChannelId = COALESCE((select ChannelId from Posts where Posts.Id = Reactions.PostId), '') WHERE ChannelId="";
|
||||||
|
|
||||||
|
|
||||||
SET @preparedStatement = (SELECT IF(
|
SET @preparedStatement = (SELECT IF(
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
ALTER TABLE reactions ADD COLUMN IF NOT EXISTS channelid varchar(26) NOT NULL DEFAULT '';
|
ALTER TABLE reactions ADD COLUMN IF NOT EXISTS channelid varchar(26) NOT NULL DEFAULT '';
|
||||||
UPDATE reactions SET channelid = (select channelid from posts where posts.id = reactions.postid) WHERE channelid='';
|
UPDATE reactions SET channelid = COALESCE((select channelid from posts where posts.id = reactions.postid), '') WHERE channelid='';
|
||||||
CREATE INDEX IF NOT EXISTS idx_reactions_channel_id on reactions (channelid);
|
CREATE INDEX IF NOT EXISTS idx_reactions_channel_id on reactions (channelid);
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user