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
886bb782
authored
2014-08-14 11:44:10 +0800
by
astaxie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
sort the reset
1 parent
d2119f71
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
migration/migration.go
migration/migration.go
View file @
886bb78
...
...
@@ -174,22 +174,24 @@ func Rollback(name string) error {
// reset all migration
// run all migration's down function
func
Reset
()
error
{
sm
:=
sortMap
(
migrationMap
)
i
:=
0
for
k
,
v
:=
range
migrationMap
{
if
isRollBack
(
k
)
{
beego
.
Info
(
"skip the"
,
k
)
for
_
,
v
:=
range
sm
{
if
isRollBack
(
v
.
name
)
{
beego
.
Info
(
"skip the"
,
v
.
name
)
time
.
Sleep
(
1
*
time
.
Second
)
continue
}
beego
.
Info
(
"start reset:"
,
k
)
v
.
Down
()
err
:=
v
.
Exec
(
k
,
"down"
)
beego
.
Info
(
"start reset:"
,
v
.
name
)
v
.
m
.
Down
()
err
:=
v
.
m
.
Exec
(
v
.
name
,
"down"
)
if
err
!=
nil
{
beego
.
Error
(
"execute error:"
,
err
)
time
.
Sleep
(
2
*
time
.
Second
)
return
err
}
beego
.
Info
(
"end reset:"
,
k
)
i
++
beego
.
Info
(
"end reset:"
,
v
.
name
)
}
beego
.
Info
(
"total success reset:"
,
i
,
" migration"
)
time
.
Sleep
(
2
*
time
.
Second
)
...
...
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