Fix model update and print statement in migrate command
This commit is contained in:
parent
baab49be52
commit
bba0119a95
1 changed files with 1 additions and 2 deletions
|
|
@ -44,13 +44,12 @@ var migrateCmd = &cobra.Command{
|
||||||
|
|
||||||
if name != "" {
|
if name != "" {
|
||||||
mod, has := model.Models[name]
|
mod, has := model.Models[name]
|
||||||
fmt.Printf(color.WhiteString(L("Update schema model: %s (%s) "), mod.Name, mod.MetaData.Table.Name) + "\t")
|
|
||||||
|
|
||||||
if !has {
|
if !has {
|
||||||
fmt.Println(color.RedString(L("Model: %s does not exits"), name))
|
fmt.Println(color.RedString(L("Model: %s does not exits"), name))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Printf(color.WhiteString(L("Update schema model: %s (%s) "), mod.Name, mod.MetaData.Table.Name) + "\t")
|
||||||
if resetModel {
|
if resetModel {
|
||||||
err := mod.DropTable()
|
err := mod.DropTable()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue