Mantis#2626: Thank you Ruud Lathrop, for a patch that cleans up MSSQL code.

0.6.1-post-fixes
Homer Horwitz 2008-11-15 21:27:10 +00:00
parent 448e4b0beb
commit 9a6cdf662b
17 changed files with 14 additions and 782 deletions

View File

@ -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
/// <summary>
/// <para>Initialises asset interface</para>
/// </summary>
[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
/// <param name="connectionString">connect string</param>
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
/// <summary>
/// Migration method
/// <list type="bullet">
/// <item>Execute "CreateAssetsTable.sql" if tableName == null</item>
/// </list>
/// </summary>
/// <param name="tableName">Name of table</param>
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;
}
}
/// <summary>
/// Ensure that the assets related tables exists and are at the latest version
/// </summary>
private void TestTables()
{
Dictionary<string, string> tableList = new Dictionary<string, string>();
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
}
}

View File

@ -56,7 +56,7 @@ namespace OpenSim.Data.MSSQL
/// <param name="connectionString">connectionString.</param>
public void Initialise(string connectionString)
{
if (string.IsNullOrEmpty(connectionString))
if (!string.IsNullOrEmpty(connectionString))
{
_Database = new MSSQLManager(connectionString);
}

View File

@ -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
/// <remarks>use mssql_connection.ini</remarks>
override public void Initialise(string connectionString)
{
if (string.IsNullOrEmpty(connectionString))
if (!string.IsNullOrEmpty(connectionString))
{
database = new MSSQLManager(connectionString);
}
@ -93,62 +94,10 @@ namespace OpenSim.Data.MSSQL
settingPassword);
}
//TODO this can be removed at a certain time
TestTables();
//New migrations check of store
database.CheckMigration(_migrationStore);
}
/// <summary>
/// Test is region
/// </summary>
private void TestTables()
{
using (AutoClosingSqlCommand cmd = database.Query("SELECT TOP 1 * FROM " + m_regionsTableName, new Dictionary<string, string>()))
{
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();
}
}
}
/// <summary>
/// Shuts down the grid interface
/// </summary>

View File

@ -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
/// <remarks>use mssql_connection.ini</remarks>
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
/// <summary>
/// Execute "CreateFoldersTable.sql" if tableName == null
/// </summary>
/// <param name="tableName">the table name</param>
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;
}
}
/// <summary>
/// Execute "CreateItemsTable.sql" if tableName = null
/// </summary>
/// <param name="tableName">the table name</param>
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;
}
}
/// <summary>
///
/// </summary>
private void TestTables()
{
Dictionary<string, string> tableList = new Dictionary<string, string>();
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
/// <summary>
/// The name of this DB provider
/// </summary>

View File

@ -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
/// </summary>
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
/// </summary>
public void Initialise(string connect)
{
if (string.IsNullOrEmpty(connect))
if (!string.IsNullOrEmpty(connect))
{
database = new MSSQLManager(connect);
}
@ -79,61 +77,10 @@ namespace OpenSim.Data.MSSQL
settingPassword);
}
//TODO when can this be removed
TestTable();
//Updating mechanisme
database.CheckMigration(_migrationStore);
}
/// <summary>
/// Can be removed someday!!!
/// </summary>
private void TestTable()
{
using (IDbCommand cmd = database.Query("select top 1 * from logs", new Dictionary<string, string>()))
{
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();
}
}
}
/// <summary>
/// Saves a log item to the database
/// </summary>

View File

@ -73,7 +73,7 @@ namespace OpenSim.Data.MSSQL
/// <param name="connectionString">The connection string.</param>
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);

View File

@ -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
/// </summary>
override public void Dispose() { }
/// <summary>
/// Can be deleted at one time!
/// </summary>
/// <returns></returns>
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<string, string>()))
{
try
{
cmd.ExecuteNonQuery();
}
catch
{
database.ExecuteResourceSql("Mssql-agents.sql");
}
}
using (IDbCommand cmd = database.Query("select top 1 * from " + m_userFriendsTableName, new Dictionary<string, string>()))
{
try
{
cmd.ExecuteNonQuery();
}
catch
{
database.ExecuteResourceSql("CreateUserFriendsTable.sql");
}
}
using (IDbCommand cmd = database.Query("select top 1 * from avatarappearance", new Dictionary<string, string>()))
{
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
/// <summary>
@ -679,7 +572,7 @@ namespace OpenSim.Data.MSSQL
/// <param name="appearance">the appearence</param>
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
/// <param name="uuid">User ID</param>
/// <param name="username">First part of the login</param>
/// <param name="lastname">Second part of the login</param>
/// <param name="email">Email of person</param>
/// <param name="passwordHash">A salted hash of the users password</param>
/// <param name="passwordSalt">The salt used for the password hash</param>
/// <param name="homeRegion">A regionHandle of the users home region</param>

View File

@ -66,118 +66,6 @@ CREATE NONCLUSTERED INDEX [ssession] ON [agents]
)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]
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,

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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]

View File

@ -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

View File

@ -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]