aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--db/schema.sql1
-rw-r--r--db/schema_0008-add_user_object_to_admin_log.sql12
2 files changed, 13 insertions, 0 deletions
diff --git a/db/schema.sql b/db/schema.sql
index 22269e98d..bf019c7ec 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -395,6 +395,7 @@ create table admin_log (
object_type text not null check (
object_type = 'problem'
or object_type = 'update'
+ or object_type = 'user'
),
object_id integer not null,
action text not null check (
diff --git a/db/schema_0008-add_user_object_to_admin_log.sql b/db/schema_0008-add_user_object_to_admin_log.sql
new file mode 100644
index 000000000..dd8f03645
--- /dev/null
+++ b/db/schema_0008-add_user_object_to_admin_log.sql
@@ -0,0 +1,12 @@
+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'
+ );
+
+
+commit;