Skip to content

Fix post numbers#41

Open
majoskorec wants to merge 2 commits intoFriendsOfFlarum:1.xfrom
majoskorec:fix-post-numbers
Open

Fix post numbers#41
majoskorec wants to merge 2 commits intoFriendsOfFlarum:1.xfrom
majoskorec:fix-post-numbers

Conversation

@majoskorec
Copy link
Contributor

Case
merging by date
discussion to which you want to merge is not in time order (e.g. you merge two discussion by append)
and at least one post was deleted (so count != max number)

posts:
post | created at | number | new number
P1 | 2020-01-01 | 1 | 2
P2 | 2019-01-01 | 3 | 1

fixPostsNumber will failed on updating P2 with new number 1

Changes proposed in this pull request:
first "renumber" start with max number
then "renumber" start with 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant