diff options
Diffstat (limited to 'OpenSim/Data/MSSQL')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLAssetData.cs | 75 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLEstateData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLGridData.cs | 55 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLInventoryData.cs | 87 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLLogData.cs | 57 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLRegionData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLUserData.cs | 114 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/Resources/001_UserStore.sql | 112 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/Resources/AvatarAppearance.sql | 47 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/Resources/CreateAssetsTable.sql | 18 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/Resources/CreateFoldersTable.sql | 27 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/Resources/CreateItemsTable.sql | 46 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/Resources/CreateUserFriendsTable.sql | 14 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/Resources/Mssql-agents.sql | 37 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/Resources/Mssql-logs.sql | 20 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/Resources/Mssql-regions.sql | 41 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/Resources/Mssql-users.sql | 42 |
17 files changed, 14 insertions, 782 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLAssetData.cs b/OpenSim/Data/MSSQL/MSSQLAssetData.cs index 4d5ca1c..2a959fd 100644 --- a/OpenSim/Data/MSSQL/MSSQLAssetData.cs +++ b/OpenSim/Data/MSSQL/MSSQLAssetData.cs | |||
@@ -26,9 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | ||
30 | using System.Data; | 29 | using System.Data; |
31 | using System.Data.SqlClient; | ||
32 | using System.Reflection; | 30 | using System.Reflection; |
33 | using OpenMetaverse; | 31 | using OpenMetaverse; |
34 | using log4net; | 32 | using log4net; |
@@ -57,6 +55,7 @@ namespace OpenSim.Data.MSSQL | |||
57 | /// <summary> | 55 | /// <summary> |
58 | /// <para>Initialises asset interface</para> | 56 | /// <para>Initialises asset interface</para> |
59 | /// </summary> | 57 | /// </summary> |
58 | [Obsolete("Cannot be default-initialized!")] | ||
60 | override public void Initialise() | 59 | override public void Initialise() |
61 | { | 60 | { |
62 | m_log.Info("[MSSQLUserData]: " + Name + " cannot be default-initialized!"); | 61 | m_log.Info("[MSSQLUserData]: " + Name + " cannot be default-initialized!"); |
@@ -72,7 +71,7 @@ namespace OpenSim.Data.MSSQL | |||
72 | /// <param name="connectionString">connect string</param> | 71 | /// <param name="connectionString">connect string</param> |
73 | override public void Initialise(string connectionString) | 72 | override public void Initialise(string connectionString) |
74 | { | 73 | { |
75 | if (string.IsNullOrEmpty(connectionString)) | 74 | if (!string.IsNullOrEmpty(connectionString)) |
76 | { | 75 | { |
77 | database = new MSSQLManager(connectionString); | 76 | database = new MSSQLManager(connectionString); |
78 | } | 77 | } |
@@ -91,9 +90,6 @@ namespace OpenSim.Data.MSSQL | |||
91 | settingPassword); | 90 | settingPassword); |
92 | } | 91 | } |
93 | 92 | ||
94 | //TODO can be removed at some time!! | ||
95 | TestTables(); | ||
96 | |||
97 | //New migration to check for DB changes | 93 | //New migration to check for DB changes |
98 | database.CheckMigration(_migrationStore); | 94 | database.CheckMigration(_migrationStore); |
99 | } | 95 | } |
@@ -228,72 +224,5 @@ namespace OpenSim.Data.MSSQL | |||
228 | } | 224 | } |
229 | 225 | ||
230 | #endregion | 226 | #endregion |
231 | |||
232 | #region Private Methods | ||
233 | |||
234 | /// <summary> | ||
235 | /// Migration method | ||
236 | /// <list type="bullet"> | ||
237 | /// <item>Execute "CreateAssetsTable.sql" if tableName == null</item> | ||
238 | /// </list> | ||
239 | /// </summary> | ||
240 | /// <param name="tableName">Name of table</param> | ||
241 | private void UpgradeAssetsTable(string tableName) | ||
242 | { | ||
243 | // null as the version, indicates that the table didn't exist | ||
244 | if (tableName == null) | ||
245 | { | ||
246 | m_log.Info("[ASSET DB]: Creating new database tables"); | ||
247 | database.ExecuteResourceSql("CreateAssetsTable.sql"); | ||
248 | return; | ||
249 | } | ||
250 | } | ||
251 | |||
252 | /// <summary> | ||
253 | /// Ensure that the assets related tables exists and are at the latest version | ||
254 | /// </summary> | ||
255 | private void TestTables() | ||
256 | { | ||
257 | Dictionary<string, string> tableList = new Dictionary<string, string>(); | ||
258 | |||
259 | tableList["assets"] = null; | ||
260 | database.GetTableVersion(tableList); | ||
261 | |||
262 | UpgradeAssetsTable(tableList["assets"]); | ||
263 | |||
264 | //Special for Migrations | ||
265 | using (AutoClosingSqlCommand cmd = database.Query("select * from migrations where name = '" + _migrationStore + "'")) | ||
266 | { | ||
267 | try | ||
268 | { | ||
269 | bool insert = true; | ||
270 | using (SqlDataReader reader = cmd.ExecuteReader()) | ||
271 | { | ||
272 | if (reader.Read()) insert = false; | ||
273 | } | ||
274 | if (insert) | ||
275 | { | ||
276 | cmd.CommandText = "insert into migrations(name, version) values('" + _migrationStore + "', 1)"; | ||
277 | cmd.ExecuteNonQuery(); | ||
278 | } | ||
279 | } | ||
280 | catch | ||
281 | { | ||
282 | //No migrations table | ||
283 | //HACK create one and add data | ||
284 | cmd.CommandText = "create table migrations(name varchar(100), version int)"; | ||
285 | cmd.ExecuteNonQuery(); | ||
286 | |||
287 | cmd.CommandText = "insert into migrations(name, version) values('migrations', 1)"; | ||
288 | cmd.ExecuteNonQuery(); | ||
289 | |||
290 | cmd.CommandText = "insert into migrations(name, version) values('" + _migrationStore + "', 1)"; | ||
291 | cmd.ExecuteNonQuery(); | ||
292 | } | ||
293 | } | ||
294 | |||
295 | } | ||
296 | |||
297 | #endregion | ||
298 | } | 227 | } |
299 | } | 228 | } |
diff --git a/OpenSim/Data/MSSQL/MSSQLEstateData.cs b/OpenSim/Data/MSSQL/MSSQLEstateData.cs index b3595d9..56855f6 100644 --- a/OpenSim/Data/MSSQL/MSSQLEstateData.cs +++ b/OpenSim/Data/MSSQL/MSSQLEstateData.cs | |||
@@ -56,7 +56,7 @@ namespace OpenSim.Data.MSSQL | |||
56 | /// <param name="connectionString">connectionString.</param> | 56 | /// <param name="connectionString">connectionString.</param> |
57 | public void Initialise(string connectionString) | 57 | public void Initialise(string connectionString) |
58 | { | 58 | { |
59 | if (string.IsNullOrEmpty(connectionString)) | 59 | if (!string.IsNullOrEmpty(connectionString)) |
60 | { | 60 | { |
61 | _Database = new MSSQLManager(connectionString); | 61 | _Database = new MSSQLManager(connectionString); |
62 | } | 62 | } |
diff --git a/OpenSim/Data/MSSQL/MSSQLGridData.cs b/OpenSim/Data/MSSQL/MSSQLGridData.cs index ace3b27..80c7798 100644 --- a/OpenSim/Data/MSSQL/MSSQLGridData.cs +++ b/OpenSim/Data/MSSQL/MSSQLGridData.cs | |||
@@ -54,6 +54,7 @@ namespace OpenSim.Data.MSSQL | |||
54 | 54 | ||
55 | #region IPlugin Members | 55 | #region IPlugin Members |
56 | 56 | ||
57 | [Obsolete("Cannot be default-initialized!")] | ||
57 | override public void Initialise() | 58 | override public void Initialise() |
58 | { | 59 | { |
59 | m_log.Info("[GRID DB]: " + Name + " cannot be default-initialized!"); | 60 | m_log.Info("[GRID DB]: " + Name + " cannot be default-initialized!"); |
@@ -67,7 +68,7 @@ namespace OpenSim.Data.MSSQL | |||
67 | /// <remarks>use mssql_connection.ini</remarks> | 68 | /// <remarks>use mssql_connection.ini</remarks> |
68 | override public void Initialise(string connectionString) | 69 | override public void Initialise(string connectionString) |
69 | { | 70 | { |
70 | if (string.IsNullOrEmpty(connectionString)) | 71 | if (!string.IsNullOrEmpty(connectionString)) |
71 | { | 72 | { |
72 | database = new MSSQLManager(connectionString); | 73 | database = new MSSQLManager(connectionString); |
73 | } | 74 | } |
@@ -93,63 +94,11 @@ namespace OpenSim.Data.MSSQL | |||
93 | settingPassword); | 94 | settingPassword); |
94 | } | 95 | } |
95 | 96 | ||
96 | //TODO this can be removed at a certain time | ||
97 | TestTables(); | ||
98 | |||
99 | //New migrations check of store | 97 | //New migrations check of store |
100 | database.CheckMigration(_migrationStore); | 98 | database.CheckMigration(_migrationStore); |
101 | } | 99 | } |
102 | 100 | ||
103 | /// <summary> | 101 | /// <summary> |
104 | /// Test is region | ||
105 | /// </summary> | ||
106 | private void TestTables() | ||
107 | { | ||
108 | using (AutoClosingSqlCommand cmd = database.Query("SELECT TOP 1 * FROM " + m_regionsTableName, new Dictionary<string, string>())) | ||
109 | { | ||
110 | try | ||
111 | { | ||
112 | cmd.ExecuteNonQuery(); | ||
113 | } | ||
114 | catch (Exception) | ||
115 | { | ||
116 | m_log.Info("[GRID DB]: MSSQL Database doesn't exist... creating"); | ||
117 | database.ExecuteResourceSql("Mssql-regions.sql"); | ||
118 | } | ||
119 | } | ||
120 | using (AutoClosingSqlCommand cmd = database.Query("select * from migrations where name = '" + _migrationStore + "'")) | ||
121 | { | ||
122 | //Special for Migrations to create backword compatible | ||
123 | try | ||
124 | { | ||
125 | bool insert = true; | ||
126 | using (SqlDataReader reader = cmd.ExecuteReader()) | ||
127 | { | ||
128 | if (reader.Read()) insert = false; | ||
129 | } | ||
130 | if (insert) | ||
131 | { | ||
132 | cmd.CommandText = "insert into migrations(name, version) values('" + _migrationStore + "', 1)"; | ||
133 | cmd.ExecuteNonQuery(); | ||
134 | } | ||
135 | } | ||
136 | catch | ||
137 | { | ||
138 | //No migrations table | ||
139 | //HACK create one and add data | ||
140 | cmd.CommandText = "create table migrations(name varchar(100), version int)"; | ||
141 | cmd.ExecuteNonQuery(); | ||
142 | |||
143 | cmd.CommandText = "insert into migrations(name, version) values('migrations', 1)"; | ||
144 | cmd.ExecuteNonQuery(); | ||
145 | |||
146 | cmd.CommandText = "insert into migrations(name, version) values('" + _migrationStore + "', 1)"; | ||
147 | cmd.ExecuteNonQuery(); | ||
148 | } | ||
149 | } | ||
150 | } | ||
151 | |||
152 | /// <summary> | ||
153 | /// Shuts down the grid interface | 102 | /// Shuts down the grid interface |
154 | /// </summary> | 103 | /// </summary> |
155 | override public void Dispose() | 104 | override public void Dispose() |
diff --git a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs index eb31cc8..764b89d 100644 --- a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs +++ b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs | |||
@@ -52,6 +52,7 @@ namespace OpenSim.Data.MSSQL | |||
52 | 52 | ||
53 | #region IPlugin members | 53 | #region IPlugin members |
54 | 54 | ||
55 | [Obsolete("Cannot be default-initialized!")] | ||
55 | public void Initialise() | 56 | public void Initialise() |
56 | { | 57 | { |
57 | m_log.Info("[MSSQLInventoryData]: " + Name + " cannot be default-initialized!"); | 58 | m_log.Info("[MSSQLInventoryData]: " + Name + " cannot be default-initialized!"); |
@@ -65,7 +66,7 @@ namespace OpenSim.Data.MSSQL | |||
65 | /// <remarks>use mssql_connection.ini</remarks> | 66 | /// <remarks>use mssql_connection.ini</remarks> |
66 | public void Initialise(string connectionString) | 67 | public void Initialise(string connectionString) |
67 | { | 68 | { |
68 | if (string.IsNullOrEmpty(connectionString)) | 69 | if (!string.IsNullOrEmpty(connectionString)) |
69 | { | 70 | { |
70 | database = new MSSQLManager(connectionString); | 71 | database = new MSSQLManager(connectionString); |
71 | } | 72 | } |
@@ -83,94 +84,10 @@ namespace OpenSim.Data.MSSQL | |||
83 | settingPassword); | 84 | settingPassword); |
84 | } | 85 | } |
85 | 86 | ||
86 | //TODO remove this at one point | ||
87 | TestTables(); | ||
88 | |||
89 | //New migrations check of store | 87 | //New migrations check of store |
90 | database.CheckMigration(_migrationStore); | 88 | database.CheckMigration(_migrationStore); |
91 | } | 89 | } |
92 | 90 | ||
93 | #region Test and initialization code | ||
94 | |||
95 | /// <summary> | ||
96 | /// Execute "CreateFoldersTable.sql" if tableName == null | ||
97 | /// </summary> | ||
98 | /// <param name="tableName">the table name</param> | ||
99 | private void UpgradeFoldersTable(string tableName) | ||
100 | { | ||
101 | // null as the version, indicates that the table didn't exist | ||
102 | if (tableName == null) | ||
103 | { | ||
104 | database.ExecuteResourceSql("CreateFoldersTable.sql"); | ||
105 | //database.ExecuteResourceSql("UpgradeFoldersTableToVersion2.sql"); | ||
106 | return; | ||
107 | } | ||
108 | } | ||
109 | |||
110 | /// <summary> | ||
111 | /// Execute "CreateItemsTable.sql" if tableName = null | ||
112 | /// </summary> | ||
113 | /// <param name="tableName">the table name</param> | ||
114 | private void UpgradeItemsTable(string tableName) | ||
115 | { | ||
116 | // null as the version, indicates that the table didn't exist | ||
117 | if (tableName == null) | ||
118 | { | ||
119 | database.ExecuteResourceSql("CreateItemsTable.sql"); | ||
120 | //database.ExecuteResourceSql("UpgradeItemsTableToVersion2.sql"); | ||
121 | return; | ||
122 | } | ||
123 | } | ||
124 | |||
125 | /// <summary> | ||
126 | /// | ||
127 | /// </summary> | ||
128 | private void TestTables() | ||
129 | { | ||
130 | Dictionary<string, string> tableList = new Dictionary<string, string>(); | ||
131 | |||
132 | tableList["inventoryfolders"] = null; | ||
133 | tableList["inventoryitems"] = null; | ||
134 | |||
135 | database.GetTableVersion(tableList); | ||
136 | |||
137 | UpgradeFoldersTable(tableList["inventoryfolders"]); | ||
138 | UpgradeItemsTable(tableList["inventoryitems"]); | ||
139 | |||
140 | using (AutoClosingSqlCommand cmd = database.Query("select * from migrations where name = '" + _migrationStore + "'")) | ||
141 | { | ||
142 | //Special for Migrations to create backword compatible | ||
143 | try | ||
144 | { | ||
145 | bool insert = true; | ||
146 | using (SqlDataReader reader = cmd.ExecuteReader()) | ||
147 | { | ||
148 | if (reader.Read()) insert = false; | ||
149 | } | ||
150 | if (insert) | ||
151 | { | ||
152 | cmd.CommandText = "insert into migrations(name, version) values('" + _migrationStore + "', 1)"; | ||
153 | cmd.ExecuteNonQuery(); | ||
154 | } | ||
155 | } | ||
156 | catch | ||
157 | { | ||
158 | //No migrations table | ||
159 | //HACK create one and add data | ||
160 | cmd.CommandText = "create table migrations(name varchar(100), version int)"; | ||
161 | cmd.ExecuteNonQuery(); | ||
162 | |||
163 | cmd.CommandText = "insert into migrations(name, version) values('migrations', 1)"; | ||
164 | cmd.ExecuteNonQuery(); | ||
165 | |||
166 | cmd.CommandText = "insert into migrations(name, version) values('" + _migrationStore + "', 1)"; | ||
167 | cmd.ExecuteNonQuery(); | ||
168 | } | ||
169 | } | ||
170 | } | ||
171 | |||
172 | #endregion | ||
173 | |||
174 | /// <summary> | 91 | /// <summary> |
175 | /// The name of this DB provider | 92 | /// The name of this DB provider |
176 | /// </summary> | 93 | /// </summary> |
diff --git a/OpenSim/Data/MSSQL/MSSQLLogData.cs b/OpenSim/Data/MSSQL/MSSQLLogData.cs index a617cea..63cd605 100644 --- a/OpenSim/Data/MSSQL/MSSQLLogData.cs +++ b/OpenSim/Data/MSSQL/MSSQLLogData.cs | |||
@@ -26,10 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Data.SqlClient; | ||
30 | using System.Reflection; | 29 | using System.Reflection; |
31 | using System.Collections.Generic; | ||
32 | using System.Data; | ||
33 | using log4net; | 30 | using log4net; |
34 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
35 | 32 | ||
@@ -49,6 +46,7 @@ namespace OpenSim.Data.MSSQL | |||
49 | /// </summary> | 46 | /// </summary> |
50 | public MSSQLManager database; | 47 | public MSSQLManager database; |
51 | 48 | ||
49 | [Obsolete("Cannot be default-initialized!")] | ||
52 | public void Initialise() | 50 | public void Initialise() |
53 | { | 51 | { |
54 | m_log.Info("[LOG DB]: " + Name + " cannot be default-initialized!"); | 52 | m_log.Info("[LOG DB]: " + Name + " cannot be default-initialized!"); |
@@ -60,7 +58,7 @@ namespace OpenSim.Data.MSSQL | |||
60 | /// </summary> | 58 | /// </summary> |
61 | public void Initialise(string connect) | 59 | public void Initialise(string connect) |
62 | { | 60 | { |
63 | if (string.IsNullOrEmpty(connect)) | 61 | if (!string.IsNullOrEmpty(connect)) |
64 | { | 62 | { |
65 | database = new MSSQLManager(connect); | 63 | database = new MSSQLManager(connect); |
66 | } | 64 | } |
@@ -79,62 +77,11 @@ namespace OpenSim.Data.MSSQL | |||
79 | settingPassword); | 77 | settingPassword); |
80 | } | 78 | } |
81 | 79 | ||
82 | //TODO when can this be removed | ||
83 | TestTable(); | ||
84 | |||
85 | //Updating mechanisme | 80 | //Updating mechanisme |
86 | database.CheckMigration(_migrationStore); | 81 | database.CheckMigration(_migrationStore); |
87 | } | 82 | } |
88 | 83 | ||
89 | /// <summary> | 84 | /// <summary> |
90 | /// Can be removed someday!!! | ||
91 | /// </summary> | ||
92 | private void TestTable() | ||
93 | { | ||
94 | using (IDbCommand cmd = database.Query("select top 1 * from logs", new Dictionary<string, string>())) | ||
95 | { | ||
96 | try | ||
97 | { | ||
98 | cmd.ExecuteNonQuery(); | ||
99 | } | ||
100 | catch | ||
101 | { | ||
102 | database.ExecuteResourceSql("Mssql-logs.sql"); | ||
103 | } | ||
104 | } | ||
105 | using (AutoClosingSqlCommand cmd = database.Query("select * from migrations where name = '" + _migrationStore + "'")) | ||
106 | { | ||
107 | //Special for Migrations to create backword compatible | ||
108 | try | ||
109 | { | ||
110 | bool insert = true; | ||
111 | using (SqlDataReader reader = cmd.ExecuteReader()) | ||
112 | { | ||
113 | if (reader.Read()) insert = false; | ||
114 | } | ||
115 | if (insert) | ||
116 | { | ||
117 | cmd.CommandText = "insert into migrations(name, version) values('" + _migrationStore + "', 1)"; | ||
118 | cmd.ExecuteNonQuery(); | ||
119 | } | ||
120 | } | ||
121 | catch | ||
122 | { | ||
123 | //No migrations table | ||
124 | //HACK create one and add data | ||
125 | cmd.CommandText = "create table migrations(name varchar(100), version int)"; | ||
126 | cmd.ExecuteNonQuery(); | ||
127 | |||
128 | cmd.CommandText = "insert into migrations(name, version) values('migrations', 1)"; | ||
129 | cmd.ExecuteNonQuery(); | ||
130 | |||
131 | cmd.CommandText = "insert into migrations(name, version) values('" + _migrationStore + "', 1)"; | ||
132 | cmd.ExecuteNonQuery(); | ||
133 | } | ||
134 | } | ||
135 | } | ||
136 | |||
137 | /// <summary> | ||
138 | /// Saves a log item to the database | 85 | /// Saves a log item to the database |
139 | /// </summary> | 86 | /// </summary> |
140 | /// <param name="serverDaemon">The daemon triggering the event</param> | 87 | /// <param name="serverDaemon">The daemon triggering the event</param> |
diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs index be50cc6..95f6037 100644 --- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs | |||
@@ -73,7 +73,7 @@ namespace OpenSim.Data.MSSQL | |||
73 | /// <param name="connectionString">The connection string.</param> | 73 | /// <param name="connectionString">The connection string.</param> |
74 | public void Initialise(string connectionString) | 74 | public void Initialise(string connectionString) |
75 | { | 75 | { |
76 | if (string.IsNullOrEmpty(connectionString)) | 76 | if (!string.IsNullOrEmpty(connectionString)) |
77 | { | 77 | { |
78 | //Add MSSQLManager (dont know if we need it) | 78 | //Add MSSQLManager (dont know if we need it) |
79 | _Database = new MSSQLManager(connectionString); | 79 | _Database = new MSSQLManager(connectionString); |
diff --git a/OpenSim/Data/MSSQL/MSSQLUserData.cs b/OpenSim/Data/MSSQL/MSSQLUserData.cs index 22b3c94..2016ae3 100644 --- a/OpenSim/Data/MSSQL/MSSQLUserData.cs +++ b/OpenSim/Data/MSSQL/MSSQLUserData.cs | |||
@@ -55,6 +55,7 @@ namespace OpenSim.Data.MSSQL | |||
55 | private const string m_usersTableName = "users"; | 55 | private const string m_usersTableName = "users"; |
56 | private const string m_userFriendsTableName = "userfriends"; | 56 | private const string m_userFriendsTableName = "userfriends"; |
57 | 57 | ||
58 | [Obsolete("Cannot be default-initialized!")] | ||
58 | override public void Initialise() | 59 | override public void Initialise() |
59 | { | 60 | { |
60 | m_log.Info("[MSSQLUserData]: " + Name + " cannot be default-initialized!"); | 61 | m_log.Info("[MSSQLUserData]: " + Name + " cannot be default-initialized!"); |
@@ -69,7 +70,7 @@ namespace OpenSim.Data.MSSQL | |||
69 | override public void Initialise(string connect) | 70 | override public void Initialise(string connect) |
70 | { | 71 | { |
71 | 72 | ||
72 | if (string.IsNullOrEmpty(connect)) | 73 | if (!string.IsNullOrEmpty(connect)) |
73 | { | 74 | { |
74 | database = new MSSQLManager(connect); | 75 | database = new MSSQLManager(connect); |
75 | } | 76 | } |
@@ -86,27 +87,6 @@ namespace OpenSim.Data.MSSQL | |||
86 | database = new MSSQLManager(settingDataSource, settingInitialCatalog, settingPersistSecurityInfo, settingUserId, settingPassword); | 87 | database = new MSSQLManager(settingDataSource, settingInitialCatalog, settingPersistSecurityInfo, settingUserId, settingPassword); |
87 | } | 88 | } |
88 | 89 | ||
89 | // m_usersTableName = iniFile.ParseFileReadValue("userstablename"); | ||
90 | // if (m_usersTableName == null) | ||
91 | // { | ||
92 | // m_usersTableName = "users"; | ||
93 | // } | ||
94 | // | ||
95 | // m_userFriendsTableName = iniFile.ParseFileReadValue("userfriendstablename"); | ||
96 | // if (m_userFriendsTableName == null) | ||
97 | // { | ||
98 | // m_userFriendsTableName = "userfriends"; | ||
99 | // } | ||
100 | // | ||
101 | // m_agentsTableName = iniFile.ParseFileReadValue("agentstablename"); | ||
102 | // if (m_agentsTableName == null) | ||
103 | // { | ||
104 | // m_agentsTableName = "agents"; | ||
105 | // } | ||
106 | |||
107 | //TODO this can be removed at one time!!!!! | ||
108 | TestTables(); | ||
109 | |||
110 | //Check migration on DB | 90 | //Check migration on DB |
111 | database.CheckMigration(_migrationStore); | 91 | database.CheckMigration(_migrationStore); |
112 | } | 92 | } |
@@ -116,93 +96,6 @@ namespace OpenSim.Data.MSSQL | |||
116 | /// </summary> | 96 | /// </summary> |
117 | override public void Dispose() { } | 97 | override public void Dispose() { } |
118 | 98 | ||
119 | /// <summary> | ||
120 | /// Can be deleted at one time! | ||
121 | /// </summary> | ||
122 | /// <returns></returns> | ||
123 | private void TestTables() | ||
124 | { | ||
125 | using (IDbCommand cmd = database.Query("select top 1 * from " + m_usersTableName)) | ||
126 | { | ||
127 | try | ||
128 | { | ||
129 | cmd.ExecuteNonQuery(); | ||
130 | } | ||
131 | catch | ||
132 | { | ||
133 | database.ExecuteResourceSql("Mssql-users.sql"); | ||
134 | } | ||
135 | } | ||
136 | |||
137 | using (IDbCommand cmd = database.Query("select top 1 * from " + m_agentsTableName, new Dictionary<string, string>())) | ||
138 | { | ||
139 | try | ||
140 | { | ||
141 | cmd.ExecuteNonQuery(); | ||
142 | } | ||
143 | catch | ||
144 | { | ||
145 | database.ExecuteResourceSql("Mssql-agents.sql"); | ||
146 | } | ||
147 | } | ||
148 | |||
149 | using (IDbCommand cmd = database.Query("select top 1 * from " + m_userFriendsTableName, new Dictionary<string, string>())) | ||
150 | { | ||
151 | try | ||
152 | { | ||
153 | cmd.ExecuteNonQuery(); | ||
154 | } | ||
155 | catch | ||
156 | { | ||
157 | database.ExecuteResourceSql("CreateUserFriendsTable.sql"); | ||
158 | } | ||
159 | } | ||
160 | |||
161 | using (IDbCommand cmd = database.Query("select top 1 * from avatarappearance", new Dictionary<string, string>())) | ||
162 | { | ||
163 | try | ||
164 | { | ||
165 | cmd.ExecuteNonQuery(); | ||
166 | } | ||
167 | catch | ||
168 | { | ||
169 | database.ExecuteResourceSql("AvatarAppearance.sql"); | ||
170 | } | ||
171 | } | ||
172 | |||
173 | //Special for Migrations | ||
174 | using (AutoClosingSqlCommand cmd = database.Query("select * from migrations where name = 'UserStore'")) | ||
175 | { | ||
176 | try | ||
177 | { | ||
178 | bool insert = true; | ||
179 | using (SqlDataReader reader = cmd.ExecuteReader()) | ||
180 | { | ||
181 | if (reader.Read()) insert = false; | ||
182 | } | ||
183 | if (insert) | ||
184 | { | ||
185 | cmd.CommandText = "insert into migrations(name, version) values('UserStore', 1)"; | ||
186 | cmd.ExecuteNonQuery(); | ||
187 | } | ||
188 | } | ||
189 | catch | ||
190 | { | ||
191 | //No migrations table | ||
192 | //HACK create one and add data | ||
193 | cmd.CommandText = "create table migrations(name varchar(100), version int)"; | ||
194 | cmd.ExecuteNonQuery(); | ||
195 | |||
196 | cmd.CommandText = "insert into migrations(name, version) values('migrations', 1)"; | ||
197 | cmd.ExecuteNonQuery(); | ||
198 | |||
199 | cmd.CommandText = "insert into migrations(name, version) values('UserStore', 1)"; | ||
200 | cmd.ExecuteNonQuery(); | ||
201 | } | ||
202 | } | ||
203 | return; | ||
204 | } | ||
205 | |||
206 | #region User table methods | 99 | #region User table methods |
207 | 100 | ||
208 | /// <summary> | 101 | /// <summary> |
@@ -679,7 +572,7 @@ namespace OpenSim.Data.MSSQL | |||
679 | /// <param name="appearance">the appearence</param> | 572 | /// <param name="appearance">the appearence</param> |
680 | override public void UpdateUserAppearance(UUID user, AvatarAppearance appearance) | 573 | override public void UpdateUserAppearance(UUID user, AvatarAppearance appearance) |
681 | { | 574 | { |
682 | m_log.Error("[USER DB] updating user appearance for user ID " + user.Guid.ToString()); | 575 | m_log.Error("[USER DB] updating user appearance for user ID " + user.Guid); |
683 | string sql = String.Empty; | 576 | string sql = String.Empty; |
684 | sql += "DELETE FROM avatarappearance WHERE owner=@owner "; | 577 | sql += "DELETE FROM avatarappearance WHERE owner=@owner "; |
685 | sql += "INSERT INTO avatarappearance "; | 578 | sql += "INSERT INTO avatarappearance "; |
@@ -1112,6 +1005,7 @@ ELSE | |||
1112 | /// <param name="uuid">User ID</param> | 1005 | /// <param name="uuid">User ID</param> |
1113 | /// <param name="username">First part of the login</param> | 1006 | /// <param name="username">First part of the login</param> |
1114 | /// <param name="lastname">Second part of the login</param> | 1007 | /// <param name="lastname">Second part of the login</param> |
1008 | /// <param name="email">Email of person</param> | ||
1115 | /// <param name="passwordHash">A salted hash of the users password</param> | 1009 | /// <param name="passwordHash">A salted hash of the users password</param> |
1116 | /// <param name="passwordSalt">The salt used for the password hash</param> | 1010 | /// <param name="passwordSalt">The salt used for the password hash</param> |
1117 | /// <param name="homeRegion">A regionHandle of the users home region</param> | 1011 | /// <param name="homeRegion">A regionHandle of the users home region</param> |
diff --git a/OpenSim/Data/MSSQL/Resources/001_UserStore.sql b/OpenSim/Data/MSSQL/Resources/001_UserStore.sql index abd6ff2..160c457 100644 --- a/OpenSim/Data/MSSQL/Resources/001_UserStore.sql +++ b/OpenSim/Data/MSSQL/Resources/001_UserStore.sql | |||
@@ -110,115 +110,3 @@ CREATE TABLE [avatarappearance] ( | |||
110 | [Owner] | 110 | [Owner] |
111 | ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | 111 | ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] |
112 | ) ON [PRIMARY] | 112 | ) ON [PRIMARY] |
113 | CREATE TABLE [users] ( | ||
114 | [UUID] [varchar](36) NOT NULL default '', | ||
115 | [username] [varchar](32) NOT NULL, | ||
116 | [lastname] [varchar](32) NOT NULL, | ||
117 | [passwordHash] [varchar](32) NOT NULL, | ||
118 | [passwordSalt] [varchar](32) NOT NULL, | ||
119 | [homeRegion] [bigint] default NULL, | ||
120 | [homeLocationX] [float] default NULL, | ||
121 | [homeLocationY] [float] default NULL, | ||
122 | [homeLocationZ] [float] default NULL, | ||
123 | [homeLookAtX] [float] default NULL, | ||
124 | [homeLookAtY] [float] default NULL, | ||
125 | [homeLookAtZ] [float] default NULL, | ||
126 | [created] [int] NOT NULL, | ||
127 | [lastLogin] [int] NOT NULL, | ||
128 | [userInventoryURI] [varchar](255) default NULL, | ||
129 | [userAssetURI] [varchar](255) default NULL, | ||
130 | [profileCanDoMask] [int] default NULL, | ||
131 | [profileWantDoMask] [int] default NULL, | ||
132 | [profileAboutText] [ntext], | ||
133 | [profileFirstText] [ntext], | ||
134 | [profileImage] [varchar](36) default NULL, | ||
135 | [profileFirstImage] [varchar](36) default NULL, | ||
136 | [webLoginKey] [varchar](36) default NULL, | ||
137 | PRIMARY KEY CLUSTERED | ||
138 | ( | ||
139 | [UUID] ASC | ||
140 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
141 | ) ON [PRIMARY] | ||
142 | |||
143 | |||
144 | CREATE NONCLUSTERED INDEX [usernames] ON [users] | ||
145 | ( | ||
146 | [username] ASC, | ||
147 | [lastname] ASC | ||
148 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
149 | |||
150 | |||
151 | CREATE TABLE [agents] ( | ||
152 | [UUID] [varchar](36) NOT NULL, | ||
153 | [sessionID] [varchar](36) NOT NULL, | ||
154 | [secureSessionID] [varchar](36) NOT NULL, | ||
155 | [agentIP] [varchar](16) NOT NULL, | ||
156 | [agentPort] [int] NOT NULL, | ||
157 | [agentOnline] [tinyint] NOT NULL, | ||
158 | [loginTime] [int] NOT NULL, | ||
159 | [logoutTime] [int] NOT NULL, | ||
160 | [currentRegion] [varchar](36) NOT NULL, | ||
161 | [currentHandle] [bigint] NOT NULL, | ||
162 | [currentPos] [varchar](64) NOT NULL, | ||
163 | PRIMARY KEY CLUSTERED | ||
164 | ( | ||
165 | [UUID] ASC | ||
166 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
167 | ) ON [PRIMARY] | ||
168 | |||
169 | |||
170 | CREATE NONCLUSTERED INDEX [session] ON [agents] | ||
171 | ( | ||
172 | [sessionID] ASC | ||
173 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
174 | |||
175 | CREATE NONCLUSTERED INDEX [ssession] ON [agents] | ||
176 | ( | ||
177 | [secureSessionID] ASC | ||
178 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
179 | |||
180 | |||
181 | CREATE TABLE [dbo].[userfriends]( | ||
182 | [ownerID] [varchar](50) COLLATE Latin1_General_CI_AS NOT NULL, | ||
183 | [friendID] [varchar](50) COLLATE Latin1_General_CI_AS NOT NULL, | ||
184 | [friendPerms] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
185 | [datetimestamp] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL | ||
186 | ) ON [PRIMARY] | ||
187 | |||
188 | CREATE TABLE [avatarappearance] ( | ||
189 | [Owner] [varchar](36) NOT NULL, | ||
190 | [Serial] int NOT NULL, | ||
191 | [Visual_Params] [image] NOT NULL, | ||
192 | [Texture] [image] NOT NULL, | ||
193 | [Avatar_Height] float NOT NULL, | ||
194 | [Body_Item] [varchar](36) NOT NULL, | ||
195 | [Body_Asset] [varchar](36) NOT NULL, | ||
196 | [Skin_Item] [varchar](36) NOT NULL, | ||
197 | [Skin_Asset] [varchar](36) NOT NULL, | ||
198 | [Hair_Item] [varchar](36) NOT NULL, | ||
199 | [Hair_Asset] [varchar](36) NOT NULL, | ||
200 | [Eyes_Item] [varchar](36) NOT NULL, | ||
201 | [Eyes_Asset] [varchar](36) NOT NULL, | ||
202 | [Shirt_Item] [varchar](36) NOT NULL, | ||
203 | [Shirt_Asset] [varchar](36) NOT NULL, | ||
204 | [Pants_Item] [varchar](36) NOT NULL, | ||
205 | [Pants_Asset] [varchar](36) NOT NULL, | ||
206 | [Shoes_Item] [varchar](36) NOT NULL, | ||
207 | [Shoes_Asset] [varchar](36) NOT NULL, | ||
208 | [Socks_Item] [varchar](36) NOT NULL, | ||
209 | [Socks_Asset] [varchar](36) NOT NULL, | ||
210 | [Jacket_Item] [varchar](36) NOT NULL, | ||
211 | [Jacket_Asset] [varchar](36) NOT NULL, | ||
212 | [Gloves_Item] [varchar](36) NOT NULL, | ||
213 | [Gloves_Asset] [varchar](36) NOT NULL, | ||
214 | [Undershirt_Item] [varchar](36) NOT NULL, | ||
215 | [Undershirt_Asset] [varchar](36) NOT NULL, | ||
216 | [Underpants_Item] [varchar](36) NOT NULL, | ||
217 | [Underpants_Asset] [varchar](36) NOT NULL, | ||
218 | [Skirt_Item] [varchar](36) NOT NULL, | ||
219 | [Skirt_Asset] [varchar](36) NOT NULL, | ||
220 | |||
221 | PRIMARY KEY CLUSTERED ( | ||
222 | [Owner] | ||
223 | ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
224 | ) ON [PRIMARY] | ||
diff --git a/OpenSim/Data/MSSQL/Resources/AvatarAppearance.sql b/OpenSim/Data/MSSQL/Resources/AvatarAppearance.sql index 1639f56..e69de29 100644 --- a/OpenSim/Data/MSSQL/Resources/AvatarAppearance.sql +++ b/OpenSim/Data/MSSQL/Resources/AvatarAppearance.sql | |||
@@ -1,47 +0,0 @@ | |||
1 | -- | ||
2 | -- Create schema avatar_appearance | ||
3 | -- | ||
4 | |||
5 | SET ANSI_NULLS ON | ||
6 | SET QUOTED_IDENTIFIER ON | ||
7 | SET ANSI_PADDING ON | ||
8 | |||
9 | CREATE TABLE [avatarappearance] ( | ||
10 | [Owner] [varchar](36) NOT NULL, | ||
11 | [Serial] int NOT NULL, | ||
12 | [Visual_Params] [image] NOT NULL, | ||
13 | [Texture] [image] NOT NULL, | ||
14 | [Avatar_Height] float NOT NULL, | ||
15 | [Body_Item] [varchar](36) NOT NULL, | ||
16 | [Body_Asset] [varchar](36) NOT NULL, | ||
17 | [Skin_Item] [varchar](36) NOT NULL, | ||
18 | [Skin_Asset] [varchar](36) NOT NULL, | ||
19 | [Hair_Item] [varchar](36) NOT NULL, | ||
20 | [Hair_Asset] [varchar](36) NOT NULL, | ||
21 | [Eyes_Item] [varchar](36) NOT NULL, | ||
22 | [Eyes_Asset] [varchar](36) NOT NULL, | ||
23 | [Shirt_Item] [varchar](36) NOT NULL, | ||
24 | [Shirt_Asset] [varchar](36) NOT NULL, | ||
25 | [Pants_Item] [varchar](36) NOT NULL, | ||
26 | [Pants_Asset] [varchar](36) NOT NULL, | ||
27 | [Shoes_Item] [varchar](36) NOT NULL, | ||
28 | [Shoes_Asset] [varchar](36) NOT NULL, | ||
29 | [Socks_Item] [varchar](36) NOT NULL, | ||
30 | [Socks_Asset] [varchar](36) NOT NULL, | ||
31 | [Jacket_Item] [varchar](36) NOT NULL, | ||
32 | [Jacket_Asset] [varchar](36) NOT NULL, | ||
33 | [Gloves_Item] [varchar](36) NOT NULL, | ||
34 | [Gloves_Asset] [varchar](36) NOT NULL, | ||
35 | [Undershirt_Item] [varchar](36) NOT NULL, | ||
36 | [Undershirt_Asset] [varchar](36) NOT NULL, | ||
37 | [Underpants_Item] [varchar](36) NOT NULL, | ||
38 | [Underpants_Asset] [varchar](36) NOT NULL, | ||
39 | [Skirt_Item] [varchar](36) NOT NULL, | ||
40 | [Skirt_Asset] [varchar](36) NOT NULL, | ||
41 | |||
42 | PRIMARY KEY CLUSTERED ( | ||
43 | [Owner] | ||
44 | ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
45 | ) ON [PRIMARY] | ||
46 | |||
47 | SET ANSI_PADDING OFF | ||
diff --git a/OpenSim/Data/MSSQL/Resources/CreateAssetsTable.sql b/OpenSim/Data/MSSQL/Resources/CreateAssetsTable.sql index 4d94699..e69de29 100644 --- a/OpenSim/Data/MSSQL/Resources/CreateAssetsTable.sql +++ b/OpenSim/Data/MSSQL/Resources/CreateAssetsTable.sql | |||
@@ -1,18 +0,0 @@ | |||
1 | SET ANSI_NULLS ON | ||
2 | SET QUOTED_IDENTIFIER ON | ||
3 | SET ANSI_PADDING ON | ||
4 | CREATE TABLE [assets] ( | ||
5 | [id] [varchar](36) NOT NULL, | ||
6 | [name] [varchar](64) NOT NULL, | ||
7 | [description] [varchar](64) NOT NULL, | ||
8 | [assetType] [tinyint] NOT NULL, | ||
9 | [local] [tinyint] NOT NULL, | ||
10 | [temporary] [tinyint] NOT NULL, | ||
11 | [data] [image] NOT NULL, | ||
12 | PRIMARY KEY CLUSTERED | ||
13 | ( | ||
14 | [id] ASC | ||
15 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
16 | ) ON [PRIMARY] | ||
17 | |||
18 | SET ANSI_PADDING OFF | ||
diff --git a/OpenSim/Data/MSSQL/Resources/CreateFoldersTable.sql b/OpenSim/Data/MSSQL/Resources/CreateFoldersTable.sql index 95d183a..e69de29 100644 --- a/OpenSim/Data/MSSQL/Resources/CreateFoldersTable.sql +++ b/OpenSim/Data/MSSQL/Resources/CreateFoldersTable.sql | |||
@@ -1,27 +0,0 @@ | |||
1 | SET ANSI_NULLS ON | ||
2 | SET QUOTED_IDENTIFIER ON | ||
3 | SET ANSI_PADDING ON | ||
4 | CREATE TABLE [inventoryfolders] ( | ||
5 | [folderID] [varchar](36) NOT NULL default '', | ||
6 | [agentID] [varchar](36) default NULL, | ||
7 | [parentFolderID] [varchar](36) default NULL, | ||
8 | [folderName] [varchar](64) default NULL, | ||
9 | [type] [smallint] NOT NULL default 0, | ||
10 | [version] [int] NOT NULL default 0, | ||
11 | PRIMARY KEY CLUSTERED | ||
12 | ( | ||
13 | [folderID] ASC | ||
14 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
15 | ) ON [PRIMARY] | ||
16 | |||
17 | CREATE NONCLUSTERED INDEX [owner] ON [inventoryfolders] | ||
18 | ( | ||
19 | [agentID] ASC | ||
20 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
21 | |||
22 | CREATE NONCLUSTERED INDEX [parent] ON [inventoryfolders] | ||
23 | ( | ||
24 | [parentFolderID] ASC | ||
25 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
26 | |||
27 | SET ANSI_PADDING OFF | ||
diff --git a/OpenSim/Data/MSSQL/Resources/CreateItemsTable.sql b/OpenSim/Data/MSSQL/Resources/CreateItemsTable.sql index c3b0cb1..e69de29 100644 --- a/OpenSim/Data/MSSQL/Resources/CreateItemsTable.sql +++ b/OpenSim/Data/MSSQL/Resources/CreateItemsTable.sql | |||
@@ -1,46 +0,0 @@ | |||
1 | SET ANSI_NULLS ON | ||
2 | |||
3 | SET QUOTED_IDENTIFIER ON | ||
4 | |||
5 | SET ANSI_PADDING ON | ||
6 | |||
7 | CREATE TABLE [inventoryitems] ( | ||
8 | [inventoryID] [varchar](36) NOT NULL default '', | ||
9 | [assetID] [varchar](36) default NULL, | ||
10 | [assetType] [int] default NULL, | ||
11 | [parentFolderID] [varchar](36) default NULL, | ||
12 | [avatarID] [varchar](36) default NULL, | ||
13 | [inventoryName] [varchar](64) default NULL, | ||
14 | [inventoryDescription] [varchar](128) default NULL, | ||
15 | [inventoryNextPermissions] [int] default NULL, | ||
16 | [inventoryCurrentPermissions] [int] default NULL, | ||
17 | [invType] [int] default NULL, | ||
18 | [creatorID] [varchar](36) default NULL, | ||
19 | [inventoryBasePermissions] [int] NOT NULL default 0, | ||
20 | [inventoryEveryOnePermissions] [int] NOT NULL default 0, | ||
21 | [salePrice] [int] default NULL, | ||
22 | [saleType] [tinyint] default NULL, | ||
23 | [creationDate] [int] default NULL, | ||
24 | [groupID] [varchar](36) default NULL, | ||
25 | [groupOwned] [bit] default NULL, | ||
26 | [flags] [int] default NULL, | ||
27 | PRIMARY KEY CLUSTERED | ||
28 | ( | ||
29 | [inventoryID] ASC | ||
30 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
31 | ) ON [PRIMARY] | ||
32 | |||
33 | |||
34 | CREATE NONCLUSTERED INDEX [owner] ON [inventoryitems] | ||
35 | ( | ||
36 | [avatarID] ASC | ||
37 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
38 | |||
39 | CREATE NONCLUSTERED INDEX [folder] ON [inventoryitems] | ||
40 | ( | ||
41 | [parentFolderID] ASC | ||
42 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
43 | |||
44 | SET ANSI_PADDING OFF | ||
45 | |||
46 | |||
diff --git a/OpenSim/Data/MSSQL/Resources/CreateUserFriendsTable.sql b/OpenSim/Data/MSSQL/Resources/CreateUserFriendsTable.sql index 6f5885e..e69de29 100644 --- a/OpenSim/Data/MSSQL/Resources/CreateUserFriendsTable.sql +++ b/OpenSim/Data/MSSQL/Resources/CreateUserFriendsTable.sql | |||
@@ -1,14 +0,0 @@ | |||
1 | SET ANSI_NULLS ON | ||
2 | |||
3 | SET QUOTED_IDENTIFIER ON | ||
4 | |||
5 | SET ANSI_PADDING ON | ||
6 | |||
7 | CREATE TABLE [dbo].[userfriends]( | ||
8 | [ownerID] [varchar](50) COLLATE Latin1_General_CI_AS NOT NULL, | ||
9 | [friendID] [varchar](50) COLLATE Latin1_General_CI_AS NOT NULL, | ||
10 | [friendPerms] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
11 | [datetimestamp] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL | ||
12 | ) ON [PRIMARY] | ||
13 | |||
14 | SET ANSI_PADDING OFF | ||
diff --git a/OpenSim/Data/MSSQL/Resources/Mssql-agents.sql b/OpenSim/Data/MSSQL/Resources/Mssql-agents.sql index ad53173..e69de29 100644 --- a/OpenSim/Data/MSSQL/Resources/Mssql-agents.sql +++ b/OpenSim/Data/MSSQL/Resources/Mssql-agents.sql | |||
@@ -1,37 +0,0 @@ | |||
1 | SET ANSI_NULLS ON | ||
2 | |||
3 | SET QUOTED_IDENTIFIER ON | ||
4 | |||
5 | SET ANSI_PADDING ON | ||
6 | |||
7 | CREATE TABLE [agents] ( | ||
8 | [UUID] [varchar](36) NOT NULL, | ||
9 | [sessionID] [varchar](36) NOT NULL, | ||
10 | [secureSessionID] [varchar](36) NOT NULL, | ||
11 | [agentIP] [varchar](16) NOT NULL, | ||
12 | [agentPort] [int] NOT NULL, | ||
13 | [agentOnline] [tinyint] NOT NULL, | ||
14 | [loginTime] [int] NOT NULL, | ||
15 | [logoutTime] [int] NOT NULL, | ||
16 | [currentRegion] [varchar](36) NOT NULL, | ||
17 | [currentHandle] [bigint] NOT NULL, | ||
18 | [currentPos] [varchar](64) NOT NULL, | ||
19 | PRIMARY KEY CLUSTERED | ||
20 | ( | ||
21 | [UUID] ASC | ||
22 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
23 | ) ON [PRIMARY] | ||
24 | |||
25 | |||
26 | CREATE NONCLUSTERED INDEX [session] ON [agents] | ||
27 | ( | ||
28 | [sessionID] ASC | ||
29 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
30 | |||
31 | CREATE NONCLUSTERED INDEX [ssession] ON [agents] | ||
32 | ( | ||
33 | [secureSessionID] ASC | ||
34 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
35 | |||
36 | SET ANSI_PADDING OFF | ||
37 | |||
diff --git a/OpenSim/Data/MSSQL/Resources/Mssql-logs.sql b/OpenSim/Data/MSSQL/Resources/Mssql-logs.sql index 3b747d8..e69de29 100644 --- a/OpenSim/Data/MSSQL/Resources/Mssql-logs.sql +++ b/OpenSim/Data/MSSQL/Resources/Mssql-logs.sql | |||
@@ -1,20 +0,0 @@ | |||
1 | SET ANSI_NULLS ON | ||
2 | |||
3 | SET QUOTED_IDENTIFIER ON | ||
4 | |||
5 | SET ANSI_PADDING ON | ||
6 | |||
7 | CREATE TABLE [logs] ( | ||
8 | [logID] [int] NOT NULL, | ||
9 | [target] [varchar](36) default NULL, | ||
10 | [server] [varchar](64) default NULL, | ||
11 | [method] [varchar](64) default NULL, | ||
12 | [arguments] [varchar](255) default NULL, | ||
13 | [priority] [int] default NULL, | ||
14 | [message] [ntext], | ||
15 | PRIMARY KEY CLUSTERED | ||
16 | ( | ||
17 | [logID] ASC | ||
18 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
19 | ) ON [PRIMARY] | ||
20 | |||
diff --git a/OpenSim/Data/MSSQL/Resources/Mssql-regions.sql b/OpenSim/Data/MSSQL/Resources/Mssql-regions.sql index b29a2ab..e69de29 100644 --- a/OpenSim/Data/MSSQL/Resources/Mssql-regions.sql +++ b/OpenSim/Data/MSSQL/Resources/Mssql-regions.sql | |||
@@ -1,41 +0,0 @@ | |||
1 | SET ANSI_NULLS ON | ||
2 | |||
3 | SET QUOTED_IDENTIFIER ON | ||
4 | |||
5 | SET ANSI_PADDING ON | ||
6 | |||
7 | CREATE TABLE [dbo].[regions]( | ||
8 | [regionHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
9 | [regionName] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
10 | [uuid] [varchar](255) COLLATE Latin1_General_CI_AS NOT NULL, | ||
11 | [regionRecvKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
12 | [regionSecret] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
13 | [regionSendKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
14 | [regionDataURI] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
15 | [serverIP] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
16 | [serverPort] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
17 | [serverURI] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
18 | [locX] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
19 | [locY] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
20 | [locZ] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
21 | [eastOverrideHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
22 | [westOverrideHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
23 | [southOverrideHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
24 | [northOverrideHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
25 | [regionAssetURI] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
26 | [regionAssetRecvKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
27 | [regionAssetSendKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
28 | [regionUserURI] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
29 | [regionUserRecvKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
30 | [regionUserSendKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
31 | [regionMapTexture] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
32 | [serverHttpPort] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
33 | [serverRemotingPort] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
34 | [owner_uuid] [varchar](36) COLLATE Latin1_General_CI_AS NULL, | ||
35 | PRIMARY KEY CLUSTERED | ||
36 | ( | ||
37 | [uuid] ASC | ||
38 | )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] | ||
39 | ) ON [PRIMARY] | ||
40 | |||
41 | SET ANSI_PADDING OFF | ||
diff --git a/OpenSim/Data/MSSQL/Resources/Mssql-users.sql b/OpenSim/Data/MSSQL/Resources/Mssql-users.sql index abcc091..e69de29 100644 --- a/OpenSim/Data/MSSQL/Resources/Mssql-users.sql +++ b/OpenSim/Data/MSSQL/Resources/Mssql-users.sql | |||
@@ -1,42 +0,0 @@ | |||
1 | SET ANSI_NULLS ON | ||
2 | |||
3 | SET QUOTED_IDENTIFIER ON | ||
4 | |||
5 | SET ANSI_PADDING ON | ||
6 | |||
7 | CREATE TABLE [users] ( | ||
8 | [UUID] [varchar](36) NOT NULL default '', | ||
9 | [username] [varchar](32) NOT NULL, | ||
10 | [lastname] [varchar](32) NOT NULL, | ||
11 | [passwordHash] [varchar](32) NOT NULL, | ||
12 | [passwordSalt] [varchar](32) NOT NULL, | ||
13 | [homeRegion] [bigint] default NULL, | ||
14 | [homeLocationX] [float] default NULL, | ||
15 | [homeLocationY] [float] default NULL, | ||
16 | [homeLocationZ] [float] default NULL, | ||
17 | [homeLookAtX] [float] default NULL, | ||
18 | [homeLookAtY] [float] default NULL, | ||
19 | [homeLookAtZ] [float] default NULL, | ||
20 | [created] [int] NOT NULL, | ||
21 | [lastLogin] [int] NOT NULL, | ||
22 | [userInventoryURI] [varchar](255) default NULL, | ||
23 | [userAssetURI] [varchar](255) default NULL, | ||
24 | [profileCanDoMask] [int] default NULL, | ||
25 | [profileWantDoMask] [int] default NULL, | ||
26 | [profileAboutText] [ntext], | ||
27 | [profileFirstText] [ntext], | ||
28 | [profileImage] [varchar](36) default NULL, | ||
29 | [profileFirstImage] [varchar](36) default NULL, | ||
30 | [webLoginKey] [varchar](36) default NULL, | ||
31 | PRIMARY KEY CLUSTERED | ||
32 | ( | ||
33 | [UUID] ASC | ||
34 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
35 | ) ON [PRIMARY] | ||
36 | |||
37 | |||
38 | CREATE NONCLUSTERED INDEX [usernames] ON [users] | ||
39 | ( | ||
40 | [username] ASC, | ||
41 | [lastname] ASC | ||
42 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||