From 6d2f6be82b82c96a7457c5b25ed0ca73e6039893 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 19 May 2008 21:47:31 +0000 Subject: autocreate appearance table if it isn't there --- OpenSim/Data/MySQL/MySQLUserData.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'OpenSim/Data/MySQL/MySQLUserData.cs') diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs index f7d5659..56bdcbf 100644 --- a/OpenSim/Data/MySQL/MySQLUserData.cs +++ b/OpenSim/Data/MySQL/MySQLUserData.cs @@ -54,6 +54,7 @@ namespace OpenSim.Data.MySQL private string m_agentsTableName; private string m_usersTableName; private string m_userFriendsTableName; + private string m_appearanceTableName = "avatarappearance"; private string m_connectString; private BaseDatabaseConnector m_databaseMapper; private AppearanceTableMapper m_appearanceMapper; @@ -130,11 +131,13 @@ namespace OpenSim.Data.MySQL tableList[m_agentsTableName] = null; tableList[m_usersTableName] = null; tableList[m_userFriendsTableName] = null; + tableList[m_appearanceTableName] = null; database.GetTableVersion(tableList); UpgradeAgentsTable(tableList[m_agentsTableName]); UpgradeUsersTable(tableList[m_usersTableName]); UpgradeFriendsTable(tableList[m_userFriendsTableName]); + UpgradeAppearanceTable(tableList[m_appearanceTableName]); } /// @@ -188,6 +191,21 @@ namespace OpenSim.Data.MySQL } } + /// + /// Create or upgrade the table if necessary + /// + /// A null indicates that the table does not + /// currently exist + private void UpgradeAppearanceTable(string oldVersion) + { + // null as the version, indicates that the table didn't exist + if (oldVersion == null) + { + database.ExecuteResourceSql("CreateAvatarAppearance.sql"); + return; + } + } + #endregion // see IUserData -- cgit v1.1