Ejemplo n.º 1
0
Archivo: tools.go Proyecto: DeyV/planet
func RegSchema(dbmap *gorp.DbMap) {
	dbmap.AddTable(Entry{}).SetKeys(true, "Id")

	err := dbmap.CreateTables()
	if err != nil {
		fmt.Println(err)
		return
	}
}
Ejemplo n.º 2
0
func RegSchema(dbmap *gorp.DbMap) {
	dbmap.AddTable(Category{}).SetKeys(true, "Id")
	dbmap.AddTable(EntryInCategory{}).SetKeys(true, "Id")

	dbmap.CreateTables()
}