Compare commits
1 Commits
0214e59715
...
e0fb848957
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0fb848957 |
@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
currentdbversion=5
|
currentdbversion=6
|
||||||
checkDatabaseVersion() {
|
checkDatabaseVersion() {
|
||||||
local dbversion
|
local dbversion
|
||||||
if dbversion=$(Select atom version <<<"\"1\" = 1")
|
if dbversion=$(Select atom version <<<"\"1\" = 1")
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
openDatabase() {
|
openDatabase() {
|
||||||
|
[[ -f "$database" ]] && populate_db=1
|
||||||
rm -f "$tempdir"/sqlite.{in,out}
|
rm -f "$tempdir"/sqlite.{in,out}
|
||||||
mkfifo "$tempdir"/sqlite.{in,out}
|
mkfifo "$tempdir"/sqlite.{in,out}
|
||||||
sqlite3 -bail "$database" \
|
sqlite3 -bail "$database" \
|
||||||
@ -13,7 +14,7 @@ openDatabase() {
|
|||||||
exec 5>&3
|
exec 5>&3
|
||||||
exec 3> >(tee -a "$tempdir/debug.log" >&5)
|
exec 3> >(tee -a "$tempdir/debug.log" >&5)
|
||||||
fi
|
fi
|
||||||
cat $schema >&3
|
(( populate_db )) && cat $schema >&3
|
||||||
echo '.separator ::AtOM:SQL:Sep::' >&3
|
echo '.separator ::AtOM:SQL:Sep::' >&3
|
||||||
echo 'PRAGMA foreign_keys = ON;' >&3
|
echo 'PRAGMA foreign_keys = ON;' >&3
|
||||||
echo 'PRAGMA recursive_triggers = ON;' >&3
|
echo 'PRAGMA recursive_triggers = ON;' >&3
|
||||||
|
|||||||
35
lib/database/upgradedatabase_5_6
Normal file
35
lib/database/upgradedatabase_5_6
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
upgradedatabase_5_6() {
|
||||||
|
echo "Upgrading database to version 6... (backup is $database.bak_v5)"
|
||||||
|
cp "$database" "$database.bak_v5"
|
||||||
|
echo 'DROP TRIGGER force_destination_update_on_tag_update;' >&3
|
||||||
|
echo '
|
||||||
|
CREATE TRIGGER IF NOT EXISTS force_destination_update_on_tag_update
|
||||||
|
AFTER UPDATE OF
|
||||||
|
genre,
|
||||||
|
albumartist,
|
||||||
|
year,
|
||||||
|
album,
|
||||||
|
disc,
|
||||||
|
artist,
|
||||||
|
track,
|
||||||
|
title,
|
||||||
|
composer,
|
||||||
|
performer,
|
||||||
|
releasecountry,
|
||||||
|
replaygain_alb,
|
||||||
|
replaygain_trk,
|
||||||
|
rate,
|
||||||
|
channels,
|
||||||
|
bitrate,
|
||||||
|
bitdepth
|
||||||
|
ON tags
|
||||||
|
BEGIN
|
||||||
|
UPDATE destination_files SET last_change=0
|
||||||
|
WHERE source_file_id=old.source_file;
|
||||||
|
END;
|
||||||
|
' >&3
|
||||||
|
|
||||||
|
Update atom version 6 <<<"1 = 1"
|
||||||
|
}
|
||||||
@ -59,6 +59,8 @@ CREATE TABLE IF NOT EXISTS tags (
|
|||||||
composer TEXT,
|
composer TEXT,
|
||||||
performer TEXT,
|
performer TEXT,
|
||||||
releasecountry TEXT,
|
releasecountry TEXT,
|
||||||
|
replaygain_alb FLOAT,
|
||||||
|
replaygain_trk FLOAT,
|
||||||
depth INTEGER,
|
depth INTEGER,
|
||||||
rate INTEGER,
|
rate INTEGER,
|
||||||
channels INTEGER,
|
channels INTEGER,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user