add migrations support for mysql log store. This should complete

all the mysql bits for migration.
This commit is contained in:
Sean Dague
2008-06-19 15:42:57 +00:00
parent fcd7cf5e4a
commit d28a5a4de7
3 changed files with 41 additions and 1 deletions

View File

@@ -65,6 +65,36 @@ namespace OpenSim.Data.MySQL
database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword,
settingPooling, settingPort);
}
// This actually does the roll forward assembly stuff
Assembly assem = GetType().Assembly;
Migration m = new Migration(database.Connection, assem, "LogStore");
// TODO: After rev 6000, remove this. People should have
// been rolled onto the new migration code by then.
TestTables(m);
m.Update();
}
private void TestTables(Migration m)
{
// under migrations, bail
if (m.Version > 0)
return;
Dictionary<string, string> tableList = new Dictionary<string, string>();
tableList["logs"] = null;
database.GetTableVersion(tableList);
// migrations will handle it
if (tableList["logs"] == null)
return;
// we have the table, so pretend like we did the first migration in the past
if (m.Version == 0)
m.Version = 1;
}
/// <summary>