public void RebuildDatabases(params DbContext[] dbs)
 {
     foreach (var db in dbs)
     {
         SqlAdminQueries.DropDatabase(db.Database.Connection.DataSource, db.Database.Connection.Database);
         db.Database.Initialize(true);
         // DropDatabase kills existing connections so make sure to remove the dead ones we're holding onto
         if (_connAndTxs.ContainsKey(db.GetType()))
         {
             _connAndTxs.Remove(db.GetType());
         }
     }
 }
Example #2
0
 public override void CreateDatabaseMedia()
 {
     SqlAdminQueries.CreateDatabase(DbConnectionInfo.ServerName, DbConnectionInfo.DatabaseName, true);
 }