summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
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):