Running 5.24 on a postgres 9.2 server gives
This is because LATERAL keyword is only available from 9.3 onwards.
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.