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 posts number #30

Merged
merged 2 commits into from
Dec 3, 2021
Merged

Conversation

majoskorec
Copy link
Contributor

Case
discussion A have 3 posts with numbers : 1,2,3
discussion B have 2 posts with numbers : 1,2
with time order A1,A2,A3,B1,B2

then you "Delete Forever" post 2 at discussion A

discussion A have 2 posts with numbers : 1,3
discussion B have 2 posts with numbers : 1,2
with time order A1,A3,B1,B2

when you merge discussion B to A it "renumber"
B2 => A4
B1 => A3
A3 => A2
A1 => A1

but second sql update (B1 => A3) throws error that unique index A3 already exist

Changes proposed in this pull request:
we will fix posts number on target discussion before merging

Copy link
Member

@imorland imorland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR! This has been an issue for some time, with various attempts at resolving it.

I'll get this merged, I'm sure it will help for some scenarios!

@imorland imorland merged commit db136a8 into FriendsOfFlarum:master Dec 3, 2021
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.

3 participants