diff options
author | Paul Duncan <pabs@pablotron.org> | 2016-07-19 19:47:15 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2016-07-19 19:47:15 -0400 |
commit | cff0eb6ae72e231a55d18200bff9244b3d6a2659 (patch) | |
tree | bf183c98eb70d60d7580390dff91a2f50151a487 /data | |
parent | 65ea7c412eea275d999f8005f6e8c58687ff5b14 (diff) | |
download | guff-cff0eb6ae72e231a55d18200bff9244b3d6a2659.tar.bz2 guff-cff0eb6ae72e231a55d18200bff9244b3d6a2659.zip |
add theme installer
Diffstat (limited to 'data')
-rw-r--r-- | data/init.yaml | 24 |
1 files changed, 12 insertions, 12 deletions
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) ) - | |