summary refs log tree commit diff
path: root/synapse/storage/schema/delta
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-04-28 12:41:33 +0100
committerErik Johnston <erik@matrix.org>2015-04-28 12:41:33 +0100
commit18f82477011ee9279bde8ad995d654c116d3f652 (patch)
treee7f351c8597515399195754507e777050ade8016 /synapse/storage/schema/delta
parentCorrectly handle total/remaining counts in the presence of sent_transasctions... (diff)
downloadsynapse-18f82477011ee9279bde8ad995d654c116d3f652.tar.xz
Use TEXT instead of VARCHAR(n), since PostgreSQL treats them the same except for a limit
Diffstat (limited to 'synapse/storage/schema/delta')
-rw-r--r--synapse/storage/schema/delta/12/v12.sql18
-rw-r--r--synapse/storage/schema/delta/13/v13.sql10
-rw-r--r--synapse/storage/schema/delta/14/v14.sql4
-rw-r--r--synapse/storage/schema/delta/15/appservice_txns.sql4
-rw-r--r--synapse/storage/schema/delta/16/users.sql20
5 files changed, 28 insertions, 28 deletions
diff --git a/synapse/storage/schema/delta/12/v12.sql b/synapse/storage/schema/delta/12/v12.sql
index a246943f5a..878c36260a 100644
--- a/synapse/storage/schema/delta/12/v12.sql
+++ b/synapse/storage/schema/delta/12/v12.sql
@@ -14,16 +14,16 @@
  */
 
 CREATE TABLE IF NOT EXISTS rejections(
-    event_id VARCHAR(150) NOT NULL,
-    reason VARCHAR(150) NOT NULL,
-    last_check VARCHAR(150) NOT NULL,
+    event_id TEXT NOT NULL,
+    reason TEXT NOT NULL,
+    last_check TEXT NOT NULL,
     UNIQUE (event_id)
 );
 
 -- Push notification endpoints that users have configured
 CREATE TABLE IF NOT EXISTS pushers (
   id INTEGER PRIMARY KEY AUTOINCREMENT,
-  user_name VARCHAR(150) NOT NULL,
+  user_name TEXT NOT NULL,
   profile_tag VARCHAR(32) NOT NULL,
   kind VARCHAR(8) NOT NULL,
   app_id VARCHAR(64) NOT NULL,
@@ -41,19 +41,19 @@ CREATE TABLE IF NOT EXISTS pushers (
 
 CREATE TABLE IF NOT EXISTS push_rules (
   id INTEGER PRIMARY KEY AUTOINCREMENT,
-  user_name VARCHAR(150) NOT NULL,
-  rule_id VARCHAR(150) NOT NULL,
+  user_name TEXT NOT NULL,
+  rule_id TEXT NOT NULL,
   priority_class TINYINT NOT NULL,
   priority INTEGER NOT NULL DEFAULT 0,
-  conditions VARCHAR(150) NOT NULL,
-  actions VARCHAR(150) NOT NULL,
+  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);
 
 CREATE TABLE IF NOT EXISTS user_filters(
-  user_id VARCHAR(150),
+  user_id TEXT,
   filter_id BIGINT UNSIGNED,
   filter_json LONGBLOB
 );
diff --git a/synapse/storage/schema/delta/13/v13.sql b/synapse/storage/schema/delta/13/v13.sql
index d1da2b48e2..3265924013 100644
--- a/synapse/storage/schema/delta/13/v13.sql
+++ b/synapse/storage/schema/delta/13/v13.sql
@@ -15,10 +15,10 @@
 
 CREATE TABLE IF NOT EXISTS application_services(
     id INTEGER PRIMARY KEY AUTOINCREMENT,
-    url VARCHAR(150),
-    token VARCHAR(150),
-    hs_token VARCHAR(150),
-    sender VARCHAR(150),
+    url TEXT,
+    token TEXT,
+    hs_token TEXT,
+    sender TEXT,
     UNIQUE(token)
 );
 
@@ -26,6 +26,6 @@ CREATE TABLE IF NOT EXISTS application_services_regex(
     id INTEGER PRIMARY KEY AUTOINCREMENT,
     as_id BIGINT UNSIGNED NOT NULL,
     namespace INTEGER,  /* enum[room_id|room_alias|user_id] */
-    regex VARCHAR(150),
+    regex TEXT,
     FOREIGN KEY(as_id) REFERENCES application_services(id)
 );
diff --git a/synapse/storage/schema/delta/14/v14.sql b/synapse/storage/schema/delta/14/v14.sql
index e5fedc5851..1d09ad7a15 100644
--- a/synapse/storage/schema/delta/14/v14.sql
+++ b/synapse/storage/schema/delta/14/v14.sql
@@ -14,8 +14,8 @@
  */
 CREATE TABLE IF NOT EXISTS push_rules_enable (
   id INTEGER PRIMARY KEY AUTOINCREMENT,
-  user_name VARCHAR(150) NOT NULL,
-  rule_id VARCHAR(150) NOT NULL,
+  user_name TEXT NOT NULL,
+  rule_id TEXT NOT NULL,
   enabled TINYINT,
   UNIQUE(user_name, rule_id)
 );
diff --git a/synapse/storage/schema/delta/15/appservice_txns.sql b/synapse/storage/schema/delta/15/appservice_txns.sql
index 1c3324f415..db2e720393 100644
--- a/synapse/storage/schema/delta/15/appservice_txns.sql
+++ b/synapse/storage/schema/delta/15/appservice_txns.sql
@@ -14,13 +14,13 @@
  */
 
 CREATE TABLE IF NOT EXISTS application_services_state(
-    as_id VARCHAR(150) PRIMARY KEY,
+    as_id TEXT PRIMARY KEY,
     state VARCHAR(5),
     last_txn INTEGER
 );
 
 CREATE TABLE IF NOT EXISTS application_services_txns(
-    as_id VARCHAR(150) NOT NULL,
+    as_id TEXT NOT NULL,
     txn_id INTEGER NOT NULL,
     event_ids TEXT NOT NULL,
     UNIQUE(as_id, txn_id)
diff --git a/synapse/storage/schema/delta/16/users.sql b/synapse/storage/schema/delta/16/users.sql
index db27bdca02..cd0709250d 100644
--- a/synapse/storage/schema/delta/16/users.sql
+++ b/synapse/storage/schema/delta/16/users.sql
@@ -2,9 +2,9 @@
 -- MUST BE DONE BEFORE REMOVING ID COLUMN FROM USERS TABLE BELOW
 CREATE TABLE IF NOT EXISTS new_access_tokens(
     id BIGINT UNSIGNED PRIMARY KEY,
-    user_id VARCHAR(150) NOT NULL,
-    device_id VARCHAR(150),
-    token VARCHAR(150) NOT NULL,
+    user_id TEXT NOT NULL,
+    device_id TEXT,
+    token TEXT NOT NULL,
     last_used BIGINT UNSIGNED,
     UNIQUE(token)
 );
@@ -20,8 +20,8 @@ ALTER TABLE new_access_tokens RENAME TO access_tokens;
 
 -- Remove ID column from `users` table
 CREATE TABLE IF NOT EXISTS new_users(
-    name VARCHAR(150),
-    password_hash VARCHAR(150),
+    name TEXT,
+    password_hash TEXT,
     creation_ts BIGINT UNSIGNED,
     admin BOOL DEFAULT 0 NOT NULL,
     UNIQUE(name)
@@ -36,11 +36,11 @@ ALTER TABLE new_users RENAME TO users;
 
 -- Remove UNIQUE constraint from `user_ips` table
 CREATE TABLE IF NOT EXISTS new_user_ips (
-    user_id VARCHAR(150) NOT NULL,
-    access_token VARCHAR(150) NOT NULL,
-    device_id VARCHAR(150),
-    ip VARCHAR(150) NOT NULL,
-    user_agent VARCHAR(150) NOT NULL,
+    user_id TEXT NOT NULL,
+    access_token TEXT NOT NULL,
+    device_id TEXT,
+    ip TEXT NOT NULL,
+    user_agent TEXT NOT NULL,
     last_seen BIGINT UNSIGNED NOT NULL
 );