Fill the value with the current time

pull/3120/head
Luke Morris 2018-04-03 22:45:52 -07:00
parent d76a937e09
commit 3b0e43ba49
1 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,8 @@
package bolt package bolt
import ( import (
"time"
"github.com/boltdb/bolt" "github.com/boltdb/bolt"
) )
@ -26,7 +28,8 @@ func IsMigrationComplete(db *bolt.DB, id string) (bool, error) {
// MarkMigrationAsComplete adds the migration id to the schema bucket // MarkMigrationAsComplete adds the migration id to the schema bucket
func MarkMigrationAsComplete(db *bolt.DB, id string) error { func MarkMigrationAsComplete(db *bolt.DB, id string) error {
if err := db.Update(func(tx *bolt.Tx) error { if err := db.Update(func(tx *bolt.Tx) error {
return tx.Bucket(SchemaVersionBucket).Put([]byte(id), []byte{}) now := time.Now().UTC().Format(time.RFC3339)
return tx.Bucket(SchemaVersionBucket).Put([]byte(id), []byte(now))
}); err != nil { }); err != nil {
return err return err
} }