code: func migrate(goal, currpath, driver, connStr, dir string) {
  	if dir == "" {
  		dir = path.Join(currpath, "database", "migrations")
  	}
  	postfix := ""
  	if runtime.GOOS == "windows" {
  		postfix = ".exe"
  	}
  	binary := "m" + postfix
  	source := binary + ".go"
  
  	// Connect to database
  	db, err := sql.Open(driver, connStr)
  	if err != nil {
  		beeLogger.Log.Fatalf("Could not connect to database using '%s': %s", connStr, err)
  	}
  	defer db.Close()
  
  	checkForSchemaUpdateTable(db, driver)
  	latestName, latestTime := getLatestMigration(db, goal)
  	writeMigrationSourceFile(dir, source, driver, connStr, latestTime, latestName, goal)
  	buildMigrationBinary(dir, binary)
  	runMigrationBinary(dir, binary)
  	removeTempFile(dir, source)
  	removeTempFile(dir, binary)
  }
docs: // migrate generates source code, build it, and invoke the binary who does the actual migration