mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-23 00:46:30 +00:00
Fix migration number (#1134)
This commit is contained in:
parent
f15b27aadf
commit
ae771a9931
1 changed files with 3 additions and 3 deletions
|
@ -18,21 +18,21 @@ import (
|
|||
"xorm.io/xorm"
|
||||
)
|
||||
|
||||
type SecretV006 struct {
|
||||
type SecretV007 struct {
|
||||
Owner string `json:"-" xorm:"NOT NULL DEFAULT '' UNIQUE(s) INDEX 'secret_owner'"`
|
||||
RepoID int64 `json:"-" xorm:"NOT NULL DEFAULT 0 UNIQUE(s) INDEX 'secret_repo_id'"`
|
||||
Name string `json:"name" xorm:"NOT NULL UNIQUE(s) INDEX 'secret_name'"`
|
||||
}
|
||||
|
||||
// TableName return database table name for xorm
|
||||
func (SecretV006) TableName() string {
|
||||
func (SecretV007) TableName() string {
|
||||
return "secrets"
|
||||
}
|
||||
|
||||
var alterTableSecretsAddUserCol = task{
|
||||
name: "alter-table-add-secrets-user-id",
|
||||
fn: func(sess *xorm.Session) error {
|
||||
if err := sess.Sync2(new(SecretV006)); err != nil {
|
||||
if err := sess.Sync2(new(SecretV007)); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := alterColumnDefault(sess, "secrets", "secret_repo_id", "0"); err != nil {
|
Loading…
Reference in a new issue