public void IsDbInActualState() { Configuration configuration = new MsSql2008Initializer().GetConfiguration(); var factory = (ISessionFactoryImplementor)configuration.BuildSessionFactory(); using (ISession session = factory.OpenSession()) { string[] updateScripts = configuration.GenerateSchemaUpdateScript(factory.Dialect, new DatabaseMetadata((DbConnection)session.Connection, factory.Dialect)); Assert.AreEqual(string.Empty, updateScripts); } }
public void GenerateMigrationScript() { Configuration configuration = new MsSql2008Initializer().GetConfiguration(); var factory = (ISessionFactoryImplementor)configuration.BuildSessionFactory(); using (ISession session = factory.OpenSession()) { string[] updateScripts = configuration.GenerateSchemaUpdateScript(factory.Dialect, new DatabaseMetadata((DbConnection)session.Connection, factory.Dialect)); foreach (string updateScript in updateScripts) { Console.WriteLine(updateScript); Console.WriteLine("GO"); } } }