2020-09-05 19:38:54 +02:00
|
|
|
// Copyright 2020 The Gitea Authors. All rights reserved.
|
2022-11-27 19:20:29 +01:00
|
|
|
// SPDX-License-Identifier: MIT
|
2020-09-05 19:38:54 +02:00
|
|
|
|
2022-11-02 09:54:36 +01:00
|
|
|
package v1_13 //nolint
|
2020-09-05 19:38:54 +02:00
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/timeutil"
|
|
|
|
|
|
|
|
"xorm.io/xorm"
|
|
|
|
)
|
|
|
|
|
2022-11-02 09:54:36 +01:00
|
|
|
func AddCreatedAndUpdatedToMilestones(x *xorm.Engine) error {
|
2020-09-05 19:38:54 +02:00
|
|
|
type Milestone struct {
|
|
|
|
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
|
|
|
|
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
|
|
|
|
}
|
|
|
|
|
2023-08-13 21:17:21 +02:00
|
|
|
if err := x.Sync(new(Milestone)); err != nil {
|
|
|
|
return fmt.Errorf("Sync: %w", err)
|
2020-09-05 19:38:54 +02:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|