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

Updated Postgres naming of objects #2

Merged
merged 2 commits into from
Jan 16, 2025
Merged

Conversation

ryanbooz
Copy link
Contributor

@HuxleyKendell and I were working on the updated script at the same time (great job, Hux). I'm submitting this as an update to consider because of how Postgres names objects. All objects are coalesced to lowercase unless they're quoted, but then all objects need to be quoted from that point forward if they are anything other than lowercase. Therefore, the Postgres convention is to use snake_case, which is used for all other internal functions and naming.

This becomes evident in the baseline script, where all of the creation statements are all lowercase (rather than the CamelCase of the creation script), and then automatically generated objects like sequences are snake_case.

I also made updates to the identity columns so that they would function like SQL Server identity columns (cannot insert values manually), and created some procedures rather than functions. Essentially, any function that does not return a result (void) can technically be a procedure. These changes are debatable, but I thought having the opportunity to show that both are maintained by Flyway was potentially helpful.

@HuxleyKendell HuxleyKendell merged commit 05ab457 into red-gate:main Jan 16, 2025
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