0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-05 00:49:45 +01:00
gitea/models/migrations/v1_13/v149.go

25 lines
499 B
Go
Raw Normal View History

// Copyright 2020 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package v1_13 //nolint
import (
"fmt"
"code.gitea.io/gitea/modules/timeutil"
"xorm.io/xorm"
)
func AddCreatedAndUpdatedToMilestones(x *xorm.Engine) error {
type Milestone struct {
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
}
if err := x.Sync2(new(Milestone)); err != nil {
return fmt.Errorf("Sync2: %w", err)
}
return nil
}