diff options
Diffstat (limited to 'data/init.yaml')
| -rw-r--r-- | data/init.yaml | 75 | 
1 files changed, 57 insertions, 18 deletions
| diff --git a/data/init.yaml b/data/init.yaml index 34a0595..f9a8ac1 100644 --- a/data/init.yaml +++ b/data/init.yaml @@ -41,7 +41,7 @@ init_sql:        password    TEXT NOT NULL DEFAULT '', -      is_active   BOOLEAN NOT NULL DEFAULT false +      is_active   BOOLEAN NOT NULL DEFAULT 0      )    - | @@ -88,7 +88,7 @@ init_sql:        -- is this a system theme?        -- note: system themes are located in system_dir/themes/<slug>/ -      is_system     BOOLEAN NOT NULL DEFAULT false +      is_system     BOOLEAN NOT NULL DEFAULT 0      )    - | @@ -188,32 +188,67 @@ init_sql:    - |      CREATE TABLE sites ( -      site_id     INTEGER PRIMARY KEY, +      site_id       INTEGER PRIMARY KEY, + +      -- make sure slug is lowercase, does not begin with a dot, and +      -- does not contain slashes +      slug          TEXT UNIQUE NOT NULL CHECK ( +                      LENGTH(slug) > 0 AND +                      slug = LOWER(slug) AND +                      slug NOT LIKE '.%' AND +                      slug NOT LIKE '%/%' +                    ), -      -- make sure name does not begin with a dot or +      -- make sure slug does not begin with a dot or        -- contain slashes -      name        TEXT UNIQUE NOT NULL CHECK ( -                    LENGTH(name) > 0 AND -                    name NOT LIKE '.%' AND -                    name NOT LIKE '%/%' -                  ), +      name          TEXT UNIQUE NOT NULL +                    CHECK (LENGTH(name) > 0), + +      -- site description +      body          TEXT NOT NULL DEFAULT '', + +      -- site description +      lang          TEXT NOT NULL DEFAULT 'en-US' CHECK ( +                      -- e.g. 'en' or 'en-US' +                      (LENGTH(lang) = 2 OR LENGTH(lang) = 5) AND +                      (lang LIKE '__' OR lang LIKE '__-__') +                    ),        -- date that site was created -      created_at  TIMESTAMP WITH TIME ZONE NOT NULL -                  DEFAULT CURRENT_TIMESTAMP, +      created_at    TIMESTAMP WITH TIME ZONE NOT NULL +                    DEFAULT CURRENT_TIMESTAMP,        -- theme for this site -      theme_id    INTEGER NOT NULL -                  REFERENCES themes(theme_id), +      theme_id      INTEGER NOT NULL +                    REFERENCES themes(theme_id), + +      -- disabled: too fucking complicated with "is_default" +      -- is this site active +      -- is_active     BOOLEAN NOT NULL DEFAULT 0, -      is_active   BOOLEAN NOT NULL DEFAULT false, +      -- is this the default site +      is_default    BOOLEAN NOT NULL DEFAULT 0, -      is_default  BOOLEAN NOT NULL DEFAULT false +      -- use full body for rss and atom feeds +      is_full_feed  BOOLEAN NOT NULL DEFAULT 1      )    - | -    INSERT INTO sites(site_id, name, theme_id, is_active, is_default) VALUES -      (1, 'default', 1, 1, 1) +    INSERT INTO sites ( +      site_id, +      slug, +      name, +      body, +      theme_id, +      is_default +    ) VALUES ( +      1, +      'default', +      'Default', +      'True guff stuff.', +      1, +      1 +    )    - |      CREATE TABLE site_domains ( @@ -224,7 +259,11 @@ init_sql:                      LENGTH(domain) > 0 AND                      domain = LOWER(domain) AND                      domain NOT LIKE '% %' -                  ) +                  ), + +      sort_order  INTEGER NOT NULL, + +      PRIMARY KEY (site_id, domain)      )    - | | 
