From cff0eb6ae72e231a55d18200bff9244b3d6a2659 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Tue, 19 Jul 2016 19:47:15 -0400 Subject: add theme installer --- data/init.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'data') diff --git a/data/init.yaml b/data/init.yaml index 54fbfc3..4f260b4 100644 --- a/data/init.yaml +++ b/data/init.yaml @@ -67,7 +67,8 @@ init_sql: theme_date DATE NOT NULL, -- sha1 digest of theme file - theme_hash TEXT NOT NULL CHECK ( + -- (allow NULL for system themes) + theme_hash TEXT UNIQUE CHECK ( LENGTH(theme_hash) > 0 AND theme_hash NOT LIKE '% %' AND theme_hash = LOWER(theme_hash) @@ -88,8 +89,8 @@ init_sql: theme_hash, is_system ) VALUES - (1, 'default', 'Default', '1.0', '2016-07-18', 'n/a', 1), - (2, 'blank', 'Blank', '1.0', '2016-07-18', 'n/a', 1) + (1, 'default', 'Default', '1.0', '2016-07-18', NULL, 1), + (2, 'blank', 'Blank', '1.0', '2016-07-18', NULL, 1) - | CREATE TABLE theme_data_types ( @@ -138,9 +139,15 @@ init_sql: theme_id INTEGER NOT NULL REFERENCES themes(theme_id), + -- path of file + file_path TEXT NOT NULL CHECK ( + LENGTH(file_path) > 1 AND + file_path NOT LIKE '/%' + ), + -- size of file, in bytes file_size INTEGER NOT NULL - CHECK (file_size > 0), + CHECK (file_size >= 0), -- sha1 digest of file file_hash TEXT NOT NULL CHECK ( @@ -148,12 +155,6 @@ init_sql: file_hash NOT LIKE '% %' ), - -- path of file - file_path TEXT NOT NULL CHECK ( - LENGTH(file_path) > 1 AND - file_path NOT LIKE '/%' - ), - UNIQUE (theme_id, file_path) ) @@ -182,8 +183,7 @@ init_sql: -- load order sort_order INTEGER NOT NULL, - PRIMARY KEY (file_id, type_id), - UNIQUE (file_id, type_id) + PRIMARY KEY (file_id, type_id) ) - | -- cgit v1.2.3