Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
efcaa3d9
authored
2014-08-13 11:16:19 +0800
by
astaxie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
update the migration database time format
1 parent
5ecfe0c3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
migration/migration.go
migration/migration.go
View file @
efcaa3d
...
...
@@ -23,7 +23,6 @@ package migration
import
(
"errors"
"sort"
"strconv"
"strings"
"time"
...
...
@@ -32,7 +31,10 @@ import (
)
// const the data format for the bee generate migration datatype
const
M_DATE_FORMAT
=
"20060102_150405"
const
(
M_DATE_FORMAT
=
"20060102_150405"
M_DB_DATE_FORMAT
=
"2006-01-02 15:04:05"
)
// Migrationer is an interface for all Migration struct
type
Migrationer
interface
{
...
...
@@ -99,7 +101,11 @@ func (m *Migration) addOrUpdateRecord(name, status string) error {
if
err
!=
nil
{
return
err
}
_
,
err
=
p
.
Exec
(
name
,
strconv
.
FormatInt
(
m
.
GetCreated
(),
10
),
strings
.
Join
(
m
.
sqls
,
"; "
),
status
)
t
,
err
:=
time
.
Parse
(
M_DB_DATE_FORMAT
,
m
.
Created
)
if
err
!=
nil
{
return
err
}
_
,
err
=
p
.
Exec
(
name
,
t
.
Format
(
M_DB_DATE_FORMAT
),
strings
.
Join
(
m
.
sqls
,
"; "
),
status
)
return
err
}
}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment