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

Add postgres schema to the search_path on database connection #12634

Merged
merged 8 commits into from
Sep 11, 2020

Conversation

zeripath
Copy link
Contributor

Rather than rely on the user running the gitea server and db setting the
schema search_path correctly - if Gitea is run with a schema we should
simply set the search_path to have that schema first in the path.

Fix #12505

Signed-off-by: Andrew Thornton art27@cantab.net

@zeripath zeripath added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Aug 29, 2020
@zeripath zeripath added this to the 1.13.0 milestone Aug 29, 2020
Rather than rely on the user running the gitea server and db setting the
schema search_path correctly - if gitea is run with a schema we should
simply set the search_path to have that schema first in the path.

Fix go-gitea#12505

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath force-pushed the fix-12505-set-schema-search-path branch from e1e2cb9 to 1e75afc Compare August 29, 2020 11:59
Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
@codecov-commenter
Copy link

codecov-commenter commented Aug 29, 2020

Codecov Report

Merging #12634 into master will decrease coverage by 0.04%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12634      +/-   ##
==========================================
- Coverage   43.19%   43.15%   -0.05%     
==========================================
  Files         651      651              
  Lines       72138    72145       +7     
==========================================
- Hits        31163    31136      -27     
- Misses      35928    35955      +27     
- Partials     5047     5054       +7     
Impacted Files Coverage Δ
models/models.go 55.94% <0.00%> (-2.01%) ⬇️
modules/indexer/stats/queue.go 64.70% <0.00%> (-11.77%) ⬇️
modules/indexer/stats/db.go 43.47% <0.00%> (-8.70%) ⬇️
services/pull/check.go 47.69% <0.00%> (-6.16%) ⬇️
services/pull/temp_repo.go 26.59% <0.00%> (-3.20%) ⬇️
modules/log/event.go 56.60% <0.00%> (-2.84%) ⬇️
services/pull/patch.go 66.37% <0.00%> (-2.59%) ⬇️
modules/git/command.go 88.34% <0.00%> (-1.95%) ⬇️
modules/queue/workerpool.go 58.77% <0.00%> (-1.23%) ⬇️
models/unit.go 49.31% <0.00%> (+2.73%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 25c870f...e3581ef. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 29, 2020
Copy link
Member

@silverwind silverwind left a comment

Choose a reason for hiding this comment

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

Maybe it'd be wise to quote the schema name in case it contains uppercase characters, but other than that lgtm.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Sep 8, 2020
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Sep 10, 2020
@lafriks
Copy link
Member

lafriks commented Sep 10, 2020

🚀

@zeripath zeripath merged commit e0ac545 into go-gitea:master Sep 11, 2020
@zeripath zeripath added type/enhancement An improvement of existing functionality and removed type/feature Completely new functionality. Can only be merged if feature freeze is not active. labels Oct 14, 2020
@zeripath zeripath deleted the fix-12505-set-schema-search-path branch November 13, 2020 18:13
@zeripath zeripath mentioned this pull request Nov 13, 2020
5 tasks
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Postgres schema support
6 participants