mirror of https://gitlab.com/pamhyr/pamhyr2
Scenario: Simplify scenario update and minor change.
parent
76559f6af8
commit
0346080e16
|
|
@ -547,12 +547,12 @@ class River(Graph):
|
|||
|
||||
data['loaded_pid'] = set()
|
||||
|
||||
new._Pollutants = PollutantsList._db_load(execute, data)
|
||||
|
||||
new._Output_rk_adists = OutputRKAdistsList._db_load(
|
||||
execute, data
|
||||
)
|
||||
|
||||
new._Pollutants = PollutantsList._db_load(execute, data)
|
||||
|
||||
new._InitialConditionsAdisTS = InitialConditionsAdisTSList._db_load(
|
||||
execute, data)
|
||||
|
||||
|
|
|
|||
|
|
@ -93,21 +93,10 @@ class Scenario(SQLSubModel):
|
|||
@classmethod
|
||||
def _db_update(cls, execute, version, data=None):
|
||||
major, minor, release = version.strip().split(".")
|
||||
if major == minor == "0":
|
||||
if int(release) < 12:
|
||||
cls._db_create(execute)
|
||||
cls._db_add_default(execute)
|
||||
|
||||
if major == "0" and minor == "1":
|
||||
if int(release) < 2:
|
||||
execute(
|
||||
"ALTER TABLE scenario " +
|
||||
"ADD COLUMN x REAL NOT NULL DEFAULT 1000"
|
||||
)
|
||||
execute(
|
||||
f"ALTER TABLE scenario " +
|
||||
"ADD COLUMN y REAL NOT NULL DEFAULT 1000"
|
||||
)
|
||||
if major == "0" and int(minor) <= 2:
|
||||
cls._db_create(execute)
|
||||
cls._db_add_default(execute)
|
||||
|
||||
return True
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue