add migrations support for mysql log store. This should complete

all the mysql bits for migration.
0.6.0-stable
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>

View File

@ -0,0 +1,10 @@
CREATE TABLE `logs` (
`logID` int(10) unsigned NOT NULL auto_increment,
`target` varchar(36) default NULL,
`server` varchar(64) default NULL,
`method` varchar(64) default NULL,
`arguments` varchar(255) default NULL,
`priority` int(11) default NULL,
`message` text,
PRIMARY KEY (`logID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@ -7,4 +7,4 @@ CREATE TABLE `logs` (
`priority` int(11) default NULL,
`message` text,
PRIMARY KEY (`logID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1';
) ENGINE=InnoDB DEFAULT CHARSET=utf8