Esempio n. 1
0
File: tools.go Progetto: DeyV/planet
func RegSchema(dbmap *gorp.DbMap) {
	dbmap.AddTable(Entry{}).SetKeys(true, "Id")

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

	dbmap.CreateTables()
}