mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-10 09:12:23 +01:00
Add indices on search fields
This commit is contained in:
@ -7,18 +7,33 @@ class Song(models.Model):
|
||||
settings.AUTH_USER_MODEL,
|
||||
on_delete=models.SET_NULL,
|
||||
blank=True,
|
||||
null=True
|
||||
)
|
||||
artist = models.TextField()
|
||||
title = models.TextField()
|
||||
hash = models.TextField()
|
||||
duration = models.IntegerField(help_text="track duration in seconds")
|
||||
rg_gain = models.DecimalField(max_digits=9, decimal_places=6,
|
||||
blank=True, null=True, help_text="replaygain gain level")
|
||||
rg_peak = models.DecimalField(max_digits=9, decimal_places=6,
|
||||
blank=True, null=True, help_text="replaygain peak level")
|
||||
null=True,
|
||||
db_index=True)
|
||||
artist = models.CharField(
|
||||
max_length=200, db_index=True, help_text='track artist')
|
||||
title = models.CharField(
|
||||
max_length=200, db_index=True, help_text='track title')
|
||||
hash = models.CharField(
|
||||
max_length=64, help_text="track file's SHA256 hash")
|
||||
duration = models.IntegerField(help_text='track duration in seconds')
|
||||
rg_gain = models.DecimalField(
|
||||
max_digits=9,
|
||||
decimal_places=6,
|
||||
blank=True,
|
||||
null=True,
|
||||
help_text='replaygain gain level')
|
||||
rg_peak = models.DecimalField(
|
||||
max_digits=9,
|
||||
decimal_places=6,
|
||||
blank=True,
|
||||
null=True,
|
||||
help_text='replaygain peak level')
|
||||
old_id = models.TextField(blank=True, null=True, default=None)
|
||||
deleted = models.BooleanField(default=False)
|
||||
deleted = models.BooleanField(
|
||||
verbose_name='unlisted',
|
||||
default=False,
|
||||
db_index=True,
|
||||
help_text='hide this song from the search listings')
|
||||
|
||||
def __str__(self):
|
||||
return self.artist + ' - ' + self.title
|
||||
|
||||
Reference in New Issue
Block a user