Beispiel #1
0
func clearDatabase() {
	for k, v := range db.Tables {
		db.Exec(fmt.Sprintf("DROP TABLE IF EXISTS %s CASCADE;", v), nil)
		db.Exec(fmt.Sprintf("DROP SEQUENCE IF EXISTS %s_id_seq;", v), nil)
		db.QueryCreateTable(base.GetModel(db.Tables[k]))
	}
}
Beispiel #2
0
func (this *IndexController) Init(runTest bool) {
	for k, v := range db.Tables {
		db.Exec(fmt.Sprintf("DROP TABLE IF EXISTS %s CASCADE;", v), nil)
		db.Exec(fmt.Sprintf("DROP SEQUENCE IF EXISTS %s_id_seq;", v), nil)
		db.QueryCreateTable(this.GetModel(db.Tables[k]))
	}

	this.CreateRegistrationEvent()
}