ALTER PRIMARY KEY migration code does not work in Postgres 9.2

Description

Running 5.24 on a postgres 9.2 server gives

This is because LATERAL keyword is only available from 9.3 onwards.

QA Test Steps

  • Have a pre-existing mattermost instance on 5.23 with postgres 9.2.

  • Start the server built with this PR.

  • Verify that the primary key for Reactions table has the columns in order of - Postid, UserId, Emojiname. Before that, it should have been Userid, PostId, Emojiname

  • Start the server again and verify that it remains the same.

Repeat the experiment with postgres 9.6, and confirm that the 2 steps (starting, and then restarting) lead to the same result.

Mana

None

Assignee

Agniva De Sarker

QA Assignee

Rohitesh Gupta

Reporter

Agniva De Sarker

Epic Link

None

Fix versions

Mattermost Team

Platform

Sprint

None

QA Testing Areas

Other (write in QA test steps)

GitHub Issue

None

Components

None

Severity

S1_data_loss_or_crash
Configure