Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Make hexhash the primary key for uploaded files. #317

Merged
merged 3 commits into from
Oct 12, 2016

Conversation

tadhg-ohiggins
Copy link
Contributor

The primary key /
Shall be based upon the hash /
Because that makes sense.

@@ -48,5 +48,5 @@ class RegulationFile(models.Model):
contents = models.BinaryField()
file = models.FileField(null=True)
filename = models.CharField(default=None, max_length=512, null=True)
hexhash = models.CharField(default=None, max_length=64, null=True)
hexhash = models.CharField(default=None, max_length=64, primary_key=True)
Copy link
Member

Choose a reason for hiding this comment

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

Can this have a default if it's a primary key? Does that still make sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It can… but it doesn't make sense. Thanks for the catch, I'll fix it.

@cmc333333
Copy link
Member

Makes sense to me

@cmc333333 cmc333333 merged commit 048299e into eregs:master Oct 12, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants