Go: Testing database migrations with Drone CI

Since we can now list our database migrations, the next logical step is testing them out on a real database. For that we still need to implement our Run function. Based on what we have in Print(), we only need to update the migrate() function.

execQuery := func(idx int, query string, useLog bool) error { if useLog { log.Println() log.Println("-- Statement index:", idx) log.Println(query) log.Println() } if _, err := db.Exec(query); err != nil && err != sql.ErrNoRows { return...
 •  0 comments  •  flag
Share on Twitter
Published on December 08, 2019 04:00
No comments have been added yet.