コード例 #1
0
ファイル: _runner.go プロジェクト: DimShadoWWW/hood
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{})
}
コード例 #3
0
func (m *M) CreateContactTable_1445047176_Up(hd *hood.Hood) {
	hd.CreateTable(&api.Contact{})
}
コード例 #4
0
func (m *M) CreateContactTable_1445047176_Down(hd *hood.Hood) {
	hd.DropTable(&api.Contact{})
}
コード例 #5
0
func (m *M) CreateTagsTable_1445047167_Up(hd *hood.Hood) {
	hd.CreateTable(&api.Tag{})
}
コード例 #6
0
func (m *M) CreateTagsTable_1445047167_Down(hd *hood.Hood) {
	hd.DropTableIfExists(&api.Tag{})
}