aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/schema.sql4
-rw-r--r--db/schema_0069-admin-log-types.sql17
2 files changed, 21 insertions, 0 deletions
diff --git a/db/schema.sql b/db/schema.sql
index a211ef50d..cf2914467 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -445,6 +445,10 @@ create table admin_log (
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'
),
object_id integer not null,
action text not null,
diff --git a/db/schema_0069-admin-log-types.sql b/db/schema_0069-admin-log-types.sql
new file mode 100644
index 000000000..e4e9362ac
--- /dev/null
+++ b/db/schema_0069-admin-log-types.sql
@@ -0,0 +1,17 @@
+BEGIN;
+
+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;
+