private static void Main(string[] args)
 {
     XmlConfigurator.Configure();
     var connString = ConfigurationManager.ConnectionStrings["Oracle.ManagedDataAccess.Client"].ConnectionString;
     var runner = new ConsoleRunner(connString, DataProviderNames.OracleManaged);
     runner.Start();
 }
 public void Run(long targetVersion, string migrationGroup = null)
 {
     var appConfig = ConfigurationManager.OpenExeConfiguration(_assemblyPath);
     var cs = GetConnectionStringSettings(appConfig.ConnectionStrings.ConnectionStrings);
     _consoleRunner = new ConsoleRunner(cs.ConnectionString, cs.ProviderName);
     _consoleRunner.AssemblyWithMigrations = Assembly.LoadFile(_assemblyPath);
     if (migrationGroup != null) {
         _consoleRunner.Start();
     }
     _consoleRunner.Start();
 }
        public void Run(long targetVersion, string migrationGroup = null)
        {
            var appConfig = ConfigurationManager.OpenExeConfiguration(_assemblyPath);
            var cs        = GetConnectionStringSettings(appConfig.ConnectionStrings.ConnectionStrings);

            _consoleRunner = new ConsoleRunner(cs.ConnectionString, cs.ProviderName);
            _consoleRunner.AssemblyWithMigrations = Assembly.LoadFile(_assemblyPath);
            if (migrationGroup != null)
            {
                _consoleRunner.Start();
            }
            _consoleRunner.Start();
        }
Exemple #4
0
 private static void Run()
 {
     int version = _options.TargetVersion ?? -1;
     string mode = (_options.Mode ?? "manual").ToLower();
     if (mode == "script") {
         RunScript(version);
         return;
     }
     if (mode == "auto") {
         var runner = new Runner(SharpFactory.Default.CreateDataClient(), GetAssemblyWithMigrations());
         runner.MigrationGroup = _options.MigrationGroup;
         runner.Run(version);
         return;
     }
     if (mode == "seed") {
         if (String.IsNullOrEmpty(_options.SeedName)) {
             Exit("Please, set the seed name");
             return;
         }
         var seedRunner = new SeedRunner(SharpFactory.Default.CreateDataClient(), GetAssemblyWithMigrations());
         seedRunner.Run(_options.SeedName, _options.SeedArgs, _options.MigrationGroup);
         return;
     }
     var crunner = new ConsoleRunner(SharpFactory.Default.ConnectionString, SharpFactory.Default.DataProviderName);
     crunner.AssemblyWithMigrations = GetAssemblyWithMigrations();
     crunner.MigrationGroup = _options.MigrationGroup;
     crunner.Start();
 }