You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| ___ \
| |_/ / ___ ___
| ___ \ / _ \ / _ \
| |_/ /| __/| __/
\____/ \___| \___| v2.0.2
├── Beego : Beego is not installed. Please do consider installing it first: https://github.com/beego/beego/v2. If you are using go mod, and you don't install the beego under $GOPATH/src/github.com/astaxie, just ignore this.
├── GoVersion : go1.16.5
├── GOOS : darwin
├── GOARCH : amd64
├── NumCPU : 12
├── GOPATH : /Users/xxxx/.go
├── GOROOT : /usr/local/go
├── Compiler : gc
└── Date : Tuesday, 3 Aug 2021
What did you do?
When I execute the migrate refresh command, it rolls back, but migrate is not re-executed.
I ran the following steps:
bee generate migration create_users_table Generated and modified the migration file.
bee migrate --conn="dns"
Modify create_users_table file (add field)
bee migrate refresh --conn="dns" Run migrate again.
But the changes do not apply to the database. It will be rolled back and migrate will be skipped.
Upgrade becomes 0 as shown below.
2021/08/03 15:22:52 INFO ▶ 0013 |> 2021/08/03 15:22:48.290 [I] total success reset: 1 migration
2021/08/03 15:22:52 INFO ▶ 0014 |> 2021/08/03 15:22:50.295 [I] total success upgrade: 0 migration
What did you expect to see?
The migrate refresh command expected that the Up() method of all migration files would be executed after all migration files were rolled back.
I used MizukiMatsutani's case to test it.
After generating the test table, I modified the table build statement in m.SQL again and executed migrate refresh, the newly added fields were not synchronized to the database.
Maybe the create table part checks that the table has already been created?
Thank you for providing a great tool!
I'm using the following The Bee version.
When I execute the migrate refresh command, it rolls back, but migrate is not re-executed.
I ran the following steps:
bee generate migration create_users_table
Generated and modified the migration file.bee migrate --conn="dns"
bee migrate refresh --conn="dns"
Run migrate again.Upgrade becomes 0 as shown below.
The migrate refresh command expected that the
Up()
method of all migration files would be executed after all migration files were rolled back.I checked the following execution part generated by the refresh command.
https://github.com/beego/bee/blob/457c2f7dc885ea68f0bc97020ff5b7d178c8eaad/cmd/commands/migrate/migrate.go#L395
I expected that the implementation of
Upgrade(0)
called here was not in the expected state.beego/client/orm/migration/migration.go
Line 247 in a91aa0e
I suspect that the cause is that the argument
lasttime
is not used, but is it correct?beego/client/orm/migration/migration.go
Line 172 in a91aa0e
Is this a bug?
Is my procedure wrong? (The refresh command is supposed to be executed during local development, not in production.)
The text was updated successfully, but these errors were encountered: