2010-07-04 01:00:07 +02:00
|
|
|
CREATE TABLE device_%deviceid_directories (
|
|
|
|
path TEXT NOT NULL,
|
|
|
|
subdirs INTEGER NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE device_%deviceid_subdirectories (
|
|
|
|
directory INTEGER NOT NULL,
|
|
|
|
path TEXT NOT NULL,
|
|
|
|
mtime INTEGER NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE device_%deviceid_songs (
|
|
|
|
/* Metadata from taglib */
|
|
|
|
title TEXT,
|
|
|
|
album TEXT,
|
|
|
|
artist TEXT,
|
|
|
|
albumartist TEXT,
|
|
|
|
composer TEXT,
|
|
|
|
track INTEGER,
|
|
|
|
disc INTEGER,
|
|
|
|
bpm REAL,
|
|
|
|
year INTEGER,
|
|
|
|
genre TEXT,
|
|
|
|
comment TEXT,
|
|
|
|
compilation INTEGER,
|
|
|
|
|
|
|
|
length INTEGER,
|
|
|
|
bitrate INTEGER,
|
|
|
|
samplerate INTEGER,
|
|
|
|
|
|
|
|
/* Information about the file on disk */
|
|
|
|
directory INTEGER NOT NULL,
|
|
|
|
filename TEXT NOT NULL,
|
|
|
|
mtime INTEGER NOT NULL,
|
|
|
|
ctime INTEGER NOT NULL,
|
|
|
|
filesize INTEGER NOT NULL,
|
|
|
|
|
|
|
|
sampler INTEGER NOT NULL DEFAULT 0,
|
|
|
|
art_automatic TEXT,
|
|
|
|
art_manual TEXT,
|
|
|
|
|
|
|
|
filetype INTEGER NOT NULL DEFAULT 0,
|
|
|
|
playcount INTEGER NOT NULL DEFAULT 0,
|
|
|
|
lastplayed INTEGER,
|
|
|
|
rating INTEGER,
|
|
|
|
forced_compilation_on INTEGER NOT NULL DEFAULT 0,
|
|
|
|
forced_compilation_off INTEGER NOT NULL DEFAULT 0,
|
2010-10-17 19:50:20 +02:00
|
|
|
effective_compilation NOT NULL DEFAULT 0,
|
|
|
|
|
2010-11-01 22:15:52 +01:00
|
|
|
skipcount INTEGER NOT NULL DEFAULT 0,
|
2010-12-28 23:53:10 +01:00
|
|
|
score INTEGER NOT NULL DEFAULT 0,
|
2011-01-15 19:46:23 +01:00
|
|
|
beginning NOT NULL DEFAULT 0,
|
|
|
|
|
2011-05-22 18:08:31 +02:00
|
|
|
cue_path TEXT,
|
2011-12-10 15:52:23 +01:00
|
|
|
unavailable INTEGER DEFAULT 0,
|
|
|
|
|
2012-09-30 08:50:24 +02:00
|
|
|
effective_albumartist TEXT,
|
2013-03-10 07:58:09 +01:00
|
|
|
etag TEXT,
|
|
|
|
|
|
|
|
performer TEXT,
|
|
|
|
grouping TEXT
|
2010-07-04 01:00:07 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE INDEX idx_device_%deviceid_songs_album ON device_%deviceid_songs (album);
|
|
|
|
|
|
|
|
CREATE INDEX idx_device_%deviceid_songs_comp_artist ON device_%deviceid_songs (effective_compilation, artist);
|
|
|
|
|
|
|
|
CREATE VIRTUAL TABLE device_%deviceid_fts USING fts3(
|
2013-03-10 07:58:09 +01:00
|
|
|
ftstitle, ftsalbum, ftsartist, ftsalbumartist, ftscomposer, ftsperformer, ftsgrouping, ftsgenre, ftscomment,
|
2010-07-04 01:00:07 +02:00
|
|
|
tokenize=unicode
|
|
|
|
);
|
|
|
|
|
|
|
|
UPDATE devices SET schema_version=0 WHERE ROWID=%deviceid;
|
|
|
|
|