mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
Minor corrections in BasicDataServiceTest.cs
(added more functions for cleaning up DB from the derived tests)
This commit is contained in:
@@ -167,5 +167,46 @@ namespace OpenSim.Data.Tests
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Clear tables listed as parameters (without dropping them).
|
||||
/// </summary>
|
||||
/// <param name="tables"></param>
|
||||
protected virtual void ResetMigrations(params string[] stores)
|
||||
{
|
||||
string lst = "";
|
||||
foreach (string store in stores)
|
||||
{
|
||||
string s = "'" + store + "'";
|
||||
if (lst == "")
|
||||
lst = s;
|
||||
else
|
||||
lst += ", " + s;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
ExecuteSql("DELETE FROM `migrations` where name in (" + lst + ");");
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Clear tables listed as parameters (without dropping them).
|
||||
/// </summary>
|
||||
/// <param name="tables"></param>
|
||||
protected virtual void ClearTables(params string[] tables)
|
||||
{
|
||||
foreach (string tbl in tables)
|
||||
{
|
||||
try
|
||||
{
|
||||
ExecuteSql("DELETE FROM " + tbl + ";");
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user