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

models: use partial index for unique constraints #736

Merged
merged 1 commit into from
Dec 10, 2021
Merged

Conversation

mxyng
Copy link
Collaborator

@mxyng mxyng commented Dec 10, 2021

Allow soft deletes while keeping unique constraints by creating an unique index using both deleted_at and the tables' unique field.

  • Wrote appropriate unit tests
  • Considered security implications of the change
  • Updated associated docs where necessary
  • Updated associated configuration where necessary
  • Change is backwards compatible if it needs to be (user can upgrade without manual steps?)
  • Nothing sensitive logged

Resolves #

@mxyng mxyng changed the title models: add composite unique index models: use partial index for unique constraints Dec 10, 2021
@jmorganca
Copy link
Contributor

Nice catch!

@mxyng mxyng merged commit e958fbd into main Dec 10, 2021
@mxyng mxyng deleted the composite-index branch December 10, 2021 20:49
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