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

Don't do 2 SQL updates per editing #11232

Merged
merged 1 commit into from
Sep 12, 2024
Merged

Conversation

sbrunner
Copy link
Member

@sbrunner sbrunner commented Jul 10, 2024

Be able to use existing table

Don't do 2 updates per editing:
In papyrus, there is a flush that creates a first INSERT or UPDATE
The idea is to update the fields in the before_* callback to avoid having two REQUESTS

See JIRA issue: GSSIT-114.

@sbrunner sbrunner force-pushed the extend_existing-GSSIT-114 branch 12 times, most recently from 3d62ecb to f3e639d Compare July 12, 2024 10:29
@sbrunner sbrunner marked this pull request as ready for review July 12, 2024 11:25
@sbrunner sbrunner changed the title Be able to use existing table Don't do 2 updates per editing Jul 12, 2024
Copy link
Member

@arnaud-morvan arnaud-morvan left a comment

Choose a reason for hiding this comment

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

This is a complex pull request, I would like to discuss before finishing the review.
I suspect this could have some not expected or unanticipated side effects.

geoportal/c2cgeoportal_geoportal/lib/dbreflection.py Outdated Show resolved Hide resolved
@sbrunner sbrunner changed the title Don't do 2 updates per editing Don't do 2 SQL updates per editing Aug 9, 2024
@sbrunner sbrunner force-pushed the extend_existing-GSSIT-114 branch 2 times, most recently from 17917cf to 902b118 Compare August 30, 2024 07:54
Copy link
Member

@arnaud-morvan arnaud-morvan left a comment

Choose a reason for hiding this comment

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

I understand things.

Note that actually we get two requests (INSERT + UPDATE or UPDATE + UPDATE) but only one commit.

You also fix another issue, conflict when table already exist in DeclarativeMeta using option keep_existing. I would have added it in description and maybe in changelog.

Main subject could also be added to changelog IMHO.

geoportal/c2cgeoportal_geoportal/views/layers.py Outdated Show resolved Hide resolved
geoportal/c2cgeoportal_geoportal/views/layers.py Outdated Show resolved Hide resolved
geoportal/c2cgeoportal_geoportal/views/layers.py Outdated Show resolved Hide resolved
geoportal/c2cgeoportal_geoportal/views/layers.py Outdated Show resolved Hide resolved
@sbrunner sbrunner changed the base branch from 2.8 to master September 4, 2024 15:28
@sbrunner sbrunner force-pushed the extend_existing-GSSIT-114 branch 8 times, most recently from eb65876 to 4658a01 Compare September 11, 2024 10:39
@sbrunner
Copy link
Member Author

@arnaud-morvan ready for a new pass :-)

@sbrunner sbrunner force-pushed the extend_existing-GSSIT-114 branch 2 times, most recently from 2774671 to c2b403b Compare September 12, 2024 09:21
In papyrus there is a flush that create a first commit
The idea is to update the fields in the before_* callback to avoid having
tow commits
@sbrunner sbrunner merged commit 80ecef8 into master Sep 12, 2024
16 checks passed
@sbrunner sbrunner deleted the extend_existing-GSSIT-114 branch September 12, 2024 10:39
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.

2 participants