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

chore: add clean_tilelayer management command #1670

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yohanboniface
Copy link
Member

It can be useful to manage the tilelayer registered in the map settings in db.

@yohanboniface yohanboniface force-pushed the clean-tilelayer-command branch 4 times, most recently from 40c8e68 to d6f1574 Compare March 4, 2024 10:41
It can be useful to manage the tilelayer registered in the map
settings in db.
Copy link
Member

@almet almet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, except the SQL statements (or the tests) are not passing on the CI.

with connection.cursor() as cursor:
ret = cursor.execute(
"UPDATE umap_map "
"SET settings['properties'] = (settings->'properties') - 'tilelayer'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice syntax :-)

ret = cursor.execute(
"UPDATE umap_map "
"SET settings['properties']['tilelayer']['url_template'] = %s "
"WHERE settings->'properties'->'tilelayer'->'url_template' = %s",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests seems to be failing because of this line.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it passes with my local psql (16), but not with the version 13 of the CI. I've tried many syntaxes, but blindly and without success. I'd need to run a version 13 locally I'd say.

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.

None yet

2 participants