Created
October 7, 2015 06:55
-
-
Save thuongdinh-agilityio/ccb0e11b1b3f1b9ad669 to your computer and use it in GitHub Desktop.
beego_orm_syncdb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
o := orm.NewOrm() | |
//Database alias | |
name := "default" | |
// Drop table and re-create. | |
force := true | |
// Print log. | |
verbose := true | |
err := orm.RunSyncdb(name, force, verbose) //this is to create/drops the tables | |
if err != nil { | |
beego.Info(err) | |
beego.Info("Error in SyncDB") | |
} | |
o.Using("default") // Using default, you can use other database |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment