Commit 770bb5f9 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

Config: Fix version updater.

Showing with 12 additions and 4 deletions
+12 -4
......@@ -225,7 +225,8 @@ class Study(SQLModel):
if self._update_submodel(version[0]):
self.execute(
f"UPDATE info SET value='{self._version}' WHERE key='version'")
f"UPDATE info SET value='{self._version}' WHERE key='version'"
)
return True
logger.info("TODO: update failed")
......
......@@ -115,15 +115,22 @@ class Config(SQL):
""")
if int(release) < 3:
self.execute(f"INSERT INTO data VALUES ('last_study', '')")
self.execute(
f"INSERT INTO data VALUES ('close_correctly', 'True')")
f"INSERT OR IGNORE INTO data VALUES ('last_study', '')"
)
self.execute(
f"INSERT OR IGNORE INTO data VALUES ('close_correctly', 'True')"
)
if int(release) < 4:
self.execute(
f"INSERT INTO data VALUES ('last_solver_name', '')"
f"INSERT OR IGNORE INTO data VALUES ('last_solver_name', '')"
)
self.execute(
f"UPDATE info SET value='{self._version}' WHERE key='version'"
)
self.commit()
def _load_solver(self):
......
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