go-latestver/internal/migrate/migrate.go
Knut Ahlers 869eb4c3c5
Add migration tooling
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2023-01-14 21:22:25 +01:00

22 lines
457 B
Go

package main
import (
"github.com/pkg/errors"
"github.com/Luzifer/go-latestver/internal/database"
)
func main() {
src, err := database.NewClient("sqlite", "")
if err != nil {
panic(errors.Wrap(err, "opening src database"))
}
dest, err := database.NewClient("mysql", "")
if err != nil {
panic(errors.Wrap(err, "opening dest database"))
}
if err := src.Migrate(dest); err != nil {
panic(errors.Wrap(err, "migrating to dest database"))
}
}