Skip to content

Commit

Permalink
Add index to hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
miedzinski committed Mar 15, 2024
1 parent 541c25d commit d97a030
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/ralph/assets/models/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ class Asset(AdminAbsoluteUrlMixin, PriceMixin, BaseObject):
max_length=255,
null=True,
verbose_name=_('hostname'), # TODO: unique
db_index=True,
)
sn = NullableCharField(
blank=True,
Expand Down
3 changes: 2 additions & 1 deletion src/ralph/virtual/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ def save(self, *args, **kwargs):
)
hostname = models.CharField(
verbose_name=_('hostname'),
max_length=255
max_length=255,
db_index=True,
)
hypervisor = models.ForeignKey(DataCenterAsset, blank=True, null=True)
image_name = models.CharField(max_length=255, null=True, blank=True)
Expand Down

0 comments on commit d97a030

Please sign in to comment.