Commit 252af237 authored by Florian Pritz's avatar Florian Pritz
Browse files

DB: Fix version detection

Signed-off-by: Florian Pritz's avatarFlorian Pritz <>
parent 2695a61a
......@@ -10,7 +10,7 @@ class DB:
c = self.db.cursor()
version = self._get_version()
if version is None:
if version < 1:
c.execute('create table if not exists files (filename text, uploaded int)')
version = 1
......@@ -29,7 +29,7 @@ class DB:
def _get_version(self):
self.db.cursor().execute('pragma user_version').fetchone()[0]
return self.db.cursor().execute('pragma user_version').fetchone()[0]
def _set_version(self, version):
self.db.cursor().execute('pragma user_version='+str(version))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment