diff options
author | Erik Johnston <erik@matrix.org> | 2015-04-14 09:54:44 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-04-14 09:54:44 +0100 |
commit | 3c741682e59a41fcc45a5b9a370c7f268be7729e (patch) | |
tree | db77e7ef72ed29ae046c8eaf27fcd81f7819df7f /synapse | |
parent | For backwards compat, make state_groups.id have a type of int, not varchar (diff) | |
download | synapse-3c741682e59a41fcc45a5b9a370c7f268be7729e.tar.xz |
Correctly increment the _next_id initially
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/storage/util/id_generators.py | 6 |
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): |