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

Make column names consistent #367

Merged
merged 2 commits into from
Mar 25, 2024
Merged

Make column names consistent #367

merged 2 commits into from
Mar 25, 2024

Conversation

Ceredron
Copy link
Collaborator

@Ceredron Ceredron commented Mar 25, 2024

Description

If we use _pk and _fk suffixes, we should do so consistently.

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

@Ceredron Ceredron marked this pull request as ready for review March 25, 2024 10:42
@Andreass2
Copy link
Collaborator

Following should also be changed:
altinn_resource.service_owner_id -> altinn_resource.service_owner_id_fk
party.organization_number -> party.organization_number_pk

@Andreass2 Andreass2 self-requested a review March 25, 2024 13:58
@Ceredron
Copy link
Collaborator Author

Following should also be changed: altinn_resource.service_owner_id -> altinn_resource.service_owner_id_fk party.organization_number -> party.organization_number_pk

Good catch!
I fixed this, and also re-wrote some of the sql queries to not use "SELECT *", but instead specifying columns. It's not super-important, but usually considered best practice.
https://bornsql.ca/blog/why-you-should-not-use-select/
Main reason is that the optimizer/planner may not work as intended some times.

Copy link
Contributor

@tomshag tomshag left a comment

Choose a reason for hiding this comment

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

Looks good.

@Ceredron Ceredron merged commit 56f7f14 into main Mar 25, 2024
1 check passed
@Ceredron Ceredron deleted the chore/fix-column-naming branch March 25, 2024 16:43
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.

3 participants