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

Add insert do update on conflict to region seeder #1228

Merged
merged 3 commits into from
Aug 2, 2024

Conversation

jonathangoulding
Copy link
Collaborator

https://eaflood.atlassian.net/browse/WATER-4535

As we move to using seeders for tests we can look to add functionality to allow us to seed the actually database.

This change adds ON CONLICT resoultion based on unique constraints that are not the primary id's. This will allow the seeders to seed data and not affect existing data.

This change is part of ongoing work to with the import service and test improvements to allow us to move to parallel test runs.

Regions does not have unique constraint on the charge_region_id or the nald_region_id so we will either update where they match or insert where the pair does not exist.

https://eaflood.atlassian.net/browse/WATER-4535

As we move to using seeders for tests we can look to add functionality to allow us to seed the actually database.

This change adds ON CONLICT resoultion based on unique constraints that are not the primary id's. This will allow the seeders to seed data and not affect existing data.

This change is part of ongoing work to with the import service and test improvements to allow us to move to parallel test runs.

Regions does not have unique constraint on the  charge_region_id or the nald_region_id so we will either update where they match or insert where the pair does not exist.
@jonathangoulding jonathangoulding self-assigned this Aug 2, 2024
https://eaflood.atlassian.net/browse/WATER-4535

As we move to using seeders for tests we can look to add functionality to allow us to seed the actually database.

This change adds ON CONLICT resoultion based on unique constraints that are not the primary id's. This will allow the seeders to seed data and not affect existing data.

This change is part of ongoing work to with the import service and test improvements to allow us to move to parallel test runs.

Regions does not have unique constraint on the  charge_region_id or the nald_region_id so we will either update where they match or insert where the pair does not exist.
@jonathangoulding jonathangoulding marked this pull request as ready for review August 2, 2024 09:37
@jonathangoulding jonathangoulding merged commit d1e6f9f into main Aug 2, 2024
6 checks passed
@jonathangoulding jonathangoulding deleted the seeder-add-on-conflict-for-seeders-region branch August 2, 2024 09:49
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