sqlc: fixed migration import package error

r/paopao-ce-pro
Michael Li 2 years ago
parent 7c8849ee54
commit bac261acda
No known key found for this signature in database

@ -1,5 +0,0 @@
// Copyright 2023 ROC. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package main

@ -5,11 +5,11 @@
//go:build migration
// +build migration
package main
package slonik
import (
"embed"
)
//go:embed postgres/schema
//go:embed ce/postgres/schema
var Files embed.FS

@ -19,7 +19,7 @@ import (
"github.com/golang-migrate/migrate/v4/source"
"github.com/golang-migrate/migrate/v4/source/iofs"
"github.com/rocboss/paopao-ce/internal/conf"
"github.com/rocboss/paopao-ce/internal/dao/slonik/ce"
"github.com/rocboss/paopao-ce/internal/dao/slonik"
"github.com/rocboss/paopao-ce/scripts/migration"
"github.com/sirupsen/logrus"
)
@ -72,7 +72,7 @@ func Run() {
}
} else if cfg.If("Sqlc") {
if cfg.If("PostgreSQL") || cfg.If("Postgres") {
srcDriver, err = iofs.New(ce.Files, "postgres/schema")
srcDriver, err = iofs.New(slonik.Files, "ce/postgres/schema")
dbDriver, err2 = postgres.WithInstance(db, &postgres.Config{MigrationsTable: migrationsTable})
}
}

Loading…
Cancel
Save