diff options
author | Sean Dague | 2008-05-19 21:47:31 +0000 |
---|---|---|
committer | Sean Dague | 2008-05-19 21:47:31 +0000 |
commit | 6d2f6be82b82c96a7457c5b25ed0ca73e6039893 (patch) | |
tree | a1bf9925e55bab86779b24551d710cfc2eec12a2 /OpenSim/Data/MySQL/MySQLUserData.cs | |
parent | prep for changes need to create the appearance tables (diff) | |
download | opensim-SC-6d2f6be82b82c96a7457c5b25ed0ca73e6039893.zip opensim-SC-6d2f6be82b82c96a7457c5b25ed0ca73e6039893.tar.gz opensim-SC-6d2f6be82b82c96a7457c5b25ed0ca73e6039893.tar.bz2 opensim-SC-6d2f6be82b82c96a7457c5b25ed0ca73e6039893.tar.xz |
autocreate appearance table if it isn't there
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLUserData.cs | 18 |
1 files changed, 18 insertions, 0 deletions
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 | |||
54 | private string m_agentsTableName; | 54 | private string m_agentsTableName; |
55 | private string m_usersTableName; | 55 | private string m_usersTableName; |
56 | private string m_userFriendsTableName; | 56 | private string m_userFriendsTableName; |
57 | private string m_appearanceTableName = "avatarappearance"; | ||
57 | private string m_connectString; | 58 | private string m_connectString; |
58 | private BaseDatabaseConnector m_databaseMapper; | 59 | private BaseDatabaseConnector m_databaseMapper; |
59 | private AppearanceTableMapper m_appearanceMapper; | 60 | private AppearanceTableMapper m_appearanceMapper; |
@@ -130,11 +131,13 @@ namespace OpenSim.Data.MySQL | |||
130 | tableList[m_agentsTableName] = null; | 131 | tableList[m_agentsTableName] = null; |
131 | tableList[m_usersTableName] = null; | 132 | tableList[m_usersTableName] = null; |
132 | tableList[m_userFriendsTableName] = null; | 133 | tableList[m_userFriendsTableName] = null; |
134 | tableList[m_appearanceTableName] = null; | ||
133 | database.GetTableVersion(tableList); | 135 | database.GetTableVersion(tableList); |
134 | 136 | ||
135 | UpgradeAgentsTable(tableList[m_agentsTableName]); | 137 | UpgradeAgentsTable(tableList[m_agentsTableName]); |
136 | UpgradeUsersTable(tableList[m_usersTableName]); | 138 | UpgradeUsersTable(tableList[m_usersTableName]); |
137 | UpgradeFriendsTable(tableList[m_userFriendsTableName]); | 139 | UpgradeFriendsTable(tableList[m_userFriendsTableName]); |
140 | UpgradeAppearanceTable(tableList[m_appearanceTableName]); | ||
138 | } | 141 | } |
139 | 142 | ||
140 | /// <summary> | 143 | /// <summary> |
@@ -188,6 +191,21 @@ namespace OpenSim.Data.MySQL | |||
188 | } | 191 | } |
189 | } | 192 | } |
190 | 193 | ||
194 | /// <summary> | ||
195 | /// Create or upgrade the table if necessary | ||
196 | /// </summary> | ||
197 | /// <param name="oldVersion">A null indicates that the table does not | ||
198 | /// currently exist</param> | ||
199 | private void UpgradeAppearanceTable(string oldVersion) | ||
200 | { | ||
201 | // null as the version, indicates that the table didn't exist | ||
202 | if (oldVersion == null) | ||
203 | { | ||
204 | database.ExecuteResourceSql("CreateAvatarAppearance.sql"); | ||
205 | return; | ||
206 | } | ||
207 | } | ||
208 | |||
191 | #endregion | 209 | #endregion |
192 | 210 | ||
193 | // see IUserData | 211 | // see IUserData |