summaryrefslogtreecommitdiffstats
path: root/models/migrations
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-03-01 01:47:30 +0100
committerGitHub <noreply@github.com>2021-03-01 01:47:30 +0100
commita4148c0f12fe5a93d2c9a40f24d4813bcfef4ff8 (patch)
tree92edf61ff2447e067a676832844a129050b4ec0f /models/migrations
parente0900310c4354311362ef69d15c302c215eaa2a2 (diff)
downloadgitea-a4148c0f12fe5a93d2c9a40f24d4813bcfef4ff8.tar.gz
gitea-a4148c0f12fe5a93d2c9a40f24d4813bcfef4ff8.zip
Repository transfer has to be confirmed, if user can not create repo for new owner (#14792)
* make repo as "pending transfer" if on transfer start doer has no right to create repo in new destination * if new pending transfer ocured, create UI & Mail notifications
Diffstat (limited to 'models/migrations')
-rw-r--r--models/migrations/migrations.go2
-rw-r--r--models/migrations/v174.go23
2 files changed, 25 insertions, 0 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go
index 4fc737e1bf..27c159ee4a 100644
--- a/models/migrations/migrations.go
+++ b/models/migrations/migrations.go
@@ -294,6 +294,8 @@ var migrations = []Migration{
NewMigration("Add sessions table for go-chi/session", addSessionTable),
// v173 -> v174
NewMigration("Add time_id column to Comment", addTimeIDCommentColumn),
+ // v174 -> v175
+ NewMigration("create repo transfer table", addRepoTransfer),
}
// GetCurrentDBVersion returns the current db version
diff --git a/models/migrations/v174.go b/models/migrations/v174.go
new file mode 100644
index 0000000000..ce337df2b3
--- /dev/null
+++ b/models/migrations/v174.go
@@ -0,0 +1,23 @@
+// 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 addRepoTransfer(x *xorm.Engine) error {
+ type RepoTransfer struct {
+ ID int64 `xorm:"pk autoincr"`
+ DoerID int64
+ RecipientID int64
+ RepoID int64
+ TeamIDs []int64
+ CreatedUnix int64 `xorm:"INDEX NOT NULL created"`
+ UpdatedUnix int64 `xorm:"INDEX NOT NULL updated"`
+ }
+
+ return x.Sync(new(RepoTransfer))
+}