Skip to content

Conversation

@JanCaha
Copy link
Contributor

@JanCaha JanCaha commented Dec 18, 2025

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.
2025-10-27-11-44-03

On project user either has option to allow versioning on the parent schema of the project

2025-10-27-11-45-27

If the versioning is already active the user can see the versions of the project.

2025-10-27-11-45-13 versions jpg

Open From.../Save To...

In those menus the user can also enable the feature and select previous version to load.

save_project

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.

load_project

Fixes #62299

Funded by: Ocean Winds

@github-actions github-actions bot added this to the 4.0.0 milestone Dec 18, 2025
@JanCaha
Copy link
Contributor Author

JanCaha commented Dec 18, 2025

This is a redo of #63663 which was kind of messed up by rebase.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 18, 2025

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 0eb169e)

🍎 MacOS Qt6 builds

Download MacOS Qt6 builds of this PR for testing.
This installer is not signed, control+click > open the app to avoid the warning
(Built from commit 0eb169e)

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Jan 3, 2026
@github-actions github-actions bot removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Jan 4, 2026
@qgis qgis deleted a comment from github-actions bot Jan 5, 2026
Comment on lines 55 to 59
QgsPostgresProjectUri projectUri = mModel->projectUriForRow( mTableView->currentIndex().row() );
QString encodedUri = QgsPostgresProjectStorage::encodeUri( projectUri );
QgsProject::instance()->read( encodedUri );

QDialog::accept();
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable versioning for QGIS Projects stored in Postgres, managed in the Browser

3 participants