-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Postgresql Qgis Project versioning #64352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Postgresql Qgis Project versioning #64352
Conversation
|
This is a redo of #63663 which was kind of messed up by rebase. |
🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. 🍎 MacOS Qt6 buildsDownload MacOS Qt6 builds of this PR for testing. |
… previously it only work correctly if the schema was populated
| QgsPostgresProjectUri projectUri = mModel->projectUriForRow( mTableView->currentIndex().row() ); | ||
| QString encodedUri = QgsPostgresProjectStorage::encodeUri( projectUri ); | ||
| QgsProject::instance()->read( encodedUri ); | ||
|
|
||
| QDialog::accept(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have two concerns at this point:
- User might lose unsaved changes. Should we not check if project is dirty and ask if he wants to save changes first?
- The dialog is visible and frozen while the project is loading, which can take a while for big projects. Would it make sense to handle the project loading in the caller code, while also overriding the cursor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The loading is done in caller instead in the dialog also with cursor override.
Description
This allows storing older versions of QGIS projects in PostgreSQL. The process is mostly handled by a function and a trigger in the DB.
There are two places to handle the turning on versions of projects and loading previous versions.
Browser
On schema, user has option to enable the feature (with confirmation dialog). The action is disabled if the versioning is already active for the schema.

On project user either has option to allow versioning on the parent schema of the project
If the versioning is already active the user can see the versions of the project.
Open From.../Save To...
In those menus the user can also enable the feature and select previous version to load.
When loading QGIS project from schema that has versions activated the user can select older version of the project to load, by selecting it in the QTableWidget. If nothing is selected there the active version of QGIS project is loaded.
Fixes #62299
Funded by: Ocean Winds