aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-07-27 09:28:50 -0400
committerPaul Duncan <pabs@pablotron.org>2016-07-27 09:28:50 -0400
commit8ffde2e23c21ccae81f34c34ef115993719d34eb (patch)
tree1def5a3535ae031d7488ac7beed7e70a67e46ea8 /data
parent34395459bbc90809c459ea348775f66fb20d3604 (diff)
downloadguff-8ffde2e23c21ccae81f34c34ef115993719d34eb.tar.bz2
guff-8ffde2e23c21ccae81f34c34ef115993719d34eb.zip
add page assets
Diffstat (limited to 'data')
-rw-r--r--data/init.yaml45
1 files changed, 32 insertions, 13 deletions
diff --git a/data/init.yaml b/data/init.yaml
index 4f260b4..46a1e11 100644
--- a/data/init.yaml
+++ b/data/init.yaml
@@ -45,6 +45,18 @@ init_sql:
)
- |
+ CREATE TABLE asset_types (
+ type_id INTEGER PRIMARY KEY,
+ name TEXT UNIQUE NOT NULL
+ CHECK (LENGTH(name) > 0)
+ )
+
+ - |
+ INSERT INTO asset_types(type_id, name) VALUES
+ (1, 'script'),
+ (2, 'style')
+
+ - |
CREATE TABLE themes (
theme_id INTEGER PRIMARY KEY,
@@ -159,18 +171,6 @@ init_sql:
)
- |
- CREATE TABLE theme_asset_types (
- type_id INTEGER PRIMARY KEY,
- name TEXT UNIQUE NOT NULL
- CHECK (LENGTH(name) > 0)
- )
-
- - |
- INSERT INTO theme_asset_types(type_id, name) VALUES
- (1, 'script'),
- (2, 'style')
-
- - |
CREATE TABLE theme_assets (
-- theme file
file_id INTEGER NOT NULL
@@ -178,7 +178,7 @@ init_sql:
-- asset type
type_id INTEGER NOT NULL
- REFERENCES theme_asset_types(type_id),
+ REFERENCES asset_types(type_id),
-- load order
sort_order INTEGER NOT NULL,
@@ -322,6 +322,25 @@ init_sql:
)
- |
+ CREATE TABLE page_assets (
+ post_id INTEGER NOT NULL
+ REFERENCES posts(post_id),
+
+ -- asset type
+ type_id INTEGER NOT NULL
+ REFERENCES asset_types(type_id),
+
+ -- asset path
+ path TEXT NOT NULL
+ CHECK (LENGTH(path) > 0),
+
+ -- load order
+ sort_order INTEGER NOT NULL,
+
+ PRIMARY KEY (post_id, type_id, path)
+ )
+
+ - |
CREATE TABLE sessions (
id TEXT PRIMARY KEY,