// NewDBMigrator returns a new instance of DBMigrator
NewDBMigrator returns a new instance of DBMigrator
// NewDBMigrator returns a new instance of DBMigrator
func NewDBMigrator(ctx context.Context, config api.Configuration, logger api.Logger, repository migration.IRepository, ms migration.MigrationsList) (*DBMigrator, error) {
	if config.Dialect == "" {
		config.Dialect = Dialect
	}
	if logger == nil {
		logger = log.New(os.Stdout, "sqlmigrator", log.LstdFlags)
	}
	repository.SetLogger(logger)
	domain := Domain{}
	domain.Migration.Repository	= repository
	domain.Migration.Service	= migration.NewService(domain.Migration.Repository, logger)
	err := domain.Migration.Service.CreateTable(ctx)
	if err != nil {
		return nil, api.AppErrorConv(err)
	}
	return &DBMigrator{
		ctx:    ctx,
		config: config,
		logger: logger,
		domain: domain,
		ms:		ms,
	}, nil
}
func NewDBMigrator ( ctx context . Context , config api . Configuration , logger api . Logger , repository migration . IRepository , ms migration . MigrationsList ) ( * DBMigrator , error ) { if config . Dialect == " " { config . Dialect = Dialect } if logger == nil { logger = log . New ( os . Stdout , " " , log . LstdFlags ) } repository . SetLogger ( logger ) domain := Domain { } domain . Migration . Repository = repository domain . Migration . Service = migration . NewService ( domain . Migration . Repository , logger ) err := domain . Migration . Service . CreateTable ( ctx ) if err != nil { return nil , api . AppErrorConv ( err ) } return & DBMigrator { ctx : ctx , config : config , logger : logger , domain : domain , ms : ms , } , nil }
NewDBMigrator returns a new instance of DBMigrator
NewDBMigrator returns a new instance of DBMigrator