26 lines
469 B
Go
26 lines
469 B
Go
package providers
|
|
|
|
import (
|
|
"framework_v2/ent"
|
|
)
|
|
|
|
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))
|
|
//}
|
|
}
|