aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r--OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs41
1 files changed, 24 insertions, 17 deletions
diff --git a/OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs b/OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs
index 294a80e..e3f9413 100644
--- a/OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs
+++ b/OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs
@@ -53,6 +53,9 @@ namespace OpenSim.Data.MySQL.Tests
53 try 53 try
54 { 54 {
55 database = new MySQLManager(connect); 55 database = new MySQLManager(connect);
56 // this is important in case a previous run ended badly
57 ClearDB(database);
58
56 db = new MySQLDataStore(); 59 db = new MySQLDataStore();
57 db.Initialise(connect); 60 db.Initialise(connect);
58 } 61 }
@@ -70,24 +73,28 @@ namespace OpenSim.Data.MySQL.Tests
70 { 73 {
71 db.Dispose(); 74 db.Dispose();
72 } 75 }
73 // if a new table is added, it has to be dropped here 76 ClearDB(database);
74 if (database != null) 77 }
78
79 private void ClearDB(MySQLManager manager)
80 {
81 if (manager != null)
75 { 82 {
76 database.ExecuteSql("drop table migrations"); 83 manager.ExecuteSql("drop table migrations");
77 database.ExecuteSql("drop table prims"); 84 manager.ExecuteSql("drop table prims");
78 database.ExecuteSql("drop table primshapes"); 85 manager.ExecuteSql("drop table primshapes");
79 database.ExecuteSql("drop table primitems"); 86 manager.ExecuteSql("drop table primitems");
80 database.ExecuteSql("drop table terrain"); 87 manager.ExecuteSql("drop table terrain");
81 database.ExecuteSql("drop table land"); 88 manager.ExecuteSql("drop table land");
82 database.ExecuteSql("drop table landaccesslist"); 89 manager.ExecuteSql("drop table landaccesslist");
83 database.ExecuteSql("drop table regionban"); 90 manager.ExecuteSql("drop table regionban");
84 database.ExecuteSql("drop table regionsettings"); 91 manager.ExecuteSql("drop table regionsettings");
85 database.ExecuteSql("drop table estate_managers"); 92 manager.ExecuteSql("drop table estate_managers");
86 database.ExecuteSql("drop table estate_groups"); 93 manager.ExecuteSql("drop table estate_groups");
87 database.ExecuteSql("drop table estate_users"); 94 manager.ExecuteSql("drop table estate_users");
88 database.ExecuteSql("drop table estateban"); 95 manager.ExecuteSql("drop table estateban");
89 database.ExecuteSql("drop table estate_settings"); 96 manager.ExecuteSql("drop table estate_settings");
90 database.ExecuteSql("drop table estate_map"); 97 manager.ExecuteSql("drop table estate_map");
91 } 98 }
92 } 99 }
93 } 100 }