mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-03 10:14:30 +00:00
91eb14c944
by the way, remove some unnecessary "models" imports from model migration package, fix migration test model init bug (modelmigration/migrationtest/tests.go)
23 lines
736 B
Go
23 lines
736 B
Go
// Copyright 2022 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package v1_17
|
|
|
|
import (
|
|
"gitea.dev/modelmigration/base"
|
|
"gitea.dev/modules/timeutil"
|
|
)
|
|
|
|
func AddReviewViewedFiles(x base.EngineMigration) error {
|
|
type ReviewState struct {
|
|
ID int64 `xorm:"pk autoincr"`
|
|
UserID int64 `xorm:"NOT NULL UNIQUE(pull_commit_user)"`
|
|
PullID int64 `xorm:"NOT NULL INDEX UNIQUE(pull_commit_user) DEFAULT 0"`
|
|
CommitSHA string `xorm:"NOT NULL VARCHAR(40) UNIQUE(pull_commit_user)"`
|
|
UpdatedFiles map[string]uint8 `xorm:"NOT NULL LONGTEXT JSON"`
|
|
UpdatedUnix timeutil.TimeStamp `xorm:"updated"`
|
|
}
|
|
|
|
return x.Sync(new(ReviewState))
|
|
}
|