mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-22 12:43:39 +09:00
refactor(modelmigration): thread context through migration functions (#38758)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
package v1_6
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
@@ -11,7 +12,7 @@ import (
|
||||
"gitea.dev/modules/setting"
|
||||
)
|
||||
|
||||
func AddIssueDependencies(x base.EngineMigration) (err error) {
|
||||
func AddIssueDependencies(_ context.Context, x base.EngineMigration) (err error) {
|
||||
type IssueDependency struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
UserID int64 `xorm:"NOT NULL"`
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
package v1_6
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"gitea.dev/modelmigration/base"
|
||||
@@ -11,7 +12,7 @@ import (
|
||||
"gitea.dev/modules/util"
|
||||
)
|
||||
|
||||
func AddScratchHash(x base.EngineMigration) error {
|
||||
func AddScratchHash(_ context.Context, x base.EngineMigration) error {
|
||||
// TwoFactor see models/twofactor.go
|
||||
type TwoFactor struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
|
||||
@@ -4,13 +4,14 @@
|
||||
package v1_6
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"gitea.dev/modelmigration/base"
|
||||
"gitea.dev/modules/timeutil"
|
||||
)
|
||||
|
||||
func AddReview(x base.EngineMigration) error {
|
||||
func AddReview(_ context.Context, x base.EngineMigration) error {
|
||||
// Review see models/review.go
|
||||
type Review struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
|
||||
Reference in New Issue
Block a user