aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/downgrade_0071---0070.sql18
-rw-r--r--db/schema.sql11
-rw-r--r--db/schema_0071-add-manifest-theme.sql28
3 files changed, 57 insertions, 0 deletions
diff --git a/db/downgrade_0071---0070.sql b/db/downgrade_0071---0070.sql
new file mode 100644
index 000000000..ebf206624
--- /dev/null
+++ b/db/downgrade_0071---0070.sql
@@ -0,0 +1,18 @@
+BEGIN;
+
+DROP TABLE manifest_theme;
+
+ALTER TABLE admin_log DROP CONSTRAINT admin_log_object_type_check;
+
+ALTER TABLE admin_log ADD CONSTRAINT admin_log_object_type_check CHECK (
+ object_type = 'problem'
+ OR object_type = 'update'
+ OR object_type = 'user'
+ OR object_type = 'moderation'
+ OR object_type = 'template'
+ OR object_type = 'body'
+ OR object_type = 'category'
+ OR object_type = 'role'
+);
+
+COMMIT;
diff --git a/db/schema.sql b/db/schema.sql
index cf2914467..0e38ad862 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -449,6 +449,7 @@ create table admin_log (
or object_type = 'body'
or object_type = 'category'
or object_type = 'role'
+ or object_type = 'manifesttheme'
),
object_id integer not null,
action text not null,
@@ -562,3 +563,13 @@ CREATE TABLE state (
type text not null check (type = 'open' OR type = 'closed' OR type = 'fixed'),
name text not null unique
);
+
+CREATE TABLE manifest_theme (
+ id serial not null primary key,
+ cobrand text not null unique,
+ name text not null,
+ short_name text not null,
+ background_colour text,
+ theme_colour text,
+ images text ARRAY
+);
diff --git a/db/schema_0071-add-manifest-theme.sql b/db/schema_0071-add-manifest-theme.sql
new file mode 100644
index 000000000..308d345f5
--- /dev/null
+++ b/db/schema_0071-add-manifest-theme.sql
@@ -0,0 +1,28 @@
+BEGIN;
+
+CREATE TABLE manifest_theme (
+ id serial not null primary key,
+ cobrand text not null unique,
+ name text not null,
+ short_name text not null,
+ background_colour text,
+ theme_colour text,
+ images text ARRAY
+);
+
+ALTER TABLE admin_log DROP CONSTRAINT admin_log_object_type_check;
+
+ALTER TABLE admin_log ADD CONSTRAINT admin_log_object_type_check CHECK (
+ object_type = 'problem'
+ OR object_type = 'update'
+ OR object_type = 'user'
+ OR object_type = 'moderation'
+ OR object_type = 'template'
+ OR object_type = 'body'
+ OR object_type = 'category'
+ OR object_type = 'role'
+ OR object_type = 'manifesttheme'
+);
+
+
+COMMIT;