mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-22 13:25:36 +03:00
85202d4784
* display ui time with customize time location * fix lint * rename UILocation to DefaultUILocation * move time related functions to modules/timeutil * fix tests * fix tests * fix build * fix swagger
30 lines
655 B
Go
30 lines
655 B
Go
// Copyright 2017 The Gitea Authors. All rights reserved.
|
|
// Use of this source code is governed by a MIT-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package migrations
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"code.gitea.io/gitea/modules/timeutil"
|
|
|
|
"github.com/go-xorm/xorm"
|
|
)
|
|
|
|
func addIssueClosedTime(x *xorm.Engine) error {
|
|
// Issue see models/issue.go
|
|
type Issue struct {
|
|
ClosedUnix timeutil.TimeStamp `xorm:"INDEX"`
|
|
}
|
|
|
|
if err := x.Sync2(new(Issue)); err != nil {
|
|
return fmt.Errorf("Sync2: %v", err)
|
|
}
|
|
|
|
if _, err := x.Exec("UPDATE `issue` SET `closed_unix` = `updated_unix` WHERE `is_closed` = ?", true); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|