This commit is contained in:
@@ -7,12 +7,11 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modules/setting"
|
||||
)
|
||||
|
||||
func AddIssueDependencies(x *xorm.Engine) (err error) {
|
||||
func AddIssueDependencies(x db.EngineMigration) (err error) {
|
||||
type IssueDependency struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
UserID int64 `xorm:"NOT NULL"`
|
||||
|
||||
@@ -6,14 +6,13 @@ package v1_6
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"code.gitea.io/gitea/models/migrations/base"
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/models/migrations/base"
|
||||
"gitea.dev/modules/timeutil"
|
||||
"gitea.dev/modules/util"
|
||||
)
|
||||
|
||||
func AddScratchHash(x *xorm.Engine) error {
|
||||
func AddScratchHash(x db.EngineMigration) error {
|
||||
// TwoFactor see models/twofactor.go
|
||||
type TwoFactor struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
@@ -51,10 +50,7 @@ func AddScratchHash(x *xorm.Engine) error {
|
||||
|
||||
for _, tfa := range tfas {
|
||||
// generate salt
|
||||
salt, err := util.CryptoRandomString(10)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
salt := util.CryptoRandomString(10)
|
||||
tfa.ScratchSalt = salt
|
||||
tfa.ScratchHash = base.HashToken(tfa.ScratchToken, salt)
|
||||
|
||||
|
||||
@@ -6,12 +6,11 @@ package v1_6
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modules/timeutil"
|
||||
)
|
||||
|
||||
func AddReview(x *xorm.Engine) error {
|
||||
func AddReview(x db.EngineMigration) error {
|
||||
// Review see models/review.go
|
||||
type Review struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
|
||||
Reference in New Issue
Block a user