-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix: Delete duplicate ticket tags #6386
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: Delete duplicate ticket tags #6386
Conversation
…nto delete-duplicate-tags
iamareebjamal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think after the previous migration has failed due to duplicate ticket tags, this will even get executed?
And do you think setting deleted_at will do anything to prevent the unique constraint fot ticket tags?
You are again sending the PR without reproducing the bug and even verifying that it works. Flailing your arms in a dark room blindfolded will not solve this bug
|
@iamareebjamal I changed the revision and downrevision appropriately. And I am also appending '.deleted' to the ticket-tag. It works locally. I check running the migrations. Though as one more migration has merged for event_invoice, I have to make those changes. |
Codecov Report
@@ Coverage Diff @@
## development #6386 +/- ##
============================================
Coverage 65.16% 65.16%
============================================
Files 287 287
Lines 14810 14810
============================================
Hits 9651 9651
Misses 5159 5159Continue to review full report at Codecov.
|
|
@iamareebjamal Done. |
|
This will work, but what about tickets linked with the deleted ticket tag? |
|
@iamareebjamal I couldn't find where it's saving the information about the ticket linked with the ticket-tag. |
|
Ran your migration. There are still duplicates and the proceeding migration failed. What did you even test? @CosmicCoder96 Are ticket tags even being used, there is no entry in association table? |
|
@iamareebjamal I tested it using |
|
Then it is wrong query |
|
@iamareebjamal I have corrected the query. Please review. |
|
Doesn't work if there are more than 2 duplicates |
@iamareebjamal I don't think they are consumed by current FE, but they are anyway supported by the ticketing API, referred to multiple times in it. And the only ticket tags I see are for some events on legacy data. |
|
@prateekj117 Wrap this up ASAP, please |
|
@iamareebjamal It's working even when there are more than two duplicates: |
|
Yeah, so exactly @prateekj117 Do you think the unique constraint will work on the data above? |
|
(15, paid !!!!.deleted) is still duplicated. So how it is going to work? |
|
@iamareebjamal Ok, I got the point. |
|
@iamareebjamal Should I delete the rows? |
|
No |
|
@iamareebjamal Can you give me a rough idea on how to go about for a query like that? |
|
Append id or fixed random characters before .deleted And change the implementation of downgrade accordingly |
|
@iamareebjamal Done. |
|
@CosmicCoder96 Please verify |
abhinavk96
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on production data locally, worked.

Fixes #6382
Checklist
developmentbranch.