diff --git a/internal/dao/slonik/ce/ce.go b/internal/dao/slonik/ce/ce.go deleted file mode 100644 index 872bf14c..00000000 --- a/internal/dao/slonik/ce/ce.go +++ /dev/null @@ -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 diff --git a/internal/dao/slonik/ce/embed.go b/internal/dao/slonik/embed.go similarity index 83% rename from internal/dao/slonik/ce/embed.go rename to internal/dao/slonik/embed.go index 426e7576..70703133 100644 --- a/internal/dao/slonik/ce/embed.go +++ b/internal/dao/slonik/embed.go @@ -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 diff --git a/internal/migration/migration_embed.go b/internal/migration/migration_embed.go index 4c0949bb..14b4c1d3 100644 --- a/internal/migration/migration_embed.go +++ b/internal/migration/migration_embed.go @@ -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}) } }