コード例 #1
0
        private void MigrateTo(long targetVersion)
        {
            var options = new MigrationOptions { PreviewOnly = false,  Timeout = 60 };
            var announcer = new NullAnnouncer();
            var processor = new SqlServer2012ProcessorFactory().Create(connectionString, announcer, options);
            var migrationContext = new RunnerContext(announcer) { Namespace = "DDDEastAnglia.DatabaseMigrations.Migrations" };

            var runner = new MigrationRunner(GetType().Assembly, migrationContext, processor);
            runner.MigrateUp(targetVersion, true);
        }
コード例 #2
0
ファイル: Migrator.cs プロジェクト: adsurg/DDDEastAnglia
        private void MigrateTo(long targetVersion)
        {
            var options = new MigrationOptions {
                PreviewOnly = false, Timeout = 60
            };
            var announcer        = new NullAnnouncer();
            var processor        = new SqlServer2012ProcessorFactory().Create(connectionString, announcer, options);
            var migrationContext = new RunnerContext(announcer)
            {
                Namespace = "DDDEastAnglia.DatabaseMigrations.Migrations"
            };

            var runner = new MigrationRunner(GetType().Assembly, migrationContext, processor);

            runner.MigrateUp(targetVersion, true);
        }