Example #1
0
func (this *Config) dbConfig() {
	err := orm.RegisterDataBase("default", "mysql", this.mysql_address)
	if err != nil {
		Log.Error(err.Error())
	}

	orm.RegisterModel(new(LoginBase), new(ForBid))
	orm.RunSyncdb("default", false, true)
	O = orm.NewOrm()
}
Example #2
0
func (this *SysConfig) dbConfig() {
	// set default database
	err := orm.RegisterDataBase("default", "mysql", this.mysql_address)
	if err != nil {
		Log.Error(err.Error())
	}

	// register model
	orm.RegisterModel(new(Player_Rank))

	// create table
	orm.RunSyncdb("default", false, true)
	O = orm.NewOrm()
}