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

Migrate away from using natural primary keys #4772

Closed
di opened this issue Sep 27, 2018 · 3 comments
Closed

Migrate away from using natural primary keys #4772

di opened this issue Sep 27, 2018 · 3 comments
Assignees

Comments

@di
Copy link
Member

di commented Sep 27, 2018

A number of our tables currently have natural primary keys, such as:

  • The packages table (used by the Project model)
  • The releases table (used by the Release model)
  • (...this may be all of them)

We should migrate away from natural keys and use surrogate keys instead where appropriate, e.g.:

id = Column(Integer, primary_key=True, nullable=False)

This will require a DB migration and possibly a maintenance period.

@steiza
Copy link

steiza commented Oct 27, 2018

I'm going to start working on this as part of the PyPA sprints. If anyone is interested in pairing, let me know!

@ewdurbin
Copy link
Member

Ah, this is already pretty far along in my court @steiza. Given that it will require an admin to roll out (potential downtime, db backups, etc). I'll continue on it!

@yeraydiazdiaz
Copy link
Contributor

@ewdurbin is there anything else pending for this issue or should can it be closed?

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

No branches or pull requests

4 participants