Skip to content

Allow changing db schema from public #4873

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

Merged
merged 3 commits into from
Nov 4, 2022

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Nov 3, 2022

Fixes: #4747

This PR removes hard-coded references to the public schema, which prevents users from predefining their own schemas. As the application depends on the connection string, I suppose that it doesn't need an extra ENV var (like DB_SEARCH_STRING in https://github.com/coder/v1/pull/13216) to provide the search_path.

@github-actions
Copy link

github-actions bot commented Nov 3, 2022

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@mtojek
Copy link
Member Author

mtojek commented Nov 3, 2022

I have read the CLA Document and I hereby sign the CLA

@mtojek
Copy link
Member Author

mtojek commented Nov 3, 2022

recheck

1 similar comment
@mtojek
Copy link
Member Author

mtojek commented Nov 3, 2022

recheck

@mtojek
Copy link
Member Author

mtojek commented Nov 3, 2022

Hey @mafredri! Could you please take a look at this draft PR to check if I don't miss anything?

@mafredri
Copy link
Member

mafredri commented Nov 3, 2022

There seems to be one more case of public. left in dump.sql:

coderd/database/dump.sql
215:ALTER SEQUENCE licenses_id_seq OWNED BY public.licenses.id;
463:ALTER TABLE ONLY licenses ALTER COLUMN id SET DEFAULT nextval('public.licenses_id_seq'::regclass);

But other than that, looks great!

If you want to take a stab at documenting how to use this feature, there's an issue (that got closed by stale bot) to improve the documentation for setting up PostgreSQL: #3508

@mtojek
Copy link
Member Author

mtojek commented Nov 3, 2022

There seems to be one more case of public. left in dump.sql:

Good catch, @mafredri!

If you want to take a stab at documenting how to use this feature, there's an issue (that got closed by stale bot) to improve the documentation for setting up PostgreSQL: #3508

Absolutely, I can take a look at it later and document that part.

@mtojek mtojek marked this pull request as ready for review November 3, 2022 19:12
@mtojek mtojek self-assigned this Nov 3, 2022
@mtojek mtojek requested a review from mafredri November 3, 2022 19:15
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

Nice, looks good to me!

Copy link
Contributor

@coadler coadler left a comment

Choose a reason for hiding this comment

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

🎉

@mtojek mtojek merged commit 3f6c448 into coder:main Nov 4, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Nov 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow changing db schema from public
3 participants