MM-39351: fixes LastRootPostAt being null (#19574)
* MM-39351: fixes LastRootPostAt being null After upgrading to v6.1 there is a chance for LastRootPostAt to be NULL. This might be due to a faulty migration when upgrading to v5.35. v5.35 had `create_msg_root_count` where LastRootPostAt was used as a temporary column which at the end was deleted. Then on v6.1 we are adding that column again, this time to keep. If the migration to v5.35 had failed and it didn't drop the column the `upgrade_cte` (v6.1) migration would leave some channels with `LastRootPostAt` being NULL. This resulted in crashing the app. This commit fixes that by running again a migration to again set LastRootPostAt only when it's NULL this time and then set it to 0 for channels that might still have LastRootPostAt being NULL (channels with no posts). PS: the whole issue arose when upon creating the `upgrade_cte` migration the create_msg_root_count migration was manually edited to change the column name from LastRootPostAt to LastRootAt. Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
@@ -8,7 +8,7 @@ insert_final_newline = true
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.go]
|
||||
[*.{go,sql}]
|
||||
indent_style = tab
|
||||
|
||||
[*.{js,jsx,json,html}]
|
||||
|
||||
Ссылка в новой задаче
Block a user