public static void ExecuteAllScripts(Session session)
 {
     session.Command.CommandType = CommandType.Text;
     ExecuteScript(0, session.Command);
     session.Command.CommandText = "SELECT Version FROM Correspondence_Version";
     int versionId = (int)session.Command.ExecuteScalar() + 1;
     while (ExecuteScript(versionId, session.Command))
     {
         session.Command.CommandText = String.Format("UPDATE Correspondence_Version SET Version = {0}", versionId);
         session.Command.ExecuteNonQuery();
         versionId = versionId + 1;
     }
 }
 public Procedures(Session session)
 {
     _session = session;
 }
 public Repository UpgradeDatabase()
 {
     using (var session = new Session(_connectionString))
     {
         ScriptRunner.ExecuteAllScripts(session);
     }
     return this;
 }