MM-43770: Rename to Threads.ThreadDeleteAt (#20074)

Old versions of the Mattermost server did not qualify queries scanning both `Posts` and `Threads`, and choke on the ambiguity in deciding between the new `DeleteAt` on `Threads` and the `DeleteAt` on `Posts` in existing queries.

While this problem is transient only while running multiple server versions, it effectively makes our backwards compatibility guarantee void, not to mention complicating cloud deployments.

Work around this by renaming `Threads.DeleteAt` to `Threads.ThreadDeleteAt`. The old migration is nulled out, but remains, since some test servers have already upgraded and manually fixing each affected instance would be problematic. Thew new migration takes care of removing the old column -- if it ever existed.

Fixes: https://mattermost.atlassian.net/browse/MM-43770

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Jesse Hallam
2022-04-29 14:42:38 -03:00
коммит произвёл GitHub
родитель 2474b40cb9
Коммит 72a5d99ae3
11 изменённых файлов: 70 добавлений и 46 удалений

Просмотреть файл

@@ -23,7 +23,8 @@ type Thread struct {
// to newest. Note that the root post author is not included in this list until they reply.
Participants StringArray `json:"participants"`
// DeleteAt is a denormalized copy of the root posts's DeleteAt.
// DeleteAt is a denormalized copy of the root posts's DeleteAt. In the database, it's
// named ThreadDeleteAt to avoid introducing a query conflict with older server versions.
DeleteAt int64 `json:"delete_at"`
}