From bb393596689ee7c33ecb041806ae2c9e8dc5dfab Mon Sep 17 00:00:00 2001 From: a1012112796 <1012112796@qq.com> Date: Sat, 9 Oct 2021 01:03:04 +0800 Subject: Add a simple way to rename branch like gh (#15870) - Update default branch if needed - Update protected branch if needed - Update all not merged pull request base branch name - Rename git branch - Record this rename work and auto redirect for old branch on ui Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: delvh --- models/migrations/v197.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 models/migrations/v197.go (limited to 'models/migrations/v197.go') diff --git a/models/migrations/v197.go b/models/migrations/v197.go new file mode 100644 index 0000000000..3517896a23 --- /dev/null +++ b/models/migrations/v197.go @@ -0,0 +1,20 @@ +// Copyright 2021 The Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package migrations + +import ( + "xorm.io/xorm" +) + +func addRenamedBranchTable(x *xorm.Engine) error { + type RenamedBranch struct { + ID int64 `xorm:"pk autoincr"` + RepoID int64 `xorm:"INDEX NOT NULL"` + From string + To string + CreatedUnix int64 `xorm:"created"` + } + return x.Sync2(new(RenamedBranch)) +} -- cgit v1.2.3