예제 #1
0
파일: tools.go 프로젝트: DeyV/planet
func RegSchema(dbmap *gorp.DbMap) {
	dbmap.AddTable(Entry{}).SetKeys(true, "Id")

	err := dbmap.CreateTables()
	if err != nil {
		fmt.Println(err)
		return
	}
}
예제 #2
0
파일: schema.go 프로젝트: DeyV/planet
func RegSchema(dbmap *gorp.DbMap) {
	dbmap.AddTable(Category{}).SetKeys(true, "Id")
	dbmap.AddTable(EntryInCategory{}).SetKeys(true, "Id")

	dbmap.CreateTables()
}