check project database compatability and apply upgrades#20
check project database compatability and apply upgrades#20
Conversation
ascheidl
left a comment
There was a problem hiding this comment.
ich glaube ein automatischers upgrade ist nicht gut ... zumindest für uns am IEE, weil das ggf bedeutet, dass Mitarbeiter mit älteren PH versionen plötzlich die Netzdaten nicht mehr laden können
|
Wie wäre es hiermit: Versuche ich das Projekt mit einer inkompatiblen ph version zu öffnen wird ein Fehler gelogged und das Projekt nicht aktiviert. Inkompatibel meint das eine neuere pandahub version migrationen am schema der projekt-db vorgenommen hat. Öffne ich ein Projekt für das meine aktuelle pandahub version schema migrations vorsieht wird ein Fehler gelogged und das Projekt nicht aktiviert, außer ich übergebe "apply_upgrades=True" - dann werden alle außstehenden migrationen durchgeführt und das Projekt aktiviert. Um die Implementation simpel zu halten wird in den project settings hier nicht die letzte pandahub version mit der das Projekt geöffnet wurde gespeichert sondern die letzte pandahub version die eine migration vorgenommen hat. |
|
klingt sinnvoll für mich! |
* immediately return if project version is up-to-date * update project version sequentially after each migration
Projects are versioned with the latest pandahub release which included schema changes. If the project had schema migrations from later pandahub versions applied, trying to activate it will log an error asking the user to update pandahub. If the project database needs migrations in order to work with the current pandahub version, they will be applied if activate_project() is called with apply_upgrades=True, otherwise the project is not activated and an error logged to the user.
2583f90 to
b3287f8
Compare
|
fine für mich |
Changes upgrade_project_to_latest_version() to immediately return if the project version is current, set the version property sequentially after each migration, and always run the upgrade function when a project is activated.