summary refs log tree commit diff
path: root/synapse/storage/schema/delta
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-04-10 11:22:04 +0100
committerErik Johnston <erik@matrix.org>2015-04-10 11:22:04 +0100
commit7e863c51e6a6a5b6f757cb279f5d7308db1432d4 (patch)
tree2b491a2422034b63b423ba11b59df0ebaa732a9c /synapse/storage/schema/delta
parentSQLite wants INTEGER and not BIGINT for primary keys (diff)
downloadsynapse-7e863c51e6a6a5b6f757cb279f5d7308db1432d4.tar.xz
Use unsigned bigint
Diffstat (limited to 'synapse/storage/schema/delta')
-rw-r--r--synapse/storage/schema/delta/12/v12.sql8
-rw-r--r--synapse/storage/schema/delta/13/v13.sql2
-rw-r--r--synapse/storage/schema/delta/16/users.sql8
3 files changed, 9 insertions, 9 deletions
diff --git a/synapse/storage/schema/delta/12/v12.sql b/synapse/storage/schema/delta/12/v12.sql
index 4107cba71f..1247fd175c 100644
--- a/synapse/storage/schema/delta/12/v12.sql
+++ b/synapse/storage/schema/delta/12/v12.sql
@@ -30,12 +30,12 @@ CREATE TABLE IF NOT EXISTS pushers (
   app_display_name VARCHAR(64) NOT NULL,
   device_display_name VARCHAR(128) NOT NULL,
   pushkey VARBINARY(512) NOT NULL,
-  ts BIGINT NOT NULL,
+  ts BIGINT UNSIGNED NOT NULL,
   lang VARCHAR(8),
   data BLOB,
   last_token TEXT,
-  last_success BIGINT,
-  failing_since BIGINT,
+  last_success BIGINT UNSIGNED,
+  failing_since BIGINT UNSIGNED,
   UNIQUE (app_id, pushkey)
 );
 
@@ -54,7 +54,7 @@ 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),
-  filter_id BIGINT,
+  filter_id BIGINT UNSIGNED,
   filter_json BLOB
 );
 
diff --git a/synapse/storage/schema/delta/13/v13.sql b/synapse/storage/schema/delta/13/v13.sql
index 17a139b867..d1da2b48e2 100644
--- a/synapse/storage/schema/delta/13/v13.sql
+++ b/synapse/storage/schema/delta/13/v13.sql
@@ -24,7 +24,7 @@ CREATE TABLE IF NOT EXISTS application_services(
 
 CREATE TABLE IF NOT EXISTS application_services_regex(
     id INTEGER PRIMARY KEY AUTOINCREMENT,
-    as_id BIGINT NOT NULL,
+    as_id BIGINT UNSIGNED NOT NULL,
     namespace INTEGER,  /* enum[room_id|room_alias|user_id] */
     regex VARCHAR(150),
     FOREIGN KEY(as_id) REFERENCES application_services(id)
diff --git a/synapse/storage/schema/delta/16/users.sql b/synapse/storage/schema/delta/16/users.sql
index 1bbd1c0a17..f04705cd77 100644
--- a/synapse/storage/schema/delta/16/users.sql
+++ b/synapse/storage/schema/delta/16/users.sql
@@ -1,11 +1,11 @@
 -- Convert `access_tokens`.user from rowids to user strings.
 -- MUST BE DONE BEFORE REMOVING ID COLUMN FROM USERS TABLE BELOW
 CREATE TABLE IF NOT EXISTS new_access_tokens(
-    id BIGINT PRIMARY KEY,
+    id BIGINT UNSIGNED PRIMARY KEY,
     user_id VARCHAR(150) NOT NULL,
     device_id VARCHAR(150),
     token VARCHAR(150) NOT NULL,
-    last_used BIGINT,
+    last_used BIGINT UNSIGNED,
     UNIQUE(token)
 );
 
@@ -22,7 +22,7 @@ ALTER TABLE new_access_tokens RENAME TO access_tokens;
 CREATE TABLE IF NOT EXISTS new_users(
     name VARCHAR(150),
     password_hash VARCHAR(150),
-    creation_ts BIGINT,
+    creation_ts BIGINT UNSIGNED,
     admin BOOL DEFAULT 0 NOT NULL,
     UNIQUE(name)
 );
@@ -41,7 +41,7 @@ CREATE TABLE IF NOT EXISTS new_user_ips (
     device_id VARCHAR(150),
     ip VARCHAR(150) NOT NULL,
     user_agent VARCHAR(150) NOT NULL,
-    last_seen BIGINT NOT NULL
+    last_seen BIGINT UNSIGNED NOT NULL
 );
 
 INSERT INTO new_user_ips