aboutsummaryrefslogtreecommitdiffstats
path: root/models/migrations/v1_22
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-03-06 14:26:32 +0800
committerGitHub <noreply@github.com>2024-03-06 14:26:32 +0800
commit5cddab4f74bbb307ddf13e458c7ac22f93b9283a (patch)
tree2eee924ffdbc2e1bedb6b63020e7b7fdd86417c3 /models/migrations/v1_22
parentda15d6127c8d430dfc069f9815ce783dd9ca35f7 (diff)
downloadgitea-5cddab4f74bbb307ddf13e458c7ac22f93b9283a.tar.gz
gitea-5cddab4f74bbb307ddf13e458c7ac22f93b9283a.zip
Make wiki default branch name changable (#29603)
Fix #29000 Fix #28685 Fix #18568 Related: #27497 And by the way fix #24036, add a Cancel button there (one line)
Diffstat (limited to 'models/migrations/v1_22')
-rw-r--r--models/migrations/v1_22/v289.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/models/migrations/v1_22/v289.go b/models/migrations/v1_22/v289.go
new file mode 100644
index 0000000000..e2dfc48715
--- /dev/null
+++ b/models/migrations/v1_22/v289.go
@@ -0,0 +1,18 @@
+// Copyright 2024 The Gitea Authors. All rights reserved.
+// SPDX-License-Identifier: MIT
+
+package v1_22 //nolint
+
+import "xorm.io/xorm"
+
+func AddDefaultWikiBranch(x *xorm.Engine) error {
+ type Repository struct {
+ ID int64
+ DefaultWikiBranch string
+ }
+ if err := x.Sync(&Repository{}); err != nil {
+ return err
+ }
+ _, err := x.Exec("UPDATE `repository` SET default_wiki_branch = 'master' WHERE (default_wiki_branch IS NULL) OR (default_wiki_branch = '')")
+ return err
+}