Disable part of the migration 58

This commit is contained in:
Fedor Indutny 2022-05-18 09:44:43 -07:00 committed by GitHub
parent a114e4e210
commit e86a312b74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 83 deletions

View file

@ -21,13 +21,17 @@ export default function updateToSchemaVersion58(
`
--- Promote unread status in JSON to SQL column
UPDATE messages
SET
readStatus = ${ReadStatus.Unread},
seenStatus = ${SeenStatus.Unseen}
WHERE
json_extract(json, '$.unread') IS true OR
json_extract(json, '$.unread') IS 1;
-- NOTE: This was disabled because the 'unread' json field was deprecated
-- in b0750e5f4e1f79f0f177b17cbe06d688431f948d, but the old value was kept
-- in the messages created before the release of that commit.
--
-- UPDATE messages
-- SET
-- readStatus = ${ReadStatus.Unread},
-- seenStatus = ${SeenStatus.Unseen}
-- WHERE
-- json_extract(json, '$.unread') IS true OR
-- json_extract(json, '$.unread') IS 1;
--- Clean up all old messages that still have a null read status
--- Note: we don't need to update seenStatus, because that was defaulted to zero