schema: add "rating" column to table tags
This commit is contained in:
parent
ecfa6f73c6
commit
63ee25260c
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
currentdbversion=8
|
currentdbversion=9
|
||||||
checkDatabaseVersion() {
|
checkDatabaseVersion() {
|
||||||
local dbversion
|
local dbversion
|
||||||
if dbversion=$(Select atom version <<<"\"1\" = 1")
|
if dbversion=$(Select atom version <<<"\"1\" = 1")
|
||||||
|
|||||||
51
lib/database/upgradedatabase_8_9
Normal file
51
lib/database/upgradedatabase_8_9
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Copyright © 2012-2026 ScriptFanix
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# A copy of the GNU General Public License v3 is includded in the LICENSE file
|
||||||
|
# at the root of the project.
|
||||||
|
|
||||||
|
upgradedatabase_8_9() {
|
||||||
|
echo "Upgrading database to version 9... (backup is $database.bak_v8)"
|
||||||
|
cp "$database" "$database.bak_v8"
|
||||||
|
|
||||||
|
echo '
|
||||||
|
ALTER TABLE tags ADD COLUMN rating FLOAT;
|
||||||
|
DROP TRIGGER force_destination_update_on_tag_update;
|
||||||
|
CREATE TRIGGER IF NOT EXISTS force_destination_update_on_tag_update
|
||||||
|
AFTER UPDATE OF
|
||||||
|
genre,
|
||||||
|
albumartist,
|
||||||
|
year,
|
||||||
|
album,
|
||||||
|
disc,
|
||||||
|
artist,
|
||||||
|
track,
|
||||||
|
title,
|
||||||
|
composer,
|
||||||
|
performer,
|
||||||
|
rating,
|
||||||
|
releasecountry,
|
||||||
|
replaygain_alb,
|
||||||
|
replaygain_trk,
|
||||||
|
rate,
|
||||||
|
channels,
|
||||||
|
bitrate,
|
||||||
|
depth
|
||||||
|
ON tags
|
||||||
|
BEGIN
|
||||||
|
UPDATE destination_files SET last_change=0
|
||||||
|
WHERE source_file_id=old.source_file;
|
||||||
|
END;
|
||||||
|
' >&3
|
||||||
|
|
||||||
|
Update atom version 9 <<<"1 = 1"
|
||||||
|
}
|
||||||
@ -57,6 +57,7 @@ CREATE TABLE IF NOT EXISTS tags (
|
|||||||
title TEXT,
|
title TEXT,
|
||||||
composer TEXT,
|
composer TEXT,
|
||||||
performer TEXT,
|
performer TEXT,
|
||||||
|
rating FLOAT,
|
||||||
releasecountry TEXT,
|
releasecountry TEXT,
|
||||||
replaygain_alb TEXT,
|
replaygain_alb TEXT,
|
||||||
replaygain_trk TEXT,
|
replaygain_trk TEXT,
|
||||||
@ -131,6 +132,7 @@ CREATE TRIGGER IF NOT EXISTS force_destination_update_on_tag_update
|
|||||||
title,
|
title,
|
||||||
composer,
|
composer,
|
||||||
performer,
|
performer,
|
||||||
|
rating,
|
||||||
releasecountry,
|
releasecountry,
|
||||||
replaygain_alb,
|
replaygain_alb,
|
||||||
replaygain_trk,
|
replaygain_trk,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user