DB: Some fixes for db update 0.1.0.

This commit is contained in:
Pierre-Antoine Rouby committed 2024-08-07 11:11:32 +02:00
1 parent 74c61262b7
commit c7b5b40eda
5 files changed
+12 -18

No files matched your search

@@ -85,7 +85,7 @@ class Data(SQLSubModel):
cls._db_create(execute, ext="_tmp")
execute(
f"INSERT INTO {table} " +
f"INSERT INTO {table}_tmp " +
"(pamhyr_id, ind, data0, data1, bc, scenario) " +
"SELECT pamhyr_id, ind, data0, data1, bc, scenario " +
f"FROM {table}"
@@ -196,6 +196,9 @@ class BoundaryCondition(SQLSubModel):
)
""")
if ext == "_tmp":
return True
return cls._create_submodel(execute)
@classmethod
@@ -278,6 +281,8 @@ class BoundaryCondition(SQLSubModel):
data["bc"] = bc
bc._data = Data._db_load(execute, data=data)
new.append(bc)
return new
def _db_save(self, execute, data=None):