Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix post numbers #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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