This commit is contained in:
Pavel 2024-03-14 13:40:32 +03:00
parent fcebafc487
commit db1203869e

@ -6,7 +6,6 @@ import (
_ "embed"
"errors"
"github.com/golang-migrate/migrate/v4"
"github.com/golang-migrate/migrate/v4/database/postgres"
_ "github.com/golang-migrate/migrate/v4/source/gitlab"
_ "github.com/lib/pq"
"penahub.gitlab.yandexcloud.net/backend/quiz/common.git/dal/sqlcgen"
@ -97,14 +96,14 @@ func (d *DAL) Close() {
}
func (d *DAL) Init() error {
driver, err := postgres.WithInstance(d.conn, &postgres.Config{})
if err != nil {
return err
}
//driver, err := postgres.WithInstance(d.conn, &postgres.Config{})
//if err != nil {
// return err
//}
m, err := migrate.NewWithDatabaseInstance(
m, err := migrate.New(
"gitlab://Pavel@glpat-qUsfkN99NwqscZKtyCqw/@penahub.gitlab.yandexcloud.net/57/dal/schema",
"postgres", driver,
"host=localhost port=35432 user=squiz password=Redalert2 dbname=squiz sslmode=disable",
)
if err != nil {
return err