-
Notifications
You must be signed in to change notification settings - Fork 1
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 #238: migration to backport prod index #979
Conversation
8e8d4d4
to
15d461c
Compare
Trying to get the timeline correct here:
op.create_index(
"idx_email_primary_email_lower",
"emails",
[sa.text("lower(primary_email)")],
unique=True,
) so functionally the same as the one we have in this PR, just a different name
I don't know how / when |
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.
But in any case, some thoughts / questions:
-
is it true that we have an index
idx_email_primary_email_lower
, and now we're adding thisidx_email_primary_unique_email_lower
? Maybe we can dropidx_email_primary_email_lower
sinceidx_email_primary_unique_email_lower
is that plus uniqueness -
if we do need this index, can we include a comment here explaining why, given the confusing history I pointed out in my previous comment?
-
Can we reflect this index back onto the model?
You are perfectly right! I was only looking at diffs between schemas, and didn't spot that we also have Stage/Prod have this additional one I propose that we keep the one with uniqueness, and drop the other one. Let's see how I can rework the migration for that. Thank you for being so thorough, as usual 🙏 |
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.
Nice! One topic of investigation for indexes that I though of, but otherwise looks g2g and I'll throw the approval on now.
Fix #238