Beispiel #1
0
        public void TestScriptingAndExecutingMigration1()
        {
            DirectoryInfo targetDirectory = PrepareScriptingDirectory();

            _options.VersioningTableName = "My Versioning Table"; // test overriding the default versioning table name
            _options.ExecuteAndScriptSqlTo(targetDirectory);
            Migrator migrator = CreateMigrator();

            migrator.MigrateTo(typeof(Migration1).Assembly, Timestamps[0]);

            CheckResultsOfMigration1();

            // assert that the script file was generated
            FileInfo[] scriptFiles = targetDirectory.GetFiles(string.Format(CultureInfo.InvariantCulture, "Migration." + MigrationExportAttribute.DefaultModuleName + ".1.sql"));
            Assert.AreEqual(1, scriptFiles.Length);

            // delete script files
            targetDirectory.Delete(true);
        }