- A search key apart from the key that identifies artists, albums and tracks: lower case, accents taken off (Latin, Greek and Cyrillic marks only, so kana and Hangul stay intact), and letters like ß, æ, ø, ł written plain. - GET /artists, /albums and /tracks look in it, so "bjork" finds "Björk" and "strasse" finds "Straße". - "Beyoncé" and "Beyonce" stay two artists: the identity key keeps accents. - Migration 0016 adds the column on SQLite and PostgreSQL; RefreshMatchKeys fills it for existing rows at start. - golang.org/x/text is now a direct dependency.
8 lines
506 B
SQL
8 lines
506 B
SQL
-- A key for searching, apart from the keys that identify artists, albums and tracks: it has
|
|
-- the accents taken off, so "bjork" finds "Björk", while "Beyoncé" and "Beyonce" stay two
|
|
-- artists. It is computed in Go (Unicode-aware) and filled in for existing rows at start,
|
|
-- by RefreshMatchKeys.
|
|
|
|
ALTER TABLE artists ADD COLUMN search_key TEXT NOT NULL DEFAULT '';
|
|
ALTER TABLE albums ADD COLUMN search_key TEXT NOT NULL DEFAULT '';
|
|
ALTER TABLE tracks ADD COLUMN search_key TEXT NOT NULL DEFAULT '';
|