mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
attachment: Make path_id field unique.
This will help avoid future bugs similar to that fixed in migration 0072.
This commit is contained in:
@@ -1226,7 +1226,7 @@ class AbstractAttachment(ModelReprMixin, models.Model):
|
||||
# path_id is a storage location agnostic representation of the path of the file.
|
||||
# If the path of a file is http://localhost:9991/user_uploads/a/b/abc/temp_file.py
|
||||
# then its path_id will be a/b/abc/temp_file.py.
|
||||
path_id = models.TextField(db_index=True) # type: Text
|
||||
path_id = models.TextField(db_index=True, unique=True) # type: Text
|
||||
owner = models.ForeignKey(UserProfile) # type: UserProfile
|
||||
realm = models.ForeignKey(Realm, blank=True, null=True) # type: Realm
|
||||
is_realm_public = models.BooleanField(default=False) # type: bool
|
||||
|
||||
Reference in New Issue
Block a user