Пример #1
0
        public static void Run(Logger log, string connectionString, string scriptsLocation, string environmentName, bool dropDatabase, bool useSimpleRecoveryMode,string repositoryPath,string versionFile,string versionXPath, bool restore, string restorePath)
        {
            var migrate = new Migrate();

            migrate
                .SetCustomLogging(log)
                .Set(p =>
                    {
                        p.ConnectionString = connectionString;
                        p.SqlFilesDirectory = scriptsLocation;
                        p.EnvironmentName = environmentName;
                        p.Drop = dropDatabase;
                        p.RecoveryModeSimple = useSimpleRecoveryMode;
                        p.Restore = restore;
                        p.RestoreFromPath = restorePath;
                        p.RepositoryPath = repositoryPath;
                        p.VersionFile = versionFile;
                        p.VersionXPath = versionXPath;
                        p.Silent = true;
                    })
                .Run();
        }
Пример #2
0
 public static void Run(Logger log, string connectionString, string scriptsLocation, string environmentName, bool dropDatabase, bool useSimpleRecoveryMode,string repositoryPath,string versionFile,string versionXPath)
 {
     Run(log, connectionString, scriptsLocation, environmentName, dropDatabase, useSimpleRecoveryMode,repositoryPath,versionFile,versionXPath, false, @"");
 }
Пример #3
0
        static ConfigurationPropertyHolder GetRoundhousEConfiguration(Logger log)
        {
            //roundhouse needs a client api - you may want to make one for him?

            var config = new RoundhousEConfig(log)
                             {
                                 DatabaseName = _databaseName,
                                 ServerName = _instanceName,
                                 DatabaseType = _databaseType,
                                 Drop = _dropDatabase,
                                 SqlFilesDirectory = _scriptsLocation,
                                 EnvironmentName = _environmentName,
                                 RecoveryModeSimple = _useSimpleRecoveryMode,
                                 Silent = true
                             };
            return config;
        }
Пример #4
0
 public RoundhousEConfig(Logger log)
 {
     Logger = log;
 }
Пример #5
0
        public static void Run(Logger log, string instanceName, string databaseType, string databaseName, bool dropDatabase, string scriptsLocation, string environmentName, bool useSimpleRecoveryMode)
        {
            _instanceName = instanceName;
            _databaseType = databaseType;
            _databaseName = databaseName;
            _dropDatabase = dropDatabase;
            _scriptsLocation = scriptsLocation;
            _environmentName = environmentName;
            _useSimpleRecoveryMode = useSimpleRecoveryMode;

            var loggers = new List<Logger>();
            loggers.Add(log);
            loggers.Add(new Log4NetLogger(_logger));

            var multiLogger = new MultipleLogger(loggers);
            var config = GetRoundhousEConfiguration(multiLogger);

            //should be wrapped in his api
            ApplicationConfiguraton.set_defaults_if_properties_are_not_set(config);

            //should be wrapped in his api
            ApplicationConfiguraton.build_the_container(config);

            var runner = GetMigrationRunner(config);
            runner.run();
        }