summary refs log tree commit diff
path: root/synapse/storage/schema/pusher.sql
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/storage/schema/pusher.sql')
-rw-r--r--synapse/storage/schema/pusher.sql13
1 files changed, 13 insertions, 0 deletions
diff --git a/synapse/storage/schema/pusher.sql b/synapse/storage/schema/pusher.sql
index b84ce20ef3..8c4dfd5c1b 100644
--- a/synapse/storage/schema/pusher.sql
+++ b/synapse/storage/schema/pusher.sql
@@ -31,3 +31,16 @@ CREATE TABLE IF NOT EXISTS pushers (
   FOREIGN KEY(user_name) REFERENCES users(name),
   UNIQUE (app_id, pushkey)
 );
+
+CREATE TABLE IF NOT EXISTS push_rules (
+  id INTEGER PRIMARY KEY AUTOINCREMENT,
+  user_name TEXT NOT NULL,
+  rule_id TEXT NOT NULL,
+  priority_class TINYINT NOT NULL,
+  priority INTEGER NOT NULL DEFAULT 0,
+  conditions TEXT NOT NULL,
+  actions TEXT NOT NULL,
+  UNIQUE(user_name, rule_id)
+);
+
+CREATE INDEX IF NOT EXISTS push_rules_user_name on push_rules (user_name);