summary refs log tree commit diff
path: root/synapse/storage/schema/delta/v5.sql
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/storage/schema/delta/v5.sql')
-rw-r--r--synapse/storage/schema/delta/v5.sql13
1 files changed, 13 insertions, 0 deletions
diff --git a/synapse/storage/schema/delta/v5.sql b/synapse/storage/schema/delta/v5.sql
new file mode 100644
index 0000000000..380eec6f35
--- /dev/null
+++ b/synapse/storage/schema/delta/v5.sql
@@ -0,0 +1,13 @@
+
+CREATE TABLE IF NOT EXISTS user_ips (
+    user TEXT NOT NULL,
+    access_token TEXT NOT NULL,
+    ip TEXT NOT NULL,
+    CONSTRAINT user_ip UNIQUE (user, access_token, ip) ON CONFLICT IGNORE
+);
+
+CREATE INDEX IF NOT EXISTS user_ips_user ON user_ips(user);
+
+ALTER TABLE users ADD COLUMN admin BOOL DEFAULT 0 NOT NULL;
+
+PRAGMA user_version = 5;