From 9a6cdf662b60e7d6f6843826da6a84637d4798b9 Mon Sep 17 00:00:00 2001 From: Homer Horwitz Date: Sat, 15 Nov 2008 21:27:10 +0000 Subject: Mantis#2626: Thank you Ruud Lathrop, for a patch that cleans up MSSQL code. --- OpenSim/Data/MSSQL/MSSQLAssetData.cs | 75 +------------- OpenSim/Data/MSSQL/MSSQLEstateData.cs | 2 +- OpenSim/Data/MSSQL/MSSQLGridData.cs | 55 +--------- OpenSim/Data/MSSQL/MSSQLInventoryData.cs | 87 +--------------- OpenSim/Data/MSSQL/MSSQLLogData.cs | 57 +---------- OpenSim/Data/MSSQL/MSSQLRegionData.cs | 2 +- OpenSim/Data/MSSQL/MSSQLUserData.cs | 114 +-------------------- OpenSim/Data/MSSQL/Resources/001_UserStore.sql | 112 -------------------- OpenSim/Data/MSSQL/Resources/AvatarAppearance.sql | 47 --------- OpenSim/Data/MSSQL/Resources/CreateAssetsTable.sql | 18 ---- .../Data/MSSQL/Resources/CreateFoldersTable.sql | 27 ----- OpenSim/Data/MSSQL/Resources/CreateItemsTable.sql | 46 --------- .../MSSQL/Resources/CreateUserFriendsTable.sql | 14 --- OpenSim/Data/MSSQL/Resources/Mssql-agents.sql | 37 ------- OpenSim/Data/MSSQL/Resources/Mssql-logs.sql | 20 ---- OpenSim/Data/MSSQL/Resources/Mssql-regions.sql | 41 -------- OpenSim/Data/MSSQL/Resources/Mssql-users.sql | 42 -------- 17 files changed, 14 insertions(+), 782 deletions(-) (limited to 'OpenSim/Data') 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 @@ */ using System; -using System.Collections.Generic; using System.Data; -using System.Data.SqlClient; using System.Reflection; using OpenMetaverse; using log4net; @@ -57,6 +55,7 @@ namespace OpenSim.Data.MSSQL /// /// Initialises asset interface /// + [Obsolete("Cannot be default-initialized!")] override public void Initialise() { m_log.Info("[MSSQLUserData]: " + Name + " cannot be default-initialized!"); @@ -72,7 +71,7 @@ namespace OpenSim.Data.MSSQL /// connect string override public void Initialise(string connectionString) { - if (string.IsNullOrEmpty(connectionString)) + if (!string.IsNullOrEmpty(connectionString)) { database = new MSSQLManager(connectionString); } @@ -91,9 +90,6 @@ namespace OpenSim.Data.MSSQL settingPassword); } - //TODO can be removed at some time!! - TestTables(); - //New migration to check for DB changes database.CheckMigration(_migrationStore); } @@ -228,72 +224,5 @@ namespace OpenSim.Data.MSSQL } #endregion - - #region Private Methods - - /// - /// Migration method - /// - /// Execute "CreateAssetsTable.sql" if tableName == null - /// - /// - /// Name of table - private void UpgradeAssetsTable(string tableName) - { - // null as the version, indicates that the table didn't exist - if (tableName == null) - { - m_log.Info("[ASSET DB]: Creating new database tables"); - database.ExecuteResourceSql("CreateAssetsTable.sql"); - return; - } - } - - /// - /// Ensure that the assets related tables exists and are at the latest version - /// - private void TestTables() - { - Dictionary tableList = new Dictionary(); - - tableList["assets"] = null; - database.GetTableVersion(tableList); - - UpgradeAssetsTable(tableList["assets"]); - - //Special for Migrations - using (AutoClosingSqlCommand cmd = database.Query("select * from migrations where name = '" + _migrationStore + "'")) - { - try - { - bool insert = true; - using (SqlDataReader reader = cmd.ExecuteReader()) - { - if (reader.Read()) insert = false; - } - if (insert) - { - cmd.CommandText = "insert into migrations(name, version) values('" + _migrationStore + "', 1)"; - cmd.ExecuteNonQuery(); - } - } - catch - { - //No migrations table - //HACK create one and add data - cmd.CommandText = "create table migrations(name varchar(100), version int)"; - cmd.ExecuteNonQuery(); - - cmd.CommandText = "insert into migrations(name, version) values('migrations', 1)"; - cmd.ExecuteNonQuery(); - - cmd.CommandText = "insert into migrations(name, version) values('" + _migrationStore + "', 1)"; - cmd.ExecuteNonQuery(); - } - } - - } - - #endregion } } 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 /// connectionString. public void Initialise(string connectionString) { - if (string.IsNullOrEmpty(connectionString)) + if (!string.IsNullOrEmpty(connectionString)) { _Database = new MSSQLManager(connectionString); } 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 #region IPlugin Members + [Obsolete("Cannot be default-initialized!")] override public void Initialise() { m_log.Info("[GRID DB]: " + Name + " cannot be default-initialized!"); @@ -67,7 +68,7 @@ namespace OpenSim.Data.MSSQL /// use mssql_connection.ini override public void Initialise(string connectionString) { - if (string.IsNullOrEmpty(connectionString)) + if (!string.IsNullOrEmpty(connectionString)) { database = new MSSQLManager(connectionString); } @@ -93,63 +94,11 @@ namespace OpenSim.Data.MSSQL settingPassword); } - //TODO this can be removed at a certain time - TestTables(); - //New migrations check of store database.CheckMigration(_migrationStore); } /// - /// Test is region - /// - private void TestTables() - { - using (AutoClosingSqlCommand cmd = database.Query("SELECT TOP 1 * FROM " + m_regionsTableName, new Dictionary())) - { - try - { - cmd.ExecuteNonQuery(); - } - catch (Exception) - { - m_log.Info("[GRID DB]: MSSQL Database doesn't exist... creating"); - database.ExecuteResourceSql("Mssql-regions.sql"); - } - } - using (AutoClosingSqlCommand cmd = database.Query("select * from migrations where name = '" + _migrationStore + "'")) - { - //Special for Migrations to create backword compatible - try - { - bool insert = true; - using (SqlDataReader reader = cmd.ExecuteReader()) - { - if (reader.Read()) insert = false; - } - if (insert) - { - cmd.CommandText = "insert into migrations(name, version) values('" + _migrationStore + "', 1)"; - cmd.ExecuteNonQuery(); - } - } - catch - { - //No migrations table - //HACK create one and add data - cmd.CommandText = "create table migrations(name varchar(100), version int)"; - cmd.ExecuteNonQuery(); - - cmd.CommandText = "insert into migrations(name, version) values('migrations', 1)"; - cmd.ExecuteNonQuery(); - - cmd.CommandText = "insert into migrations(name, version) values('" + _migrationStore + "', 1)"; - cmd.ExecuteNonQuery(); - } - } - } - - /// /// Shuts down the grid interface /// 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 #region IPlugin members + [Obsolete("Cannot be default-initialized!")] public void Initialise() { m_log.Info("[MSSQLInventoryData]: " + Name + " cannot be default-initialized!"); @@ -65,7 +66,7 @@ namespace OpenSim.Data.MSSQL /// use mssql_connection.ini public void Initialise(string connectionString) { - if (string.IsNullOrEmpty(connectionString)) + if (!string.IsNullOrEmpty(connectionString)) { database = new MSSQLManager(connectionString); } @@ -83,94 +84,10 @@ namespace OpenSim.Data.MSSQL settingPassword); } - //TODO remove this at one point - TestTables(); - //New migrations check of store database.CheckMigration(_migrationStore); } - #region Test and initialization code - - /// - /// Execute "CreateFoldersTable.sql" if tableName == null - /// - /// the table name - private void UpgradeFoldersTable(string tableName) - { - // null as the version, indicates that the table didn't exist - if (tableName == null) - { - database.ExecuteResourceSql("CreateFoldersTable.sql"); - //database.ExecuteResourceSql("UpgradeFoldersTableToVersion2.sql"); - return; - } - } - - /// - /// Execute "CreateItemsTable.sql" if tableName = null - /// - /// the table name - private void UpgradeItemsTable(string tableName) - { - // null as the version, indicates that the table didn't exist - if (tableName == null) - { - database.ExecuteResourceSql("CreateItemsTable.sql"); - //database.ExecuteResourceSql("UpgradeItemsTableToVersion2.sql"); - return; - } - } - - /// - /// - /// - private void TestTables() - { - Dictionary tableList = new Dictionary(); - - tableList["inventoryfolders"] = null; - tableList["inventoryitems"] = null; - - database.GetTableVersion(tableList); - - UpgradeFoldersTable(tableList["inventoryfolders"]); - UpgradeItemsTable(tableList["inventoryitems"]); - - using (AutoClosingSqlCommand cmd = database.Query("select * from migrations where name = '" + _migrationStore + "'")) - { - //Special for Migrations to create backword compatible - try - { - bool insert = true; - using (SqlDataReader reader = cmd.ExecuteReader()) - { - if (reader.Read()) insert = false; - } - if (insert) - { - cmd.CommandText = "insert into migrations(name, version) values('" + _migrationStore + "', 1)"; - cmd.ExecuteNonQuery(); - } - } - catch - { - //No migrations table - //HACK create one and add data - cmd.CommandText = "create table migrations(name varchar(100), version int)"; - cmd.ExecuteNonQuery(); - - cmd.CommandText = "insert into migrations(name, version) values('migrations', 1)"; - cmd.ExecuteNonQuery(); - - cmd.CommandText = "insert into migrations(name, version) values('" + _migrationStore + "', 1)"; - cmd.ExecuteNonQuery(); - } - } - } - - #endregion - /// /// The name of this DB provider /// 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 @@ */ using System; -using System.Data.SqlClient; using System.Reflection; -using System.Collections.Generic; -using System.Data; using log4net; using OpenSim.Framework; @@ -49,6 +46,7 @@ namespace OpenSim.Data.MSSQL /// public MSSQLManager database; + [Obsolete("Cannot be default-initialized!")] public void Initialise() { m_log.Info("[LOG DB]: " + Name + " cannot be default-initialized!"); @@ -60,7 +58,7 @@ namespace OpenSim.Data.MSSQL /// public void Initialise(string connect) { - if (string.IsNullOrEmpty(connect)) + if (!string.IsNullOrEmpty(connect)) { database = new MSSQLManager(connect); } @@ -79,62 +77,11 @@ namespace OpenSim.Data.MSSQL settingPassword); } - //TODO when can this be removed - TestTable(); - //Updating mechanisme database.CheckMigration(_migrationStore); } /// - /// Can be removed someday!!! - /// - private void TestTable() - { - using (IDbCommand cmd = database.Query("select top 1 * from logs", new Dictionary())) - { - try - { - cmd.ExecuteNonQuery(); - } - catch - { - database.ExecuteResourceSql("Mssql-logs.sql"); - } - } - using (AutoClosingSqlCommand cmd = database.Query("select * from migrations where name = '" + _migrationStore + "'")) - { - //Special for Migrations to create backword compatible - try - { - bool insert = true; - using (SqlDataReader reader = cmd.ExecuteReader()) - { - if (reader.Read()) insert = false; - } - if (insert) - { - cmd.CommandText = "insert into migrations(name, version) values('" + _migrationStore + "', 1)"; - cmd.ExecuteNonQuery(); - } - } - catch - { - //No migrations table - //HACK create one and add data - cmd.CommandText = "create table migrations(name varchar(100), version int)"; - cmd.ExecuteNonQuery(); - - cmd.CommandText = "insert into migrations(name, version) values('migrations', 1)"; - cmd.ExecuteNonQuery(); - - cmd.CommandText = "insert into migrations(name, version) values('" + _migrationStore + "', 1)"; - cmd.ExecuteNonQuery(); - } - } - } - - /// /// Saves a log item to the database /// /// The daemon triggering the event 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 /// The connection string. public void Initialise(string connectionString) { - if (string.IsNullOrEmpty(connectionString)) + if (!string.IsNullOrEmpty(connectionString)) { //Add MSSQLManager (dont know if we need it) _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 private const string m_usersTableName = "users"; private const string m_userFriendsTableName = "userfriends"; + [Obsolete("Cannot be default-initialized!")] override public void Initialise() { m_log.Info("[MSSQLUserData]: " + Name + " cannot be default-initialized!"); @@ -69,7 +70,7 @@ namespace OpenSim.Data.MSSQL override public void Initialise(string connect) { - if (string.IsNullOrEmpty(connect)) + if (!string.IsNullOrEmpty(connect)) { database = new MSSQLManager(connect); } @@ -86,27 +87,6 @@ namespace OpenSim.Data.MSSQL database = new MSSQLManager(settingDataSource, settingInitialCatalog, settingPersistSecurityInfo, settingUserId, settingPassword); } -// m_usersTableName = iniFile.ParseFileReadValue("userstablename"); -// if (m_usersTableName == null) -// { -// m_usersTableName = "users"; -// } -// -// m_userFriendsTableName = iniFile.ParseFileReadValue("userfriendstablename"); -// if (m_userFriendsTableName == null) -// { -// m_userFriendsTableName = "userfriends"; -// } -// -// m_agentsTableName = iniFile.ParseFileReadValue("agentstablename"); -// if (m_agentsTableName == null) -// { -// m_agentsTableName = "agents"; -// } - - //TODO this can be removed at one time!!!!! - TestTables(); - //Check migration on DB database.CheckMigration(_migrationStore); } @@ -116,93 +96,6 @@ namespace OpenSim.Data.MSSQL /// override public void Dispose() { } - /// - /// Can be deleted at one time! - /// - /// - private void TestTables() - { - using (IDbCommand cmd = database.Query("select top 1 * from " + m_usersTableName)) - { - try - { - cmd.ExecuteNonQuery(); - } - catch - { - database.ExecuteResourceSql("Mssql-users.sql"); - } - } - - using (IDbCommand cmd = database.Query("select top 1 * from " + m_agentsTableName, new Dictionary())) - { - try - { - cmd.ExecuteNonQuery(); - } - catch - { - database.ExecuteResourceSql("Mssql-agents.sql"); - } - } - - using (IDbCommand cmd = database.Query("select top 1 * from " + m_userFriendsTableName, new Dictionary())) - { - try - { - cmd.ExecuteNonQuery(); - } - catch - { - database.ExecuteResourceSql("CreateUserFriendsTable.sql"); - } - } - - using (IDbCommand cmd = database.Query("select top 1 * from avatarappearance", new Dictionary())) - { - try - { - cmd.ExecuteNonQuery(); - } - catch - { - database.ExecuteResourceSql("AvatarAppearance.sql"); - } - } - - //Special for Migrations - using (AutoClosingSqlCommand cmd = database.Query("select * from migrations where name = 'UserStore'")) - { - try - { - bool insert = true; - using (SqlDataReader reader = cmd.ExecuteReader()) - { - if (reader.Read()) insert = false; - } - if (insert) - { - cmd.CommandText = "insert into migrations(name, version) values('UserStore', 1)"; - cmd.ExecuteNonQuery(); - } - } - catch - { - //No migrations table - //HACK create one and add data - cmd.CommandText = "create table migrations(name varchar(100), version int)"; - cmd.ExecuteNonQuery(); - - cmd.CommandText = "insert into migrations(name, version) values('migrations', 1)"; - cmd.ExecuteNonQuery(); - - cmd.CommandText = "insert into migrations(name, version) values('UserStore', 1)"; - cmd.ExecuteNonQuery(); - } - } - return; - } - #region User table methods /// @@ -679,7 +572,7 @@ namespace OpenSim.Data.MSSQL /// the appearence override public void UpdateUserAppearance(UUID user, AvatarAppearance appearance) { - m_log.Error("[USER DB] updating user appearance for user ID " + user.Guid.ToString()); + m_log.Error("[USER DB] updating user appearance for user ID " + user.Guid); string sql = String.Empty; sql += "DELETE FROM avatarappearance WHERE owner=@owner "; sql += "INSERT INTO avatarappearance "; @@ -1112,6 +1005,7 @@ ELSE /// User ID /// First part of the login /// Second part of the login + /// Email of person /// A salted hash of the users password /// The salt used for the password hash /// A regionHandle of the users home region 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] ( [Owner] ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] -CREATE TABLE [users] ( - [UUID] [varchar](36) NOT NULL default '', - [username] [varchar](32) NOT NULL, - [lastname] [varchar](32) NOT NULL, - [passwordHash] [varchar](32) NOT NULL, - [passwordSalt] [varchar](32) NOT NULL, - [homeRegion] [bigint] default NULL, - [homeLocationX] [float] default NULL, - [homeLocationY] [float] default NULL, - [homeLocationZ] [float] default NULL, - [homeLookAtX] [float] default NULL, - [homeLookAtY] [float] default NULL, - [homeLookAtZ] [float] default NULL, - [created] [int] NOT NULL, - [lastLogin] [int] NOT NULL, - [userInventoryURI] [varchar](255) default NULL, - [userAssetURI] [varchar](255) default NULL, - [profileCanDoMask] [int] default NULL, - [profileWantDoMask] [int] default NULL, - [profileAboutText] [ntext], - [profileFirstText] [ntext], - [profileImage] [varchar](36) default NULL, - [profileFirstImage] [varchar](36) default NULL, - [webLoginKey] [varchar](36) default NULL, - PRIMARY KEY CLUSTERED -( - [UUID] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] -) ON [PRIMARY] - - -CREATE NONCLUSTERED INDEX [usernames] ON [users] -( - [username] ASC, - [lastname] ASC -)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] - - -CREATE TABLE [agents] ( - [UUID] [varchar](36) NOT NULL, - [sessionID] [varchar](36) NOT NULL, - [secureSessionID] [varchar](36) NOT NULL, - [agentIP] [varchar](16) NOT NULL, - [agentPort] [int] NOT NULL, - [agentOnline] [tinyint] NOT NULL, - [loginTime] [int] NOT NULL, - [logoutTime] [int] NOT NULL, - [currentRegion] [varchar](36) NOT NULL, - [currentHandle] [bigint] NOT NULL, - [currentPos] [varchar](64) NOT NULL, - PRIMARY KEY CLUSTERED -( - [UUID] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] -) ON [PRIMARY] - - -CREATE NONCLUSTERED INDEX [session] ON [agents] -( - [sessionID] ASC -)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] - -CREATE NONCLUSTERED INDEX [ssession] ON [agents] -( - [secureSessionID] ASC -)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] - - -CREATE TABLE [dbo].[userfriends]( - [ownerID] [varchar](50) COLLATE Latin1_General_CI_AS NOT NULL, - [friendID] [varchar](50) COLLATE Latin1_General_CI_AS NOT NULL, - [friendPerms] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, - [datetimestamp] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL -) ON [PRIMARY] - -CREATE TABLE [avatarappearance] ( - [Owner] [varchar](36) NOT NULL, - [Serial] int NOT NULL, - [Visual_Params] [image] NOT NULL, - [Texture] [image] NOT NULL, - [Avatar_Height] float NOT NULL, - [Body_Item] [varchar](36) NOT NULL, - [Body_Asset] [varchar](36) NOT NULL, - [Skin_Item] [varchar](36) NOT NULL, - [Skin_Asset] [varchar](36) NOT NULL, - [Hair_Item] [varchar](36) NOT NULL, - [Hair_Asset] [varchar](36) NOT NULL, - [Eyes_Item] [varchar](36) NOT NULL, - [Eyes_Asset] [varchar](36) NOT NULL, - [Shirt_Item] [varchar](36) NOT NULL, - [Shirt_Asset] [varchar](36) NOT NULL, - [Pants_Item] [varchar](36) NOT NULL, - [Pants_Asset] [varchar](36) NOT NULL, - [Shoes_Item] [varchar](36) NOT NULL, - [Shoes_Asset] [varchar](36) NOT NULL, - [Socks_Item] [varchar](36) NOT NULL, - [Socks_Asset] [varchar](36) NOT NULL, - [Jacket_Item] [varchar](36) NOT NULL, - [Jacket_Asset] [varchar](36) NOT NULL, - [Gloves_Item] [varchar](36) NOT NULL, - [Gloves_Asset] [varchar](36) NOT NULL, - [Undershirt_Item] [varchar](36) NOT NULL, - [Undershirt_Asset] [varchar](36) NOT NULL, - [Underpants_Item] [varchar](36) NOT NULL, - [Underpants_Asset] [varchar](36) NOT NULL, - [Skirt_Item] [varchar](36) NOT NULL, - [Skirt_Asset] [varchar](36) NOT NULL, - - PRIMARY KEY CLUSTERED ( - [Owner] - ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] -) 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 @@ --- --- Create schema avatar_appearance --- - -SET ANSI_NULLS ON -SET QUOTED_IDENTIFIER ON -SET ANSI_PADDING ON - -CREATE TABLE [avatarappearance] ( - [Owner] [varchar](36) NOT NULL, - [Serial] int NOT NULL, - [Visual_Params] [image] NOT NULL, - [Texture] [image] NOT NULL, - [Avatar_Height] float NOT NULL, - [Body_Item] [varchar](36) NOT NULL, - [Body_Asset] [varchar](36) NOT NULL, - [Skin_Item] [varchar](36) NOT NULL, - [Skin_Asset] [varchar](36) NOT NULL, - [Hair_Item] [varchar](36) NOT NULL, - [Hair_Asset] [varchar](36) NOT NULL, - [Eyes_Item] [varchar](36) NOT NULL, - [Eyes_Asset] [varchar](36) NOT NULL, - [Shirt_Item] [varchar](36) NOT NULL, - [Shirt_Asset] [varchar](36) NOT NULL, - [Pants_Item] [varchar](36) NOT NULL, - [Pants_Asset] [varchar](36) NOT NULL, - [Shoes_Item] [varchar](36) NOT NULL, - [Shoes_Asset] [varchar](36) NOT NULL, - [Socks_Item] [varchar](36) NOT NULL, - [Socks_Asset] [varchar](36) NOT NULL, - [Jacket_Item] [varchar](36) NOT NULL, - [Jacket_Asset] [varchar](36) NOT NULL, - [Gloves_Item] [varchar](36) NOT NULL, - [Gloves_Asset] [varchar](36) NOT NULL, - [Undershirt_Item] [varchar](36) NOT NULL, - [Undershirt_Asset] [varchar](36) NOT NULL, - [Underpants_Item] [varchar](36) NOT NULL, - [Underpants_Asset] [varchar](36) NOT NULL, - [Skirt_Item] [varchar](36) NOT NULL, - [Skirt_Asset] [varchar](36) NOT NULL, - - PRIMARY KEY CLUSTERED ( - [Owner] - ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] -) ON [PRIMARY] - -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 @@ -SET ANSI_NULLS ON -SET QUOTED_IDENTIFIER ON -SET ANSI_PADDING ON -CREATE TABLE [assets] ( - [id] [varchar](36) NOT NULL, - [name] [varchar](64) NOT NULL, - [description] [varchar](64) NOT NULL, - [assetType] [tinyint] NOT NULL, - [local] [tinyint] NOT NULL, - [temporary] [tinyint] NOT NULL, - [data] [image] NOT NULL, -PRIMARY KEY CLUSTERED -( - [id] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] -) ON [PRIMARY] - -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 @@ -SET ANSI_NULLS ON -SET QUOTED_IDENTIFIER ON -SET ANSI_PADDING ON -CREATE TABLE [inventoryfolders] ( - [folderID] [varchar](36) NOT NULL default '', - [agentID] [varchar](36) default NULL, - [parentFolderID] [varchar](36) default NULL, - [folderName] [varchar](64) default NULL, - [type] [smallint] NOT NULL default 0, - [version] [int] NOT NULL default 0, - PRIMARY KEY CLUSTERED -( - [folderID] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] -) ON [PRIMARY] - -CREATE NONCLUSTERED INDEX [owner] ON [inventoryfolders] -( - [agentID] ASC -)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] - -CREATE NONCLUSTERED INDEX [parent] ON [inventoryfolders] -( - [parentFolderID] ASC -)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] - -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 @@ -SET ANSI_NULLS ON - -SET QUOTED_IDENTIFIER ON - -SET ANSI_PADDING ON - -CREATE TABLE [inventoryitems] ( - [inventoryID] [varchar](36) NOT NULL default '', - [assetID] [varchar](36) default NULL, - [assetType] [int] default NULL, - [parentFolderID] [varchar](36) default NULL, - [avatarID] [varchar](36) default NULL, - [inventoryName] [varchar](64) default NULL, - [inventoryDescription] [varchar](128) default NULL, - [inventoryNextPermissions] [int] default NULL, - [inventoryCurrentPermissions] [int] default NULL, - [invType] [int] default NULL, - [creatorID] [varchar](36) default NULL, - [inventoryBasePermissions] [int] NOT NULL default 0, - [inventoryEveryOnePermissions] [int] NOT NULL default 0, - [salePrice] [int] default NULL, - [saleType] [tinyint] default NULL, - [creationDate] [int] default NULL, - [groupID] [varchar](36) default NULL, - [groupOwned] [bit] default NULL, - [flags] [int] default NULL, - PRIMARY KEY CLUSTERED -( - [inventoryID] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] -) ON [PRIMARY] - - -CREATE NONCLUSTERED INDEX [owner] ON [inventoryitems] -( - [avatarID] ASC -)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] - -CREATE NONCLUSTERED INDEX [folder] ON [inventoryitems] -( - [parentFolderID] ASC -)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] - -SET ANSI_PADDING OFF - - 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 @@ -SET ANSI_NULLS ON - -SET QUOTED_IDENTIFIER ON - -SET ANSI_PADDING ON - -CREATE TABLE [dbo].[userfriends]( -[ownerID] [varchar](50) COLLATE Latin1_General_CI_AS NOT NULL, -[friendID] [varchar](50) COLLATE Latin1_General_CI_AS NOT NULL, -[friendPerms] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, -[datetimestamp] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL -) ON [PRIMARY] - -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 @@ -SET ANSI_NULLS ON - -SET QUOTED_IDENTIFIER ON - -SET ANSI_PADDING ON - -CREATE TABLE [agents] ( - [UUID] [varchar](36) NOT NULL, - [sessionID] [varchar](36) NOT NULL, - [secureSessionID] [varchar](36) NOT NULL, - [agentIP] [varchar](16) NOT NULL, - [agentPort] [int] NOT NULL, - [agentOnline] [tinyint] NOT NULL, - [loginTime] [int] NOT NULL, - [logoutTime] [int] NOT NULL, - [currentRegion] [varchar](36) NOT NULL, - [currentHandle] [bigint] NOT NULL, - [currentPos] [varchar](64) NOT NULL, - PRIMARY KEY CLUSTERED -( - [UUID] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] -) ON [PRIMARY] - - -CREATE NONCLUSTERED INDEX [session] ON [agents] -( - [sessionID] ASC -)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] - -CREATE NONCLUSTERED INDEX [ssession] ON [agents] -( - [secureSessionID] ASC -)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] - -SET ANSI_PADDING OFF - 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 @@ -SET ANSI_NULLS ON - -SET QUOTED_IDENTIFIER ON - -SET ANSI_PADDING ON - -CREATE TABLE [logs] ( - [logID] [int] NOT NULL, - [target] [varchar](36) default NULL, - [server] [varchar](64) default NULL, - [method] [varchar](64) default NULL, - [arguments] [varchar](255) default NULL, - [priority] [int] default NULL, - [message] [ntext], - PRIMARY KEY CLUSTERED -( - [logID] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] -) ON [PRIMARY] - 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 @@ -SET ANSI_NULLS ON - -SET QUOTED_IDENTIFIER ON - -SET ANSI_PADDING ON - -CREATE TABLE [dbo].[regions]( - [regionHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [regionName] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [uuid] [varchar](255) COLLATE Latin1_General_CI_AS NOT NULL, - [regionRecvKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [regionSecret] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [regionSendKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [regionDataURI] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [serverIP] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [serverPort] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [serverURI] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [locX] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [locY] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [locZ] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [eastOverrideHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [westOverrideHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [southOverrideHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [northOverrideHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [regionAssetURI] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [regionAssetRecvKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [regionAssetSendKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [regionUserURI] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [regionUserRecvKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [regionUserSendKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [regionMapTexture] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [serverHttpPort] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [serverRemotingPort] [varchar](255) COLLATE Latin1_General_CI_AS NULL, - [owner_uuid] [varchar](36) COLLATE Latin1_General_CI_AS NULL, -PRIMARY KEY CLUSTERED -( - [uuid] ASC -)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] -) ON [PRIMARY] - -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 @@ -SET ANSI_NULLS ON - -SET QUOTED_IDENTIFIER ON - -SET ANSI_PADDING ON - -CREATE TABLE [users] ( - [UUID] [varchar](36) NOT NULL default '', - [username] [varchar](32) NOT NULL, - [lastname] [varchar](32) NOT NULL, - [passwordHash] [varchar](32) NOT NULL, - [passwordSalt] [varchar](32) NOT NULL, - [homeRegion] [bigint] default NULL, - [homeLocationX] [float] default NULL, - [homeLocationY] [float] default NULL, - [homeLocationZ] [float] default NULL, - [homeLookAtX] [float] default NULL, - [homeLookAtY] [float] default NULL, - [homeLookAtZ] [float] default NULL, - [created] [int] NOT NULL, - [lastLogin] [int] NOT NULL, - [userInventoryURI] [varchar](255) default NULL, - [userAssetURI] [varchar](255) default NULL, - [profileCanDoMask] [int] default NULL, - [profileWantDoMask] [int] default NULL, - [profileAboutText] [ntext], - [profileFirstText] [ntext], - [profileImage] [varchar](36) default NULL, - [profileFirstImage] [varchar](36) default NULL, - [webLoginKey] [varchar](36) default NULL, - PRIMARY KEY CLUSTERED -( - [UUID] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] -) ON [PRIMARY] - - -CREATE NONCLUSTERED INDEX [usernames] ON [users] -( - [username] ASC, - [lastname] ASC -)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] -- cgit v1.1