27 lines
501 B
Go
27 lines
501 B
Go
|
package providers
|
||
|
|
||
|
import (
|
||
|
"framework_v2/internal/ent"
|
||
|
_ "github.com/lib/pq"
|
||
|
)
|
||
|
|
||
|
func providerEnt() (*ent.Client, error) {
|
||
|
var config = MustGet[GlobalConfig]()
|
||
|
return ent.Open(
|
||
|
config.DB.Driver,
|
||
|
config.DB.DSN2,
|
||
|
)
|
||
|
}
|
||
|
func init() {
|
||
|
Must(Container.Provide(providerEnt))
|
||
|
|
||
|
//
|
||
|
//if err := Ent.Schema.Create(
|
||
|
// context.Background(),
|
||
|
// migrate.WithDropIndex(true),
|
||
|
// migrate.WithDropColumn(true),
|
||
|
//); err != nil {
|
||
|
// Logger.Fatal("failed creating schema resources", zap.Error(err))
|
||
|
//}
|
||
|
}
|