-
Notifications
You must be signed in to change notification settings - Fork 3
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
Configurable DB Schema Name #133
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question (blocking): There are still direct references to the public schema in the SQL scripts located in the resources/sql_scripts directory and in the resources/kubernetes/cv-manager-postgres.yaml file. Should we make these references configurable as well?
"JOIN public.rsus r ON ro.rsu_id = r.rsu_id " | ||
f"FROM {schema_name}.rsu_organization ro " | ||
f"JOIN {schema_name}.organizations o ON ro.organization_id = o.organization_id " | ||
"JOIN {schema_name}.rsus r ON ro.rsu_id = r.rsu_id " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question (blocking): does this line need f
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It definitely should.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not entirely convinced this should be customizable. I do see how leaving it as the default public
schema name may not be desirable. In my opinion we should probably just change it to something custom instead of allowing complete customization.
The way this is implemented is great because it does support the customization of the pg schema but I think it is a little too free form to expect the implementer to ensure their SQL scripts get rewritten to ensure the database is built out properly. It seems possible to use psql variables to possibly achieve this but it seems like it would probably need to be done with some sort of shell script.
Different DOTs (WYDOT in this case) will have requirements to deploy this system within an existing pg schema. If we have a better way of doing that we can definitely dive into it? |
PR Details
Description
This PR modifies the cv-manager API to use a configurable database schema name instead of "public". By default the database schema used will still be "public", however, this allows a user to specify a different name if necessary. This issue arose during the WyoCV deployment of the cv-manager.
How Has This Been Tested?
These changes have been tested locally using docker compose. Additionally, all unit tests were verified to pass.
Types of changes
Checklist: