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

Add migration for unique indexes on favourite #580

Merged
merged 5 commits into from
Mar 14, 2024

Conversation

BentiGorlich
Copy link
Member

@BentiGorlich BentiGorlich commented Mar 13, 2024

Delete duplicate favorites and introduce 4 new indices.

Fixes #578

@BentiGorlich BentiGorlich added backend Backend related issues and pull requests high priority critical issue or PR that impacts production labels Mar 13, 2024
@BentiGorlich BentiGorlich self-assigned this Mar 13, 2024
nobodyatroot
nobodyatroot previously approved these changes Mar 13, 2024
Copy link
Member

@nobodyatroot nobodyatroot left a comment

Choose a reason for hiding this comment

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

Migration went smoothly, no issues encountered since I stopped the messengers first.

@melroy89
Copy link
Member

Did you validate a db migration diff check? So there is no diff created between doctrine and the db? I ask this since you first created the migration and then the doctrine. Instead of the other way around.

@BentiGorlich
Copy link
Member Author

I just derped on pushing the changes. I did generate it through doctrine 😅

@melroy89
Copy link
Member

Migration is executed successfully here as well. I think you can merge it @BentiGorlich.

@melroy89 melroy89 added the enhancement New feature or request label Mar 14, 2024
@melroy89 melroy89 merged commit 925110a into main Mar 14, 2024
7 checks passed
@melroy89 melroy89 deleted the fix/add-missing-indexes-on-favourite branch March 14, 2024 22:46
@e-five256
Copy link
Member

I wanted to double check the instructions for this migration, as I was unaware of the need to stop messengers during certain migrations. Is that standard for a specific change? Are there instructions on how to do so? Obviously as you've already stated we'll want to make this known in release notes, and just letting peeps know in the matrix general is probably a good idea

@BentiGorlich
Copy link
Member Author

The reason for that is that you might wind up in a deadlock in postgres if you don't stop the messengers (happened to me once with a longer running migration). That is only for long running migrstions though. With this one specifically the migration might fail due to unique violations. Because it is so long running you might get newly created duplicates which then block the creation of the indeces

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Backend related issues and pull requests enhancement New feature or request high priority critical issue or PR that impacts production
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SQL] Duplicate Favourite Rows
4 participants