Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 8b52df38 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

Modify sql schema

parent 3c58347d
Branches
Étiquettes
Aucune requête de fusion associée trouvée
...@@ -27,29 +27,30 @@ CREATE TABLE IF NOT EXISTS kara ...@@ -27,29 +27,30 @@ CREATE TABLE IF NOT EXISTS kara
); );
CREATE TABLE IF NOT EXISTS kara_type CREATE TABLE IF NOT EXISTS kara_type
( id INTEGER PRIMARY KEY AUTOINCREMENT ( id INTEGER PRIMARY KEY
, name TEXT NOT NULL , name TEXT NOT NULL
); );
INSERT INTO kara_type (name) VALUES INSERT INTO kara_type (id, name) VALUES
('vo'), ('va'), ('amv'), ('cdg'), ('autres'), ('vocaloid'); (1, 'vo'), (2, 'va'), (3, 'amv'), (4, 'cdg'), (5, 'autres'), ( 6, 'vocaloid');
CREATE TABLE IF NOT EXISTS kara_category CREATE TABLE IF NOT EXISTS kara_category
( id INTEGER PRIMARY KEY AUTOINCREMENT ( id INTEGER PRIMARY KEY
, name TEXT NOT NULL , name TEXT NOT NULL
); );
INSERT INTO kara_category (name) VALUES INSERT INTO kara_category (id, name) VALUES
('ED/d*'), ('OP/d*'), ('AMV'), ('IS'), ('VOCA'), ('LIVE'), ('CDG'), ('PV'), (1, 'ED/d*'), (2, 'OP/d*'), (3, 'AMV'), (4, 'IS'), (5, 'VOCA'), (6, 'LIVE'),
('MV'); (7, 'CDG'), (8, 'PV'), (9, 'MV');
CREATE TABLE IF NOT EXISTS language CREATE TABLE IF NOT EXISTS language
( id INTEGER PRIMARY KEY AUTOINCREMENT ( id INTEGER PRIMARY KEY
, name TEXT NOT NULL , name TEXT NOT NULL
); );
INSERT INTO language (name) VALUES INSERT INTO language (id, name) VALUES
('jp'), ('fr'), ('en'), ('ru'), ('sp'), ('it'), ('ch'), ('latin'), ('multi'), ('undefined'); (1, 'jp'), (2, 'fr'), (3, 'en'), (4, 'ru'), (5, 'sp'), (6, 'it'), (7, 'ch'),
(8, 'latin'), (9, 'multi'), (10, 'undefined');
-- Playlists are sets of karas that are meant to be played together, kinda like -- Playlists are sets of karas that are meant to be played together, kinda like
-- M3U except it's stored in a SQL database. -- M3U except it's stored in a SQL database.
...@@ -93,6 +94,31 @@ CREATE TABLE IF NOT EXISTS users ...@@ -93,6 +94,31 @@ CREATE TABLE IF NOT EXISTS users
INSERT INTO users (username, password) VALUES ('sakura', 'hashire'); INSERT INTO users (username, password) VALUES ('sakura', 'hashire');
-- The stickers table
-- Used to implement the stickers MPD functionnality, documentation can be found
-- here: https://www.musicpd.org/doc/html/protocol.html#stickers. Need to be
-- authentified to use stickers commands. Support tags for `song` and `plt`.
CREATE TABLE IF NOT EXISTS 'stickers'
( id INTEGER PRIMARY KEY
, name TEXT NOT NULL UNIQUE
);
CREATE TABLE IF NOT EXISTS 'stickers.song'
( id INTEGER REFERENCES kara ON DELETE CASCADE
, sticker INTEGER REFERENCES stickers ON DELETE CASCADE
, value INTEGER NOT NULL
, PRIMARY KEY (id, sticker)
) WITHOUT ROWID;
CREATE TABLE IF NOT EXISTS 'stickers.plt'
( id INTEGER REFERENCES playlist ON DELETE CASCADE
, sticker INTEGER REFERENCES stickers ON DELETE CASCADE
, value INTEGER NOT NULL
, PRIMARY KEY (id, sticker)
) WITHOUT ROWID;
-- Some useful values: -- Some useful values:
-- last_update is the timestamp of the last time the table of kara has been -- last_update is the timestamp of the last time the table of kara has been
-- updated. This is so lektor doesn't have to read all kara in the filesystem, -- updated. This is so lektor doesn't have to read all kara in the filesystem,
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter