示例#1
0
func apply(stamp, current int, count *int, hd *hood.Hood, info *Migrations, structVal reflect.Value, method reflect.Method) {
	log.Printf("applying %s...", method.Name)
	txn := hd.Begin()
	method.Func.Call([]reflect.Value{structVal, reflect.ValueOf(txn)})
	info.Current = current
	txn.Save(info)
	err := txn.Commit()
	if err != nil {
		panic(err)
	} else {
		*count++
	}

}
func (m *M) CreateTagsContactRelationTable_1445089666_Up(hd *hood.Hood) {
	hd.CreateTable(&api.TagContact{})
}
func (m *M) CreateContactTable_1445047176_Up(hd *hood.Hood) {
	hd.CreateTable(&api.Contact{})
}
func (m *M) CreateContactTable_1445047176_Down(hd *hood.Hood) {
	hd.DropTable(&api.Contact{})
}
func (m *M) CreateTagsTable_1445047167_Up(hd *hood.Hood) {
	hd.CreateTable(&api.Tag{})
}
func (m *M) CreateTagsTable_1445047167_Down(hd *hood.Hood) {
	hd.DropTableIfExists(&api.Tag{})
}