You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
534 B

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. package main
  2. import (
  3. "git.aiterp.net/lucifer/new-server/app/config"
  4. "github.com/pressly/goose"
  5. "log"
  6. "time"
  7. )
  8. func main() {
  9. db := config.DBX().DB
  10. log.Printf("Target version: %s",time.Now().Format("20060102150405"))
  11. log.Printf("Database: %s:%d/%s", config.MySqlHost(), config.MySqlPort(), config.MySqlSchema())
  12. log.Printf("Authenticating as: %s", config.MySqlUsername())
  13. err := goose.SetDialect("mysql")
  14. if err != nil {
  15. log.Fatal(err)
  16. }
  17. err = goose.Run("up", db, "./scripts")
  18. if err != nil {
  19. log.Fatal(err)
  20. }
  21. }