[PR #3348] [CLOSED] feat(model): support postgres schema. #16901

Closed
opened 2025-11-02 12:21:44 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/3348
Author: @appleboy
Created: 1/11/2018
Status: Closed

Base: masterHead: pg


📝 Commits (9)

📊 Changes

59 files changed (+1579 additions, -1109 deletions)

View changed files

📝 custom/conf/app.ini.sample (+2 -0)
📝 models/attachment.go (+1 -1)
📝 models/issue.go (+3 -3)
📝 models/issue_comment.go (+6 -6)
📝 models/issue_list.go (+1 -1)
📝 models/issue_milestone.go (+2 -2)
📝 models/issue_user.go (+1 -1)
📝 models/issue_watch.go (+1 -1)
📝 models/models.go (+42 -2)
📝 models/org.go (+4 -4)
📝 models/repo.go (+22 -22)
📝 models/repo_collaboration.go (+1 -1)
📝 models/repo_mirror.go (+1 -1)
📝 models/repo_watch.go (+4 -3)
📝 models/star.go (+5 -5)
📝 models/user_follow.go (+4 -4)
📝 models/user_openid.go (+1 -1)
📝 vendor/github.com/go-xorm/builder/README.md (+2 -1)
📝 vendor/github.com/go-xorm/builder/builder_insert.go (+4 -2)
📝 vendor/github.com/go-xorm/builder/circle.yml (+3 -1)

...and 39 more files

📄 Description

fix https://github.com/go-gitea/gitea/issues/2755

create new database and start the gitea.

e_base", "has_merged", "merged_commit_id", "merger_id", "merged_unix" FROM "pull_request" WHERE status = $1 []interface {}{1}
2018/01/11 15:10:55 [.../runtime/asm_amd64.s:2337 goexit()] [E] ArchiveClean: pq: relation "repository" does not exist
2018/01/11 15:10:55 [.../runtime/asm_amd64.s:2337 goexit()] [E] DeletedBranchesCleanup: pq: relation "deleted_branch" does not exist
2018/01/11 15:10:55 [I] [SQL] SELECT repo.id FROM "repository" repo WHERE repo.num_stars!=(SELECT COUNT(*) FROM "star" WHERE repo_id=repo.id)
2018/01/11 15:10:55 [I] [SQL] SELECT label.id FROM "label" WHERE label.num_issues!=(SELECT COUNT(*) FROM "issue_label" WHERE label_id=label.id)
2018/01/11 15:10:55 [...gitea/models/repo.go:2259 CheckRepoStats()] [E] Select repository count 'num_stars': pq: relation "repository" does not exist
2018/01/11 15:10:55 [.../runtime/asm_amd64.s:2337 goexit()] [E] DeliverHooks: pq: relation "hook_task" does not exist
2018/01/11 15:10:55 [I] [SQL] SELECT "user".id FROM "user" WHERE "user".num_repos!=(SELECT COUNT(*) FROM "repository" WHERE owner_id="user".id)
2018/01/11 15:10:55 [...gitea/models/repo.go:2259 CheckRepoStats()] [E] Select label count 'num_issues': pq: relation "label" does not exist
2018/01/11 15:10:55 [...gitea/models/repo.go:2259 CheckRepoStats()] [E] Select user count 'num_repos': pq: relation "user" does not exist
2018/01/11 15:10:55 [I] [SQL] SELECT "issue".id FROM "issue" WHERE "issue".num_comments!=(SELECT COUNT(*) FROM "comment" WHERE issue_id="issue".id AND type=0)
2018/01/11 15:10:55 [I] [SQL] SELECT repo.id FROM "repository" repo WHERE repo.num_closed_issues!=(SELECT COUNT(*) FROM "issue" WHERE repo_id=repo.id AND is_closed=$1AND is_pull=$2) []interface {}{true, false}
2018/01/11 15:10:55 [...gitea/models/repo.go:2259 CheckRepoStats()] [E] Select issue count 'num_comments': pq: relation "issue" does not exist
2018/01/11 15:10:55 [.../runtime/asm_amd64.s:2337 goexit()] [E] Select repository count 'num_closed_issues': pq: relation "repository" does not exist
2018/01/11 15:10:55 [I] [SQL] SELECT repo.id FROM "repository" repo WHERE repo.num_forks!=(SELECT COUNT(*) FROM "repository" WHERE fork_id=repo.id)
2018/01/11 15:10:55 [.../runtime/asm_amd64.s:2337 goexit()] [E] Select repository count 'num_forks': pq: relation "repository" does not exist
2018/01/11 15:10:55 [...gitea/models/pull.go:1161 TestPullRequests()] [E] Find Checking PRs%!(EXTRA *pq.Error=pq: relation "pull_request" does not exist)
2018/01/11 15:10:55 Serving [::]:3000 with pid 24634
2018/01/11 15:10:55 [I] Listen: http://0.0.0.0:3000

need @lunny help but it is working for public schema.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/3348 **Author:** [@appleboy](https://github.com/appleboy) **Created:** 1/11/2018 **Status:** ❌ Closed **Base:** `master` ← **Head:** `pg` --- ### 📝 Commits (9) - [`892bd9d`](https://github.com/go-gitea/gitea/commit/892bd9d34e1ec0bc653bf27ccbdd58c17ca1c12d) feat(model): support postgres schema. - [`40ea7bf`](https://github.com/go-gitea/gitea/commit/40ea7bf17964eb1a9fe6218869e5deee63f7cdbd) feat: upgrade to latest version of xorm - [`7a581e7`](https://github.com/go-gitea/gitea/commit/7a581e7d865a5cb17effd07df61a7518d391e8d8) feat: support schema query in pg. - [`874552b`](https://github.com/go-gitea/gitea/commit/874552b93305f14fc70878cc4766f9ffa4377a59) fix typo - [`e2af2bd`](https://github.com/go-gitea/gitea/commit/e2af2bd7ef9e12ad7f78a07a25da5cb8a66a96f6) feat: upgrade xorm - [`66af96b`](https://github.com/go-gitea/gitea/commit/66af96bd8ffa764d579841e4499d71d088dd8f0a) update - [`e8ace49`](https://github.com/go-gitea/gitea/commit/e8ace492f54891bd15f00a83bc1e4700cc26bd9e) update - [`a3e6f87`](https://github.com/go-gitea/gitea/commit/a3e6f8783e67376343be340c61c05a5ef7d29ac9) update - [`9a46778`](https://github.com/go-gitea/gitea/commit/9a46778117ee66971253b51903f2da68d64603ba) update ### 📊 Changes **59 files changed** (+1579 additions, -1109 deletions) <details> <summary>View changed files</summary> 📝 `custom/conf/app.ini.sample` (+2 -0) 📝 `models/attachment.go` (+1 -1) 📝 `models/issue.go` (+3 -3) 📝 `models/issue_comment.go` (+6 -6) 📝 `models/issue_list.go` (+1 -1) 📝 `models/issue_milestone.go` (+2 -2) 📝 `models/issue_user.go` (+1 -1) 📝 `models/issue_watch.go` (+1 -1) 📝 `models/models.go` (+42 -2) 📝 `models/org.go` (+4 -4) 📝 `models/repo.go` (+22 -22) 📝 `models/repo_collaboration.go` (+1 -1) 📝 `models/repo_mirror.go` (+1 -1) 📝 `models/repo_watch.go` (+4 -3) 📝 `models/star.go` (+5 -5) 📝 `models/user_follow.go` (+4 -4) 📝 `models/user_openid.go` (+1 -1) 📝 `vendor/github.com/go-xorm/builder/README.md` (+2 -1) 📝 `vendor/github.com/go-xorm/builder/builder_insert.go` (+4 -2) 📝 `vendor/github.com/go-xorm/builder/circle.yml` (+3 -1) _...and 39 more files_ </details> ### 📄 Description fix https://github.com/go-gitea/gitea/issues/2755 create new database and start the gitea. ``` e_base", "has_merged", "merged_commit_id", "merger_id", "merged_unix" FROM "pull_request" WHERE status = $1 []interface {}{1} 2018/01/11 15:10:55 [.../runtime/asm_amd64.s:2337 goexit()] [E] ArchiveClean: pq: relation "repository" does not exist 2018/01/11 15:10:55 [.../runtime/asm_amd64.s:2337 goexit()] [E] DeletedBranchesCleanup: pq: relation "deleted_branch" does not exist 2018/01/11 15:10:55 [I] [SQL] SELECT repo.id FROM "repository" repo WHERE repo.num_stars!=(SELECT COUNT(*) FROM "star" WHERE repo_id=repo.id) 2018/01/11 15:10:55 [I] [SQL] SELECT label.id FROM "label" WHERE label.num_issues!=(SELECT COUNT(*) FROM "issue_label" WHERE label_id=label.id) 2018/01/11 15:10:55 [...gitea/models/repo.go:2259 CheckRepoStats()] [E] Select repository count 'num_stars': pq: relation "repository" does not exist 2018/01/11 15:10:55 [.../runtime/asm_amd64.s:2337 goexit()] [E] DeliverHooks: pq: relation "hook_task" does not exist 2018/01/11 15:10:55 [I] [SQL] SELECT "user".id FROM "user" WHERE "user".num_repos!=(SELECT COUNT(*) FROM "repository" WHERE owner_id="user".id) 2018/01/11 15:10:55 [...gitea/models/repo.go:2259 CheckRepoStats()] [E] Select label count 'num_issues': pq: relation "label" does not exist 2018/01/11 15:10:55 [...gitea/models/repo.go:2259 CheckRepoStats()] [E] Select user count 'num_repos': pq: relation "user" does not exist 2018/01/11 15:10:55 [I] [SQL] SELECT "issue".id FROM "issue" WHERE "issue".num_comments!=(SELECT COUNT(*) FROM "comment" WHERE issue_id="issue".id AND type=0) 2018/01/11 15:10:55 [I] [SQL] SELECT repo.id FROM "repository" repo WHERE repo.num_closed_issues!=(SELECT COUNT(*) FROM "issue" WHERE repo_id=repo.id AND is_closed=$1AND is_pull=$2) []interface {}{true, false} 2018/01/11 15:10:55 [...gitea/models/repo.go:2259 CheckRepoStats()] [E] Select issue count 'num_comments': pq: relation "issue" does not exist 2018/01/11 15:10:55 [.../runtime/asm_amd64.s:2337 goexit()] [E] Select repository count 'num_closed_issues': pq: relation "repository" does not exist 2018/01/11 15:10:55 [I] [SQL] SELECT repo.id FROM "repository" repo WHERE repo.num_forks!=(SELECT COUNT(*) FROM "repository" WHERE fork_id=repo.id) 2018/01/11 15:10:55 [.../runtime/asm_amd64.s:2337 goexit()] [E] Select repository count 'num_forks': pq: relation "repository" does not exist 2018/01/11 15:10:55 [...gitea/models/pull.go:1161 TestPullRequests()] [E] Find Checking PRs%!(EXTRA *pq.Error=pq: relation "pull_request" does not exist) 2018/01/11 15:10:55 Serving [::]:3000 with pid 24634 2018/01/11 15:10:55 [I] Listen: http://0.0.0.0:3000 ``` need @lunny help but it is working for `public` schema. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:21:44 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#16901