summaryrefslogtreecommitdiffstats
path: root/models/migrations/v14.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-08-26 14:07:21 -0700
committerUnknwon <u@gogs.io>2016-08-26 14:07:21 -0700
commitbb359a74f124c759a8de1afbf224b658b57760b7 (patch)
treea2bf45fa59e7c5079762996e43155692af2d82ce /models/migrations/v14.go
parent6b98d58906e4df063a2af59f97bd74c1c4cc1c84 (diff)
downloadgitea-bb359a74f124c759a8de1afbf224b658b57760b7.tar.gz
gitea-bb359a74f124c759a8de1afbf224b658b57760b7.zip
migrations: set comment updated as created
Diffstat (limited to 'models/migrations/v14.go')
-rw-r--r--models/migrations/v14.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/models/migrations/v14.go b/models/migrations/v14.go
new file mode 100644
index 0000000000..16c497e7e2
--- /dev/null
+++ b/models/migrations/v14.go
@@ -0,0 +1,18 @@
+// Copyright 2016 The Gogs 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"
+
+ "github.com/go-xorm/xorm"
+)
+
+func setCommentUpdatedWithCreated(x *xorm.Engine) error {
+ if _, err := x.Exec("UPDATE comment SET updated_unix = created_unix"); err != nil {
+ return fmt.Errorf("set update_unix: %v", err)
+ }
+ return nil
+}