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

_dict_save create or update instead of upsert #8230

Open
wardi opened this issue May 17, 2024 · 0 comments
Open

_dict_save create or update instead of upsert #8230

wardi opened this issue May 17, 2024 · 0 comments
Assignees

Comments

@wardi
Copy link
Contributor

wardi commented May 17, 2024

CKAN version

all

Describe the bug

In model_save.py the various _dict_save functions check for the existence of a row with the same id before deciding whether to create or update the row. This is something we should already know at the action level, not need to detect in model_save.py, and detecting this way means postgres can't help us prevent mistakes.

Steps to reproduce

Expected behavior

Create actions should only ever create not update existing rows. Update actions should only update not create rows.

Additional details

#8069 (comment)

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

No branches or pull requests

2 participants