Exemplo n.º 1
0
 protected DatabaseInfo IncrementalAnalysis(DatabaseInfo dbInfo, DatabaseChangeSet changeSet)
 {
     using (var conn = OpenConnection())
     {
         var factory  = DatabaseFactory;
         var analyser = factory.CreateAnalyser();
         analyser.Connection = conn;
         analyser.Structure  = dbInfo;
         analyser.ChangeSet  = changeSet;
         analyser.IncrementalAnalysis();
         return(analyser.Structure);
     }
 }
Exemplo n.º 2
0
        private static void ExplainFailure(DatabaseChangeSet changes, string migration)
        {
            string context = String.Format(
                "The migration {0} failed the sanity check of merging its effects in SQL files and having no differences over a DB with the migration applied on top of it." +
                Environment.NewLine + "The changes are:" + Environment.NewLine + "{1}",
                Path.GetFileName(migration),
                changes);

            if (changes.HasModifications)
            {
                string nameOfElement, after, before;
                changes.GetFirstDifference(out nameOfElement, out after, out before);

                Assert.AreEqual(after, before, context);
            }
            else
            {
                Assert.Fail(context);
            }
        }