Skip to content
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

Geopackage layer rename in DB Manager does not update f_table_name values in the layer_styles table or the Triggers #29045

Closed
qgib opened this issue Feb 11, 2019 · 17 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! DB Manager Relating to the DB Manager core plugin

Comments

@qgib
Copy link
Contributor

qgib commented Feb 11, 2019

Author Name: Steve Lowman (Steve Lowman)
Original Redmine Issue: 21227
Affected QGIS version: 3.4.4
Redmine category:db_manager
Assignee: Martin Dobias


We have a geopackage file with some layers and some styles for those layers, including default styles that display when we add the layers to the map canvas.

We use DB Manager to rename one or more of the geopackage layers.

For the renamed layers, the text in the Triggers section of the DB Manager Info tab still refers to the old layer name, and we cannot edit this (I do not know what consequences this may have).

In the layer_styles table for this geopackage, viewed in the Table tab of DB Manager, the values in the f_table_name still contain the old layer names. Consequently, the correct default styles do not display when we add the layers to the Map Canvas, and in Layer Properties, the Style > Load Style > from database (Geopackage) 'Database styles manager' dialog lists nothing under 'Styles related to the layer'.

We can find the appropriate style if we look for it in the list of 'Other styles on the database', but this is a overly complicated procedure to obtain the saved style, and it is not really something we can expect our novice-to-intermediate QGIS users to do every time.


@qgib
Copy link
Contributor Author

qgib commented Feb 11, 2019

Author Name: Steve Lowman (Steve Lowman)


I notice that there is a plugin called 'DB Style Manager', which is designed only for PostGIS connection, not for geopackages. Still, perhaps its code could help with resolving this issue for geopackages, if the resolution is not easy.

Also, I wonder whether this bug also extends to PostGIS connections? I have not yet been able to test for this, as I do not yet make regular use of PostGIS.

@qgib
Copy link
Contributor Author

qgib commented Feb 12, 2019

Author Name: Alessandro Pasotti (@elpaso)


  • assigned_to_id was configured as Alessandro Pasotti

@qgib
Copy link
Contributor Author

qgib commented Feb 13, 2019

Author Name: Alessandro Pasotti (@elpaso)


Ok for styles: I'm working on it on PR #9164

About triggers: what triggers exactly are not updated?

The current implementation relies on GDAL which does update all geopackage related triggers, if you have custom triggers then they will not be updated and it's a won't fik (IMO).


  • status_id was changed from Open to In Progress
  • pull_request_patch_supplied was changed from 0 to 1

@qgib
Copy link
Contributor Author

qgib commented Feb 13, 2019

Author Name: Steve Lowman (Steve Lowman)


Thanks Alessandro. For the Triggers, there are two of them in these layers, both seem to be about feature count - one for "insert" and the other for "delete". I do not know what they really do.

I will attach an image to show these. I changed the layer name, but the previous layer name is still there for these insert and delete feature counts Triggers.


  • 14301 was configured as DB Manager Rename bug - Triggers.png

@qgib
Copy link
Contributor Author

qgib commented Feb 13, 2019

Author Name: Alessandro Pasotti (@elpaso)


Oh, I see, it's an issue in the dialog which is not updated, the triggers are acually updated correctly in the DB but the dialog is not.

@qgib
Copy link
Contributor Author

qgib commented Feb 13, 2019

Author Name: Alessandro Pasotti (@elpaso)


Applied in changeset 61d361d.


  • status_id was changed from In Progress to Closed
  • done_ratio was changed from 0 to 100

@qgib
Copy link
Contributor Author

qgib commented Feb 25, 2019

Author Name: Steve Lowman (Steve Lowman)


It is fixed in 3.6, but not fixed in the upgraded 3.4.5 LTR.


  • status_id was changed from Closed to Reopened

@qgib
Copy link
Contributor Author

qgib commented Feb 25, 2019

Author Name: Alessandro Pasotti (@elpaso)


For the record: it was not fixed in 3.4 because the implementation is based on a feature which is only available in 3.6 hence a straight backport was unfortunately not feasible.

@qgib
Copy link
Contributor Author

qgib commented Feb 25, 2019

Author Name: Steve Lowman (Steve Lowman)


Is there any way to fix it in 3.4? It messes up our work flow quite badly.

@qgib
Copy link
Contributor Author

qgib commented Feb 25, 2019

Author Name: Alessandro Pasotti (@elpaso)


There are multiple ways, see this article (not written by me) http://nyalldawson.net/2016/08/how-to-effectively-get-things-changed-in-qgis/

@qgib
Copy link
Contributor Author

qgib commented Feb 25, 2019

Author Name: Steve Lowman (Steve Lowman)


Okay, thanks, I hope I am not being put into category 7. I just work here and have very little influence over anything, but I will make a suggestion. Meanwhile, I guess you had better close this report again.

@qgib
Copy link
Contributor Author

qgib commented Feb 25, 2019

Author Name: Alessandro Pasotti (@elpaso)


Thanks for your understanding: we have very limited time resources (not to mention the ridiculously slow budget) and we have to prioritize.

@qgib
Copy link
Contributor Author

qgib commented Feb 25, 2019

Author Name: Steve Lowman (Steve Lowman)


Would you be able to recommend who best to contact to get a price estimate for fixing this in the LTR, or should I just contact someone local on the list at https://www.qgis.org/en/site/forusers/commercial_support.html ?

@qgib
Copy link
Contributor Author

qgib commented Feb 25, 2019

Author Name: Alessandro Pasotti (@elpaso)


In that list you can find a lot of qualified free-lance developers and companies (included myself), feel free to contact anyone.

@qgib
Copy link
Contributor Author

qgib commented Feb 25, 2019

Author Name: Giovanni Manghi (@gioman)


  • resolution was changed from to fixed/implemented
  • status_id was changed from Reopened to Closed

@qgib
Copy link
Contributor Author

qgib commented Mar 29, 2019

Author Name: Saber Razmjooei (@saberraz)


  • assigned_to_id was changed from Alessandro Pasotti to Martin Dobias
  • status_id was changed from Closed to Open

@qgib
Copy link
Contributor Author

qgib commented Apr 9, 2019

Author Name: Martin Dobias (@wonder-sk)


Applied in changeset 9eca405.


  • status_id was changed from Open to Closed

@qgib qgib closed this as completed Apr 9, 2019
@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! DB Manager Relating to the DB Manager core plugin labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! DB Manager Relating to the DB Manager core plugin
Projects
None yet
Development

No branches or pull requests

1 participant