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

Fix postgres db custom schema option not working #6708

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bergerkiller
Copy link

@bergerkiller bergerkiller commented Sep 7, 2023

We encountered an issue when trying to configure a postgres DB schema, which was needed for integration with supabase. This was caused by knex migration scripts not having this same schema configured, and this custom schema not being created at startup.

This PR fixes both issues and allows for a successful startup and initialization of the wiki server.

I did notice that this option, while it exists in the code, isn't documented in the docs. It is set by using a config.yml with db.schema set, and I don't think it has an env parsing default. This might be something worth improving in the future.

Signed-off-by: Irmo van den Berge <i.vdberge@valtes.nl>
@bergerkiller
Copy link
Author

Added a change to only create the custom schema if it doesn't already exist. CREATE IF NOT EXISTS does not work by itself because the user requires CREATE permission on the database for it to work. When granting limited priviliges to the wiki database user this is undesirable.

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.

None yet

2 participants