update database UNIQUE schema

This commit is contained in:
2025-07-27 13:35:47 +02:00
parent b3499c7890
commit b8018363c8
2 changed files with 2 additions and 2 deletions

View File

@@ -97,7 +97,7 @@ func createDB(db *sql.DB) error {
Tags TEXT DEFAULT '', Tags TEXT DEFAULT '',
LastPlayed INTEGER DEFAULT 0, LastPlayed INTEGER DEFAULT 0,
Folder TEXT DEFAULT 'Unknown Folder', Folder TEXT DEFAULT 'Unknown Folder',
UNIQUE (Artist, Title, MD5Hash, Difficulty) UNIQUE (Artist, Title, MD5Hash, Difficulty, Folder)
); );
`) `)
if err != nil { if err != nil {

View File

@@ -19,7 +19,7 @@ CREATE TABLE IF NOT EXISTS Beatmap (
Tags TEXT DEFAULT '', Tags TEXT DEFAULT '',
LastPlayed INTEGER DEFAULT 0, LastPlayed INTEGER DEFAULT 0,
Folder TEXT DEFAULT 'Unknown Folder', Folder TEXT DEFAULT 'Unknown Folder',
UNIQUE (Artist, Title, MD5Hash, Difficulty) UNIQUE (Artist, Title, MD5Hash, Difficulty, Folder)
); );
CREATE INDEX IF NOT EXISTS idx_beatmap_md5hash ON Beatmap(MD5Hash); CREATE INDEX IF NOT EXISTS idx_beatmap_md5hash ON Beatmap(MD5Hash);