mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Results: Fix db update from 0.2.0.
This commit is contained in:
1 parent
8f6255c2cd
commit
1dd92cb089
5 files changed
+6
-4
No files matched your search
@@ -102,7 +102,7 @@ class OutputRKAdists(SQLSubModel):
|
|||||||
cls._db_create(execute)
|
cls._db_create(execute)
|
||||||
created = True
|
created = True
|
||||||
|
|
||||||
if major == "0" and int(minor) <= 2:
|
if major == "0" and int(minor) < 2:
|
||||||
if not created:
|
if not created:
|
||||||
cls._db_update_to_0_2_0(execute, data)
|
cls._db_update_to_0_2_0(execute, data)
|
||||||
|
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ class Results(SQLSubModel):
|
|||||||
major, minor, release = version.strip().split(".")
|
major, minor, release = version.strip().split(".")
|
||||||
|
|
||||||
if major == "0" and int(minor) <= 2:
|
if major == "0" and int(minor) <= 2:
|
||||||
|
if int(release) < 1:
|
||||||
cls._db_create(execute)
|
cls._db_create(execute)
|
||||||
|
|
||||||
return cls._update_submodel(execute, version, data)
|
return cls._update_submodel(execute, version, data)
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ class Profile(SQLSubModel):
|
|||||||
major, minor, release = version.strip().split(".")
|
major, minor, release = version.strip().split(".")
|
||||||
|
|
||||||
if major == "0" and int(minor) <= 2:
|
if major == "0" and int(minor) <= 2:
|
||||||
|
if int(release) < 1:
|
||||||
cls._db_create(execute)
|
cls._db_create(execute)
|
||||||
|
|
||||||
return cls._update_submodel(execute, version, data)
|
return cls._update_submodel(execute, version, data)
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class Scenario(SQLSubModel):
|
|||||||
def _db_update(cls, execute, version, data=None):
|
def _db_update(cls, execute, version, data=None):
|
||||||
major, minor, release = version.strip().split(".")
|
major, minor, release = version.strip().split(".")
|
||||||
|
|
||||||
if major == "0" and int(minor) <= 2:
|
if major == "0" and int(minor) < 2:
|
||||||
cls._db_create(execute)
|
cls._db_create(execute)
|
||||||
cls._db_add_default(execute)
|
cls._db_add_default(execute)
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -38,7 +38,7 @@ logger = logging.getLogger()
|
|||||||
|
|
||||||
|
|
||||||
class Study(SQLModel):
|
class Study(SQLModel):
|
||||||
_version = "0.2.0"
|
_version = "0.2.1"
|
||||||
|
|
||||||
_sub_classes = [
|
_sub_classes = [
|
||||||
Scenario,
|
Scenario,
|
||||||
@@ -276,7 +276,7 @@ class Study(SQLModel):
|
|||||||
"INSERT INTO info VALUES ('study_release', '0')"
|
"INSERT INTO info VALUES ('study_release', '0')"
|
||||||
)
|
)
|
||||||
|
|
||||||
if major == "0" and int(minor) <= 2:
|
if major == "0" and int(minor) < 2:
|
||||||
self._add_into_info_if_not_exists('current_scenario', '0')
|
self._add_into_info_if_not_exists('current_scenario', '0')
|
||||||
|
|
||||||
if major == "0" and int(minor) < 2:
|
if major == "0" and int(minor) < 2:
|
||||||
|
|||||||
Reference in new issue
Block a user