summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-04-14 09:54:44 +0100
committerErik Johnston <erik@matrix.org>2015-04-14 09:54:44 +0100
commit3c741682e59a41fcc45a5b9a370c7f268be7729e (patch)
treedb77e7ef72ed29ae046c8eaf27fcd81f7819df7f /synapse/storage
parentFor backwards compat, make state_groups.id have a type of int, not varchar (diff)
downloadsynapse-3c741682e59a41fcc45a5b9a370c7f268be7729e.tar.xz
Correctly increment the _next_id initially
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/util/id_generators.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/storage/util/id_generators.py b/synapse/storage/util/id_generators.py
index 8f419323a7..2e2a408988 100644
--- a/synapse/storage/util/id_generators.py
+++ b/synapse/storage/util/id_generators.py
@@ -55,9 +55,11 @@ class IdGenerator(object):
                 )
 
                 val, = txn.fetchone()
-                self._next_id = val or 2
+                cur = val or 0
+                cur += 1
+                self._next_id = cur + 1
 
-                return 1
+                return cur
 
 
 class StreamIdGenerator(object):