🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
Add a new index for album, to optimize the `getAlbumList?type=alphabeticalByArtist` Subsonic query
Deluan9e48d87f8412
diff --git a/db/migration/20211102215414_add_alphabetical_by_artist_index.go b/db/migration/20211102215414_add_alphabetical_by_artist_index.gonew file mode 100644index 000000000..d16ab0983--- /dev/null+++ b/db/migration/20211102215414_add_alphabetical_by_artist_index.go@@ -0,0 +1,23 @@+package migrations++import (+ "database/sql"++ "github.com/pressly/goose"+)++func init() {+ goose.AddMigration(upAddAlphabeticalByArtistIndex, downAddAlphabeticalByArtistIndex)+}++func upAddAlphabeticalByArtistIndex(tx *sql.Tx) error {+ _, err := tx.Exec(`+create index album_alphabetical_by_artist+ ON album(compilation, order_album_artist_name, order_album_name)+`)+ return err+}++func downAddAlphabeticalByArtistIndex(tx *sql.Tx) error {+ return nil+}