mirror of
https://github.com/chatmail/relay.git
synced 2026-05-20 12:58:04 +00:00
doveauth: ; in sqlite statements not necessary
This commit is contained in:
@@ -35,7 +35,7 @@ class Connection:
|
|||||||
|
|
||||||
def create_user(self, addr: str, password: str):
|
def create_user(self, addr: str, password: str):
|
||||||
"""Create a row in the users table."""
|
"""Create a row in the users table."""
|
||||||
self.execute("PRAGMA foreign_keys=on;")
|
self.execute("PRAGMA foreign_keys=on")
|
||||||
q = """INSERT INTO users (addr, password, last_login)
|
q = """INSERT INTO users (addr, password, last_login)
|
||||||
VALUES (?, ?, ?)"""
|
VALUES (?, ?, ?)"""
|
||||||
self.execute(q, (addr, password, int(time.time())))
|
self.execute(q, (addr, password, int(time.time())))
|
||||||
@@ -116,7 +116,7 @@ class Database:
|
|||||||
|
|
||||||
def get_schema_version(self) -> int:
|
def get_schema_version(self) -> int:
|
||||||
with self.read_connection() as conn:
|
with self.read_connection() as conn:
|
||||||
dbversion = conn.execute("PRAGMA user_version;").fetchone()[0]
|
dbversion = conn.execute("PRAGMA user_version").fetchone()[0]
|
||||||
return dbversion
|
return dbversion
|
||||||
|
|
||||||
CURRENT_DBVERSION = 1
|
CURRENT_DBVERSION = 1
|
||||||
@@ -137,4 +137,4 @@ class Database:
|
|||||||
)
|
)
|
||||||
""",
|
""",
|
||||||
)
|
)
|
||||||
conn.execute("PRAGMA user_version=%s;" % (self.CURRENT_DBVERSION,))
|
conn.execute("PRAGMA user_version=%s" % (self.CURRENT_DBVERSION,))
|
||||||
|
|||||||
Reference in New Issue
Block a user