forked from forgejo/forgejo
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
This commit is contained in:
parent
e0900310c4
commit
a4148c0f12
32 changed files with 898 additions and 167 deletions
|
@ -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
|
||||
|
|
23
models/migrations/v174.go
Normal file
23
models/migrations/v174.go
Normal file
|
@ -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))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue