Skip to content

Commit 37b98da

Browse files
committed
Change migration-date of Talsim-DB to 20251201
1 parent faa1c3c commit 37b98da

File tree

6 files changed

+5
-5
lines changed

6 files changed

+5
-5
lines changed

DB/QTalsim.db-shm

-32 KB
Binary file not shown.

DB/QTalsim.db-wal

Whitespace-only changes.

QTalsim/DB/QTalsim.db

1.18 MB
Binary file not shown.
File renamed without changes.

QTalsim/qtalsim_sqllite_dialog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ def selectDB(self):
162162
self.cur.execute(sql_check_version)
163163
self.migrationId = self.cur.fetchall()[0][0]
164164

165-
if self.migrationId[:8] < '20240325': # Check version of Talsim DB
165+
if self.migrationId[:8] < '20251201': # Check version of Talsim DB
166166
message = f"Talsim DB with date {self.migrationId[:8]} is too old. Please use a more recent version."
167167
raise Exception(message)
168-
elif self.migrationId[:8] < '20240325':
168+
elif self.migrationId[:8] > '20251201':
169169
self.log_to_qtalsim_tab(f"Talsim DB with date {self.migrationId[:8]} is newer than the tested version.", Qgis.Warning)
170170

171171
sql_query = "SELECT Name, Id FROM Scenario;"

QTalsim/qtalsim_subbasin_dialog.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -936,18 +936,18 @@ def DBExport(self):
936936
source_db = os.path.join(current_path, "DB", "QTalsim.db")
937937
shutil.copy(source_db, self.DBPath)
938938

939-
#Insert ScenarioGroup
939+
#Insert ScenarioFolder
940940
conn = sqlite3.connect(self.DBPath)
941941
cursor = conn.cursor()
942942
cursor.execute("""
943-
INSERT INTO ScenarioGroup (Description, Name, DateCreated)
943+
INSERT INTO ScenarioFolder (Description, Name, DateCreated)
944944
VALUES (?, ?, datetime('now'))
945945
""", ("Output of QTalsim", str(self.scenarioName)))
946946
new_group_id = cursor.lastrowid
947947

948948
#Insert new scenario
949949
cursor.execute("""
950-
INSERT INTO Scenario (ScenarioGroupId, DateCreated, Name, Description, ActiveSimulationId, IsUpdateActive, OperationalInfo)
950+
INSERT INTO Scenario (ScenarioFolderId, DateCreated, Name, Description, ActiveSimulationId, IsUpdateActive, OperationalInfo)
951951
VALUES (?, datetime('now'), ?, ?, ?, ?, ?)
952952
""", (new_group_id, str(self.scenarioName), "Output of QTalsim", None, 0, None))
953953

0 commit comments

Comments
 (0)