db: add indexes to album.tag_artist_id

This commit is contained in:
sentriz
2020-05-01 02:03:46 +01:00
parent 708198bcd5
commit 5686517737
2 changed files with 13 additions and 3 deletions

View File

@@ -77,7 +77,7 @@ type Track struct {
TagTrackNumber int `sql:"default: null"`
TagDiscNumber int `sql:"default: null"`
TagGenre *Genre
TagGenreID int `sql:"default: null; type:int REFERENCES genres(id) ON DELETE CASCADE"`
TagGenreID int `sql:"default: null; type:int REFERENCES genres(id)"`
TagBrainzID string `sql:"default: null"`
}
@@ -140,9 +140,9 @@ type Album struct {
ParentID int `sql:"default: null; type:int REFERENCES albums(id) ON DELETE CASCADE"`
Cover string `sql:"default: null"`
TagArtist *Artist
TagArtistID int `sql:"default: null; type:int REFERENCES artists(id) ON DELETE CASCADE"`
TagArtistID int `gorm:"index" sql:"default: null; type:int REFERENCES artists(id) ON DELETE CASCADE"`
TagGenre *Genre
TagGenreID int `sql:"default: null; type:int REFERENCES genres(id) ON DELETE CASCADE"`
TagGenreID int `sql:"default: null; type:int"`
TagTitle string `sql:"default: null"`
TagTitleUDec string `sql:"default: null"`
TagBrainzID string `sql:"default: null"`