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

Refactor all Service Module's Postgres queries to replace DELETE queries with INSERT and SELECT #282

Conversation

baha-a
Copy link
Contributor

@baha-a baha-a commented May 14, 2024

Copy link

sonarcloud bot commented May 14, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@baha-a baha-a marked this pull request as ready for review May 14, 2024 12:59
@baha-a baha-a requested a review from 1AhmedYasser May 14, 2024 12:59
@@ -1,6 +1,2 @@
INSERT INTO services (name, description, service_id, ruuter_type, is_common, structure)
VALUES (:name, :description, :service_id, :ruuter_type::ruuter_request_type, :is_common, :structure::json)
ON CONFLICT (service_id) DO UPDATE
Copy link
Collaborator

Choose a reason for hiding this comment

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

This can have conflicts as service id is generated, and may conflict

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The service_id is not auto-generated, it's defined as TEXT, plus, I've removed the unique constraint on it here, As a result, we can now insert multiple service_id with the same value.

@turnerrainer turnerrainer merged commit 6ec16a9 into buerokratt:dev May 24, 2024
3 checks passed
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.

Refactor all Service Module's Postgres queries to replace DELETE queries with INSERT and SELECT
3 participants