Database: use schema_version and application_id
This commit is contained in:
@ -117,6 +117,7 @@ def main() -> None:
|
||||
with open(file_name, encoding='utf-8') as sql_file:
|
||||
print(f'Executing {file_name}')
|
||||
cnx.executescript(sql_file.read())
|
||||
ver = cnx.execute("PRAGMA schema_version").fetchall()[0][0]
|
||||
|
||||
try:
|
||||
cnx.isolation_level = None
|
||||
@ -129,6 +130,7 @@ def main() -> None:
|
||||
raise RuntimeError('foreign key constraint failed')
|
||||
cnx.execute("COMMIT")
|
||||
cnx.execute("VACUUM")
|
||||
cnx.execute(f"PRAGMA schema_version = {ver}")
|
||||
except Exception as err:
|
||||
cnx.execute("ROLLBACK")
|
||||
raise err
|
||||
|
Reference in New Issue
Block a user