... so that other libraries (such as https://github.com/jinzhu/gorm) can reuse the db connection.
For example:
func Up_20160221232922(txn *sql.Tx, db *sql.DB) { gdb, _ := gorm.Open("postgres", db) gdb.CreateTable(&models.User{}) } func Down_20160221232922(txn *sql.Tx, db *sql.DB) { gdb, _ := gorm.Open("postgres", db) gdb.DropTable(&models.User{}) }
... so that other libraries (such as https://github.com/jinzhu/gorm) can reuse the db connection.
For example:
func Up_20160221232922(txn *sql.Tx, db *sql.DB) { gdb, _ := gorm.Open("postgres", db) gdb.CreateTable(&models.User{}) } func Down_20160221232922(txn *sql.Tx, db *sql.DB) { gdb, _ := gorm.Open("postgres", db) gdb.DropTable(&models.User{}) }