mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-03 05:04:33 +03:00
Remove hardcoded database version from session sql statement
This commit is contained in:
parent
47b53ce89f
commit
0570c55120
|
@ -107,6 +107,7 @@ class Session:
|
||||||
else:
|
else:
|
||||||
# Tables don't exist, create new ones
|
# Tables don't exist, create new ones
|
||||||
c.execute("create table version (version integer)")
|
c.execute("create table version (version integer)")
|
||||||
|
c.execute("insert into version values (?)", (CURRENT_VERSION,))
|
||||||
c.execute(
|
c.execute(
|
||||||
"""create table sessions (
|
"""create table sessions (
|
||||||
dc_id integer primary key,
|
dc_id integer primary key,
|
||||||
|
@ -124,7 +125,6 @@ class Session:
|
||||||
name text
|
name text
|
||||||
) without rowid"""
|
) without rowid"""
|
||||||
)
|
)
|
||||||
c.execute("insert into version values (1)")
|
|
||||||
# Migrating from JSON -> new table and may have entities
|
# Migrating from JSON -> new table and may have entities
|
||||||
if entities:
|
if entities:
|
||||||
c.executemany(
|
c.executemany(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user