Skip to content

Instantly share code, notes, and snippets.

@thuongdinh-agilityio
Created October 7, 2015 06:55
Show Gist options
  • Save thuongdinh-agilityio/ccb0e11b1b3f1b9ad669 to your computer and use it in GitHub Desktop.
Save thuongdinh-agilityio/ccb0e11b1b3f1b9ad669 to your computer and use it in GitHub Desktop.
beego_orm_syncdb
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