2018-02-27 18:06:05 +01:00
|
|
|
CREATE TABLE device_%deviceid_directories (
|
|
|
|
path TEXT NOT NULL,
|
|
|
|
subdirs INTEGER NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE device_%deviceid_subdirectories (
|
|
|
|
directory_id INTEGER NOT NULL,
|
|
|
|
path TEXT NOT NULL,
|
|
|
|
mtime INTEGER NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE device_%deviceid_songs (
|
|
|
|
|
|
|
|
title TEXT NOT NULL,
|
|
|
|
album TEXT NOT NULL,
|
|
|
|
artist TEXT NOT NULL,
|
|
|
|
albumartist TEXT NOT NULL,
|
|
|
|
track INTEGER NOT NULL DEFAULT -1,
|
|
|
|
disc INTEGER NOT NULL DEFAULT -1,
|
|
|
|
year INTEGER NOT NULL DEFAULT -1,
|
|
|
|
originalyear INTEGER NOT NULL DEFAULT 0,
|
|
|
|
genre TEXT NOT NULL,
|
|
|
|
compilation INTEGER NOT NULL DEFAULT -1,
|
|
|
|
composer TEXT NOT NULL,
|
|
|
|
performer TEXT NOT NULL,
|
|
|
|
grouping TEXT NOT NULL,
|
|
|
|
comment TEXT NOT NULL,
|
2018-09-08 12:38:02 +02:00
|
|
|
lyrics TEXT NOT NULL,
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2019-05-31 01:41:17 +02:00
|
|
|
artist_id INTEGER NOT NULL DEFAULT -1,
|
2019-06-20 02:14:44 +02:00
|
|
|
album_id TEXT NOT NULL,
|
2019-05-31 01:41:17 +02:00
|
|
|
song_id INTEGER NOT NULL DEFAULT -1,
|
2019-05-30 18:04:30 +02:00
|
|
|
|
2018-02-27 18:06:05 +01:00
|
|
|
beginning INTEGER NOT NULL DEFAULT 0,
|
|
|
|
length INTEGER NOT NULL DEFAULT 0,
|
|
|
|
|
2019-07-10 20:04:05 +02:00
|
|
|
bitrate INTEGER NOT NULL DEFAULT -1,
|
|
|
|
samplerate INTEGER NOT NULL DEFAULT -1,
|
|
|
|
bitdepth INTEGER NOT NULL DEFAULT -1,
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2018-09-08 12:38:02 +02:00
|
|
|
source INTEGER NOT NULL DEFAULT 0,
|
2019-07-10 20:04:05 +02:00
|
|
|
directory_id INTEGER NOT NULL DEFAULT -1,
|
2019-06-20 02:14:44 +02:00
|
|
|
url TEXT NOT NULL,
|
2018-02-27 18:06:05 +01:00
|
|
|
filetype INTEGER NOT NULL DEFAULT 0,
|
2019-07-10 20:04:05 +02:00
|
|
|
filesize INTEGER NOT NULL DEFAULT -1,
|
|
|
|
mtime INTEGER NOT NULL DEFAULT -1,
|
|
|
|
ctime INTEGER NOT NULL DEFAULT -1,
|
2018-02-27 18:06:05 +01:00
|
|
|
unavailable INTEGER DEFAULT 0,
|
|
|
|
|
|
|
|
playcount INTEGER NOT NULL DEFAULT 0,
|
|
|
|
skipcount INTEGER NOT NULL DEFAULT 0,
|
2019-07-10 20:04:05 +02:00
|
|
|
lastplayed INTEGER NOT NULL DEFAULT -1,
|
2018-02-27 18:06:05 +01:00
|
|
|
|
|
|
|
compilation_detected INTEGER DEFAULT 0,
|
|
|
|
compilation_on INTEGER NOT NULL DEFAULT 0,
|
|
|
|
compilation_off INTEGER NOT NULL DEFAULT 0,
|
|
|
|
compilation_effective INTEGER NOT NULL DEFAULT 0,
|
|
|
|
|
|
|
|
art_automatic TEXT,
|
|
|
|
art_manual TEXT,
|
|
|
|
|
|
|
|
effective_albumartist TEXT,
|
|
|
|
effective_originalyear INTEGER NOT NULL DEFAULT 0,
|
2018-10-02 00:38:52 +02:00
|
|
|
|
2018-02-27 18:06:05 +01:00
|
|
|
cue_path TEXT
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE INDEX idx_device_%deviceid_songs_album ON device_%deviceid_songs (album);
|
|
|
|
|
|
|
|
CREATE INDEX idx_device_%deviceid_songs_comp_artist ON device_%deviceid_songs (compilation_effective, artist);
|
|
|
|
|
2019-07-30 22:45:22 +02:00
|
|
|
CREATE VIRTUAL TABLE device_%deviceid_fts USING fts5(
|
2018-02-27 18:06:05 +01:00
|
|
|
ftstitle, ftsalbum, ftsartist, ftsalbumartist, ftscomposer, ftsperformer, ftsgrouping, ftsgenre, ftscomment,
|
2019-07-30 22:56:33 +02:00
|
|
|
tokenize = "unicode61 remove_diacritics 0"
|
2018-02-27 18:06:05 +01:00
|
|
|
);
|
|
|
|
|
2019-08-02 22:58:30 +02:00
|
|
|
UPDATE devices SET schema_version=1 WHERE ROWID=%deviceid;
|