mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Pamhyr: Database: Update data dictionary and some change to prepare db
0.1.0.
This commit is contained in:
1 parent
d78d9167a0
commit
5c4948bd6d
25 files changed
+426
-182
No files matched your search
+17
-1
@@ -272,7 +272,23 @@ class Study(SQLModel):
|
||||
"INSERT INTO info VALUES ('study_release', '0')"
|
||||
)
|
||||
|
||||
if self._update_submodel(version[0]):
|
||||
if int(minor) < 1:
|
||||
# Need to temporary disable the sqlite foreign keys
|
||||
# checking to update db dans change the table id fk to
|
||||
# table pamhyr_id fk
|
||||
self.execute(
|
||||
"PRAGMA foreign_keys = OFF;"
|
||||
)
|
||||
|
||||
ok = self._update_submodel(version[0], data={})
|
||||
|
||||
if int(minor) < 1:
|
||||
# Reactivate foreign keys checking
|
||||
self.execute(
|
||||
"PRAGMA foreign_keys = ON;"
|
||||
)
|
||||
|
||||
if ok:
|
||||
self.execute(
|
||||
f"UPDATE info SET value='{self._version}' WHERE key='version'"
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user