Merge branch 'master' into careminster-presence-refactor

avinationmerge
Melanie 2010-05-21 03:51:58 +01:00
commit a92780fe5f
245 changed files with 6014 additions and 4908 deletions

View File

@ -1038,23 +1038,6 @@ namespace OpenSim.Client.MXP.ClientStack
// Need to translate to MXP somehow
}
public void SendAvatarData(SendAvatarData data)
{
//ScenePresence presence=((Scene)this.Scene).GetScenePresence(avatarID);
UUID ownerID = data.AvatarID;
MXPSendAvatarData(data.FirstName + " " + data.LastName, ownerID, UUID.Zero, data.AvatarID, data.AvatarLocalID, data.Position, data.Rotation);
}
public void SendAvatarTerseUpdate(SendAvatarTerseData data)
{
MovementEventMessage me = new MovementEventMessage();
me.ObjectIndex = data.LocalID;
me.Location = ToOmVector(data.Position);
me.Orientation = ToOmQuaternion(data.Rotation);
Session.Send(me);
}
public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations)
{
// Minimap function, not used.
@ -1070,23 +1053,31 @@ namespace OpenSim.Client.MXP.ClientStack
// Need to translate to MXP somehow
}
public void SendPrimitiveToClient(SendPrimitiveData data)
public void SendAvatarDataImmediate(ISceneEntity avatar)
{
MXPSendPrimitive(data.localID, data.ownerID, data.acc, data.rvel, data.primShape, data.pos, data.objectID, data.vel,
data.rotation, (uint)data.flags, data.text, data.color, data.parentID, data.particleSystem, data.clickAction,
data.material, data.textureanim);
//ScenePresence presence=((Scene)this.Scene).GetScenePresence(avatarID);
ScenePresence presence = (ScenePresence)avatar;
UUID ownerID = presence.UUID;
MXPSendAvatarData(presence.Firstname + " " + presence.Lastname, ownerID, UUID.Zero, presence.UUID, presence.LocalId, presence.AbsolutePosition, presence.Rotation);
}
public void SendPrimTerseUpdate(SendPrimitiveTerseData data)
public void SendPrimUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags)
{
MovementEventMessage me = new MovementEventMessage();
me.ObjectIndex = data.LocalID;
me.Location = ToOmVector(data.Position);
me.Orientation = ToOmQuaternion(data.Rotation);
Session.Send(me);
//MovementEventMessage me = new MovementEventMessage();
//me.ObjectIndex = data.LocalID;
//me.Location = ToOmVector(data.Position);
//me.Orientation = ToOmQuaternion(data.Rotation);
//MXPSendPrimitive(data.localID, data.ownerID, data.acc, data.rvel, data.primShape, data.pos, data.objectID, data.vel,
// data.rotation, (uint)data.flags, data.text, data.color, data.parentID, data.particleSystem, data.clickAction,
// data.material, data.textureanim);
//Session.Send(me);
throw new System.NotImplementedException();
}
public void ReprioritizeUpdates(StateUpdateTypes type, UpdatePriorityHandler handler)
public void ReprioritizeUpdates(UpdatePriorityHandler handler)
{
}

View File

@ -593,16 +593,6 @@ namespace OpenSim.Client.Sirikata.ClientStack
throw new System.NotImplementedException();
}
public void SendAvatarData(SendAvatarData data)
{
throw new System.NotImplementedException();
}
public void SendAvatarTerseUpdate(SendAvatarTerseData data)
{
throw new System.NotImplementedException();
}
public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations)
{
throw new System.NotImplementedException();
@ -618,22 +608,17 @@ namespace OpenSim.Client.Sirikata.ClientStack
throw new System.NotImplementedException();
}
public void SendPrimitiveToClient(SendPrimitiveData data)
public void SendAvatarDataImmediate(ISceneEntity avatar)
{
throw new System.NotImplementedException();
}
public void SendPrimTerseUpdate(SendPrimitiveTerseData data)
public void SendPrimUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags)
{
throw new System.NotImplementedException();
}
public void ReprioritizeUpdates(StateUpdateTypes type, UpdatePriorityHandler handler)
{
throw new System.NotImplementedException();
}
public void SendInventoryFolderDetails(UUID ownerID, UUID folderID, List<InventoryItemBase> items, List<InventoryFolderBase> folders, int version, bool fetchFolders, bool fetchItems)
public void ReprioritizeUpdates(UpdatePriorityHandler handler)
{
throw new System.NotImplementedException();
}
@ -643,6 +628,11 @@ namespace OpenSim.Client.Sirikata.ClientStack
throw new System.NotImplementedException();
}
public void SendInventoryFolderDetails(UUID ownerID, UUID folderID, List<InventoryItemBase> items, List<InventoryFolderBase> folders, int version, bool fetchFolders, bool fetchItems)
{
throw new System.NotImplementedException();
}
public void SendInventoryItemDetails(UUID ownerID, InventoryItemBase item)
{
throw new System.NotImplementedException();

View File

@ -599,16 +599,6 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
throw new System.NotImplementedException();
}
public void SendAvatarData(SendAvatarData data)
{
throw new System.NotImplementedException();
}
public void SendAvatarTerseUpdate(SendAvatarTerseData data)
{
throw new System.NotImplementedException();
}
public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations)
{
throw new System.NotImplementedException();
@ -624,17 +614,17 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
throw new System.NotImplementedException();
}
public void SendPrimitiveToClient(SendPrimitiveData data)
public void SendAvatarDataImmediate(ISceneEntity avatar)
{
throw new System.NotImplementedException();
}
public void SendPrimTerseUpdate(SendPrimitiveTerseData data)
public void SendPrimUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags)
{
throw new System.NotImplementedException();
}
public void ReprioritizeUpdates(StateUpdateTypes type, UpdatePriorityHandler handler)
public void ReprioritizeUpdates(UpdatePriorityHandler handler)
{
throw new System.NotImplementedException();
}

44
OpenSim/Data/DBGuids.cs Normal file
View File

@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenMetaverse;
namespace OpenSim.Data
{
public static class DBGuid
{
/// <summary>This function converts a value returned from the database in one of the
/// supported formats into a UUID. This function is not actually DBMS-specific right
/// now
///
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public static UUID FromDB(object id)
{
if( (id == null) || (id == DBNull.Value))
return UUID.Zero;
if (id.GetType() == typeof(Guid))
return new UUID((Guid)id);
if (id.GetType() == typeof(byte[]))
{
if (((byte[])id).Length == 0)
return UUID.Zero;
else if (((byte[])id).Length == 16)
return new UUID((byte[])id, 0);
}
else if (id.GetType() == typeof(string))
{
if (((string)id).Length == 0)
return UUID.Zero;
else if (((string)id).Length == 36)
return new UUID((string)id);
}
throw new Exception("Failed to convert db value to UUID: " + id.ToString());
}
}
}

View File

@ -101,22 +101,30 @@ namespace OpenSim.Data.MSSQL
{
foreach (string name in FieldList)
{
if (_FieldMap[name].GetValue(es) is bool)
FieldInfo f = _FieldMap[name];
object v = reader[name];
if (f.FieldType == typeof(bool) )
{
int v = Convert.ToInt32(reader[name]);
if (v != 0)
_FieldMap[name].SetValue(es, true);
else
_FieldMap[name].SetValue(es, false);
f.SetValue(es, Convert.ToInt32(v) != 0);
}
else if (_FieldMap[name].GetValue(es) is UUID)
else if (f.FieldType == typeof(UUID) )
{
_FieldMap[name].SetValue(es, new UUID((Guid)reader[name])); // uuid);
f.SetValue(es, new UUID((Guid)v)); // uuid);
}
else if (f.FieldType == typeof(string))
{
f.SetValue(es, v.ToString());
}
else if (f.FieldType == typeof(UInt32))
{
f.SetValue(es, Convert.ToUInt32(v));
}
else if (f.FieldType == typeof(Single))
{
f.SetValue(es, Convert.ToSingle(v));
}
else
{
es.EstateID = Convert.ToUInt32(reader["EstateID"].ToString());
}
f.SetValue(es, v);
}
}
else
@ -288,61 +296,45 @@ namespace OpenSim.Data.MSSQL
private void SaveBanList(EstateSettings es)
{
//Delete first
string sql = "delete from estateban where EstateID = @EstateID";
using (SqlConnection conn = new SqlConnection(m_connectionString))
using (SqlCommand cmd = new SqlCommand(sql, conn))
{
cmd.Parameters.Add(_Database.CreateParameter("@EstateID", es.EstateID));
conn.Open();
cmd.ExecuteNonQuery();
}
//Insert after
sql = "insert into estateban (EstateID, bannedUUID) values ( @EstateID, @bannedUUID )";
using (SqlConnection conn = new SqlConnection(m_connectionString))
using (SqlCommand cmd = new SqlCommand(sql, conn))
{
foreach (EstateBan b in es.EstateBans)
using (SqlCommand cmd = conn.CreateCommand())
{
cmd.Parameters.Add(_Database.CreateParameter("@EstateID", es.EstateID));
cmd.Parameters.Add(_Database.CreateParameter("@bannedUUID", b.BannedUserID));
conn.Open();
cmd.CommandText = "delete from estateban where EstateID = @EstateID";
cmd.Parameters.AddWithValue("@EstateID", (int)es.EstateID);
cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
//Insert after
cmd.CommandText = "insert into estateban (EstateID, bannedUUID) values ( @EstateID, @bannedUUID )";
cmd.Parameters.AddWithValue("@bannedUUID", Guid.Empty);
foreach (EstateBan b in es.EstateBans)
{
cmd.Parameters["@bannedUUID"].Value = b.BannedUserID.Guid;
cmd.ExecuteNonQuery();
}
}
}
}
private void SaveUUIDList(uint estateID, string table, UUID[] data)
{
//Delete first
string sql = string.Format("delete from {0} where EstateID = @EstateID", table);
using (SqlConnection conn = new SqlConnection(m_connectionString))
using (SqlCommand cmd = new SqlCommand(sql, conn))
{
cmd.Parameters.Add(_Database.CreateParameter("@EstateID", estateID));
cmd.ExecuteNonQuery();
}
sql = string.Format("insert into {0} (EstateID, uuid) values ( @EstateID, @uuid )", table);
using (SqlConnection conn = new SqlConnection(m_connectionString))
using (SqlCommand cmd = new SqlCommand(sql, conn))
{
cmd.Parameters.Add(_Database.CreateParameter("@EstateID", estateID));
bool createParamOnce = true;
foreach (UUID uuid in data)
conn.Open();
using (SqlCommand cmd = conn.CreateCommand())
{
if (createParamOnce)
{
cmd.Parameters.Add(_Database.CreateParameter("@uuid", uuid));
createParamOnce = false;
}
else
cmd.Parameters["@uuid"].Value = uuid.Guid; //.ToString(); //TODO check if this works
conn.Open();
cmd.Parameters.AddWithValue("@EstateID", (int)estateID);
cmd.CommandText = string.Format("delete from {0} where EstateID = @EstateID", table);
cmd.ExecuteNonQuery();
cmd.CommandText = string.Format("insert into {0} (EstateID, uuid) values ( @EstateID, @uuid )", table);
cmd.Parameters.AddWithValue("@uuid", Guid.Empty);
foreach (UUID uuid in data)
{
cmd.Parameters["@uuid"].Value = uuid.Guid; //.ToString(); //TODO check if this works
cmd.ExecuteNonQuery();
}
}
}
}

View File

@ -1,13 +0,0 @@
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]

View File

@ -1,85 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE [dbo].[estate_managers](
[EstateID] [int] NOT NULL,
[uuid] [varchar](36) NOT NULL,
CONSTRAINT [PK_estate_managers] PRIMARY KEY CLUSTERED
(
[EstateID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY];
CREATE TABLE [dbo].[estate_groups](
[EstateID] [int] NOT NULL,
[uuid] [varchar](36) NOT NULL,
CONSTRAINT [PK_estate_groups] PRIMARY KEY CLUSTERED
(
[EstateID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY];
CREATE TABLE [dbo].[estate_users](
[EstateID] [int] NOT NULL,
[uuid] [varchar](36) NOT NULL,
CONSTRAINT [PK_estate_users] PRIMARY KEY CLUSTERED
(
[EstateID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY];
CREATE TABLE [dbo].[estateban](
[EstateID] [int] NOT NULL,
[bannedUUID] [varchar](36) NOT NULL,
[bannedIp] [varchar](16) NOT NULL,
[bannedIpHostMask] [varchar](16) NOT NULL,
[bannedNameMask] [varchar](64) NULL DEFAULT (NULL),
CONSTRAINT [PK_estateban] PRIMARY KEY CLUSTERED
(
[EstateID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY];
CREATE TABLE [dbo].[estate_settings](
[EstateID] [int] IDENTITY(1,100) NOT NULL,
[EstateName] [varchar](64) NULL DEFAULT (NULL),
[AbuseEmailToEstateOwner] [bit] NOT NULL,
[DenyAnonymous] [bit] NOT NULL,
[ResetHomeOnTeleport] [bit] NOT NULL,
[FixedSun] [bit] NOT NULL,
[DenyTransacted] [bit] NOT NULL,
[BlockDwell] [bit] NOT NULL,
[DenyIdentified] [bit] NOT NULL,
[AllowVoice] [bit] NOT NULL,
[UseGlobalTime] [bit] NOT NULL,
[PricePerMeter] [int] NOT NULL,
[TaxFree] [bit] NOT NULL,
[AllowDirectTeleport] [bit] NOT NULL,
[RedirectGridX] [int] NOT NULL,
[RedirectGridY] [int] NOT NULL,
[ParentEstateID] [int] NOT NULL,
[SunPosition] [float] NOT NULL,
[EstateSkipScripts] [bit] NOT NULL,
[BillableFactor] [float] NOT NULL,
[PublicAccess] [bit] NOT NULL,
[AbuseEmail] [varchar](255) NOT NULL,
[EstateOwner] [varchar](36) NOT NULL,
[DenyMinors] [bit] NOT NULL,
CONSTRAINT [PK_estate_settings] PRIMARY KEY CLUSTERED
(
[EstateID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY];
CREATE TABLE [dbo].[estate_map](
[RegionID] [varchar](36) NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
[EstateID] [int] NOT NULL,
CONSTRAINT [PK_estate_map] PRIMARY KEY CLUSTERED
(
[RegionID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY];
COMMIT

View File

@ -1,37 +0,0 @@
BEGIN TRANSACTION
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]
COMMIT

View File

@ -1,64 +0,0 @@
BEGIN TRANSACTION
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]
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]
COMMIT

View File

@ -1,161 +0,0 @@
CREATE TABLE [dbo].[prims](
[UUID] [varchar](255) NOT NULL,
[RegionUUID] [varchar](255) NULL,
[ParentID] [int] NULL,
[CreationDate] [int] NULL,
[Name] [varchar](255) NULL,
[SceneGroupID] [varchar](255) NULL,
[Text] [varchar](255) NULL,
[Description] [varchar](255) NULL,
[SitName] [varchar](255) NULL,
[TouchName] [varchar](255) NULL,
[ObjectFlags] [int] NULL,
[CreatorID] [varchar](255) NULL,
[OwnerID] [varchar](255) NULL,
[GroupID] [varchar](255) NULL,
[LastOwnerID] [varchar](255) NULL,
[OwnerMask] [int] NULL,
[NextOwnerMask] [int] NULL,
[GroupMask] [int] NULL,
[EveryoneMask] [int] NULL,
[BaseMask] [int] NULL,
[PositionX] [float] NULL,
[PositionY] [float] NULL,
[PositionZ] [float] NULL,
[GroupPositionX] [float] NULL,
[GroupPositionY] [float] NULL,
[GroupPositionZ] [float] NULL,
[VelocityX] [float] NULL,
[VelocityY] [float] NULL,
[VelocityZ] [float] NULL,
[AngularVelocityX] [float] NULL,
[AngularVelocityY] [float] NULL,
[AngularVelocityZ] [float] NULL,
[AccelerationX] [float] NULL,
[AccelerationY] [float] NULL,
[AccelerationZ] [float] NULL,
[RotationX] [float] NULL,
[RotationY] [float] NULL,
[RotationZ] [float] NULL,
[RotationW] [float] NULL,
[SitTargetOffsetX] [float] NULL,
[SitTargetOffsetY] [float] NULL,
[SitTargetOffsetZ] [float] NULL,
[SitTargetOrientW] [float] NULL,
[SitTargetOrientX] [float] NULL,
[SitTargetOrientY] [float] NULL,
[SitTargetOrientZ] [float] NULL,
PRIMARY KEY CLUSTERED
(
[UUID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
CREATE TABLE [dbo].[primshapes](
[UUID] [varchar](255) NOT NULL,
[Shape] [int] NULL,
[ScaleX] [float] NULL,
[ScaleY] [float] NULL,
[ScaleZ] [float] NULL,
[PCode] [int] NULL,
[PathBegin] [int] NULL,
[PathEnd] [int] NULL,
[PathScaleX] [int] NULL,
[PathScaleY] [int] NULL,
[PathShearX] [int] NULL,
[PathShearY] [int] NULL,
[PathSkew] [int] NULL,
[PathCurve] [int] NULL,
[PathRadiusOffset] [int] NULL,
[PathRevolutions] [int] NULL,
[PathTaperX] [int] NULL,
[PathTaperY] [int] NULL,
[PathTwist] [int] NULL,
[PathTwistBegin] [int] NULL,
[ProfileBegin] [int] NULL,
[ProfileEnd] [int] NULL,
[ProfileCurve] [int] NULL,
[ProfileHollow] [int] NULL,
[State] [int] NULL,
[Texture] [image] NULL,
[ExtraParams] [image] NULL,
PRIMARY KEY CLUSTERED
(
[UUID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
CREATE TABLE [dbo].[primitems](
[itemID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[primID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[assetID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[parentFolderID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[invType] [int] NULL,
[assetType] [int] NULL,
[name] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[description] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[creationDate] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[creatorID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ownerID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[lastOwnerID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[groupID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[nextPermissions] [int] NULL,
[currentPermissions] [int] NULL,
[basePermissions] [int] NULL,
[everyonePermissions] [int] NULL,
[groupPermissions] [int] NULL,
PRIMARY KEY CLUSTERED
(
[itemID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
CREATE TABLE [dbo].[terrain](
[RegionUUID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Revision] [int] NULL,
[Heightfield] [image] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
CREATE TABLE [dbo].[land](
[UUID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[RegionUUID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LocalLandID] [int] NULL,
[Bitmap] [image] NULL,
[Name] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Description] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[OwnerUUID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[IsGroupOwned] [int] NULL,
[Area] [int] NULL,
[AuctionID] [int] NULL,
[Category] [int] NULL,
[ClaimDate] [int] NULL,
[ClaimPrice] [int] NULL,
[GroupUUID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SalePrice] [int] NULL,
[LandStatus] [int] NULL,
[LandFlags] [int] NULL,
[LandingType] [int] NULL,
[MediaAutoScale] [int] NULL,
[MediaTextureUUID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[MediaURL] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[MusicURL] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PassHours] [float] NULL,
[PassPrice] [int] NULL,
[SnapshotUUID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[UserLocationX] [float] NULL,
[UserLocationY] [float] NULL,
[UserLocationZ] [float] NULL,
[UserLookAtX] [float] NULL,
[UserLookAtY] [float] NULL,
[UserLookAtZ] [float] NULL,
PRIMARY KEY CLUSTERED
(
[UUID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
CREATE TABLE [dbo].[landaccesslist](
[LandUUID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[AccessUUID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Flags] [int] NULL
) ON [PRIMARY]

View File

@ -1,14 +0,0 @@
CREATE TABLE [UserAccounts] (
[PrincipalID] uniqueidentifier NOT NULL,
[ScopeID] uniqueidentifier NOT NULL,
[FirstName] [varchar](64) NOT NULL,
[LastName] [varchar](64) NOT NULL,
[Email] [varchar](64) NULL,
[ServiceURLs] [text] NULL,
[Created] [int] default NULL,
PRIMARY KEY CLUSTERED
(
[PrincipalID] 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,112 +0,0 @@
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]

View File

@ -1,29 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE Tmp_assets
(
id varchar(36) NOT NULL,
name varchar(64) NOT NULL,
description varchar(64) NOT NULL,
assetType tinyint NOT NULL,
local bit NOT NULL,
temporary bit NOT NULL,
data image NOT NULL
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
IF EXISTS(SELECT * FROM assets)
EXEC('INSERT INTO Tmp_assets (id, name, description, assetType, local, temporary, data)
SELECT id, name, description, assetType, CONVERT(bit, local), CONVERT(bit, temporary), data FROM assets WITH (HOLDLOCK TABLOCKX)')
DROP TABLE assets
EXECUTE sp_rename N'Tmp_assets', N'assets', 'OBJECT'
ALTER TABLE dbo.assets ADD CONSTRAINT
PK__assets__id PRIMARY KEY CLUSTERED
(
id
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,6 +0,0 @@
BEGIN TRANSACTION
INSERT INTO auth (UUID, passwordHash, passwordSalt, webLoginKey, accountType) SELECT [UUID] AS UUID, [passwordHash] AS passwordHash, [passwordSalt] AS passwordSalt, [webLoginKey] AS webLoginKey, 'UserAccount' as [accountType] FROM users;
COMMIT

View File

@ -1,25 +0,0 @@
BEGIN TRANSACTION
ALTER TABLE dbo.estate_managers DROP CONSTRAINT PK_estate_managers
CREATE NONCLUSTERED INDEX IX_estate_managers ON dbo.estate_managers
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
ALTER TABLE dbo.estate_groups DROP CONSTRAINT PK_estate_groups
CREATE NONCLUSTERED INDEX IX_estate_groups ON dbo.estate_groups
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
ALTER TABLE dbo.estate_users DROP CONSTRAINT PK_estate_users
CREATE NONCLUSTERED INDEX IX_estate_users ON dbo.estate_users
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,6 +0,0 @@
BEGIN TRANSACTION
INSERT INTO Friends (PrincipalID, Friend, Flags, Offered) SELECT [ownerID], [friendID], [friendPerms], 0 FROM userfriends;
COMMIT

View File

@ -1,49 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE Tmp_regions
(
uuid varchar(36) COLLATE Latin1_General_CI_AS NOT NULL,
regionHandle bigint NULL,
regionName varchar(20) NULL,
regionRecvKey varchar(128) NULL,
regionSendKey varchar(128) NULL,
regionSecret varchar(128) NULL,
regionDataURI varchar(128) NULL,
serverIP varchar(64) NULL,
serverPort int NULL,
serverURI varchar(255) NULL,
locX int NULL,
locY int NULL,
locZ int NULL,
eastOverrideHandle bigint NULL,
westOverrideHandle bigint NULL,
southOverrideHandle bigint NULL,
northOverrideHandle bigint NULL,
regionAssetURI varchar(255) NULL,
regionAssetRecvKey varchar(128) NULL,
regionAssetSendKey varchar(128) NULL,
regionUserURI varchar(255) NULL,
regionUserRecvKey varchar(128) NULL,
regionUserSendKey varchar(128) NULL,
regionMapTexture varchar(36) NULL,
serverHttpPort int NULL,
serverRemotingPort int NULL,
owner_uuid varchar(36) NULL,
originUUID varchar(36) NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000')
) ON [PRIMARY]
IF EXISTS(SELECT * FROM regions)
EXEC('INSERT INTO Tmp_regions (uuid, regionHandle, regionName, regionRecvKey, regionSendKey, regionSecret, regionDataURI, serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, regionMapTexture, serverHttpPort, serverRemotingPort, owner_uuid)
SELECT CONVERT(varchar(36), uuid), CONVERT(bigint, regionHandle), CONVERT(varchar(20), regionName), CONVERT(varchar(128), regionRecvKey), CONVERT(varchar(128), regionSendKey), CONVERT(varchar(128), regionSecret), CONVERT(varchar(128), regionDataURI), CONVERT(varchar(64), serverIP), CONVERT(int, serverPort), serverURI, CONVERT(int, locX), CONVERT(int, locY), CONVERT(int, locZ), CONVERT(bigint, eastOverrideHandle), CONVERT(bigint, westOverrideHandle), CONVERT(bigint, southOverrideHandle), CONVERT(bigint, northOverrideHandle), regionAssetURI, CONVERT(varchar(128), regionAssetRecvKey), CONVERT(varchar(128), regionAssetSendKey), regionUserURI, CONVERT(varchar(128), regionUserRecvKey), CONVERT(varchar(128), regionUserSendKey), CONVERT(varchar(36), regionMapTexture), CONVERT(int, serverHttpPort), CONVERT(int, serverRemotingPort), owner_uuid FROM regions')
DROP TABLE regions
EXECUTE sp_rename N'Tmp_regions', N'regions', 'OBJECT'
ALTER TABLE regions ADD CONSTRAINT
PK__regions__uuid PRIMARY KEY CLUSTERED
(
uuid
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,5 +0,0 @@
BEGIN TRANSACTION
ALTER TABLE inventoryitems ADD inventoryGroupPermissions INTEGER NOT NULL default 0
COMMIT

View File

@ -1,6 +0,0 @@
BEGIN TRANSACTION
CREATE UNIQUE INDEX SessionID ON Presence(SessionID);
CREATE INDEX UserID ON Presence(UserID);
COMMIT

View File

@ -1,50 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE regionban (
[regionUUID] VARCHAR(36) NOT NULL,
[bannedUUID] VARCHAR(36) NOT NULL,
[bannedIp] VARCHAR(16) NOT NULL,
[bannedIpHostMask] VARCHAR(16) NOT NULL)
create table [dbo].[regionsettings] (
[regionUUID] [varchar](36) not null,
[block_terraform] [bit] not null,
[block_fly] [bit] not null,
[allow_damage] [bit] not null,
[restrict_pushing] [bit] not null,
[allow_land_resell] [bit] not null,
[allow_land_join_divide] [bit] not null,
[block_show_in_search] [bit] not null,
[agent_limit] [int] not null,
[object_bonus] [float] not null,
[maturity] [int] not null,
[disable_scripts] [bit] not null,
[disable_collisions] [bit] not null,
[disable_physics] [bit] not null,
[terrain_texture_1] [varchar](36) not null,
[terrain_texture_2] [varchar](36) not null,
[terrain_texture_3] [varchar](36) not null,
[terrain_texture_4] [varchar](36) not null,
[elevation_1_nw] [float] not null,
[elevation_2_nw] [float] not null,
[elevation_1_ne] [float] not null,
[elevation_2_ne] [float] not null,
[elevation_1_se] [float] not null,
[elevation_2_se] [float] not null,
[elevation_1_sw] [float] not null,
[elevation_2_sw] [float] not null,
[water_height] [float] not null,
[terrain_raise_limit] [float] not null,
[terrain_lower_limit] [float] not null,
[use_estate_sun] [bit] not null,
[fixed_sun] [bit] not null,
[sun_position] [float] not null,
[covenant] [varchar](36) default NULL,
[Sandbox] [bit] NOT NULL,
PRIMARY KEY CLUSTERED
(
[regionUUID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
COMMIT

View File

@ -1,12 +0,0 @@
BEGIN TRANSACTION
INSERT INTO UserAccounts (PrincipalID, ScopeID, FirstName, LastName, Email, ServiceURLs, Created) SELECT [UUID] AS PrincipalID, '00000000-0000-0000-0000-000000000000' AS ScopeID,
username AS FirstName,
lastname AS LastName,
email as Email, (
'AssetServerURI=' +
userAssetURI + ' InventoryServerURI=' + userInventoryURI + ' GatewayURI= HomeURI=') AS ServiceURLs,
created as Created FROM users;
COMMIT

View File

@ -1,9 +0,0 @@
BEGIN TRANSACTION
ALTER TABLE users ADD homeRegionID varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000';
ALTER TABLE users ADD userFlags int NOT NULL default 0;
ALTER TABLE users ADD godLevel int NOT NULL default 0;
ALTER TABLE users ADD customType varchar(32) not null default '';
ALTER TABLE users ADD partner varchar(36) not null default '00000000-0000-0000-0000-000000000000';
COMMIT

View File

@ -1,6 +0,0 @@
BEGIN TRANSACTION
ALTER TABLE assets add create_time integer default 0
ALTER TABLE assets add access_time integer default 0
COMMIT

View File

@ -1,25 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_estateban
(
EstateID int NOT NULL,
bannedUUID varchar(36) NOT NULL,
bannedIp varchar(16) NULL,
bannedIpHostMask varchar(16) NULL,
bannedNameMask varchar(64) NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.estateban)
EXEC('INSERT INTO dbo.Tmp_estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask)
SELECT EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask FROM dbo.estateban')
DROP TABLE dbo.estateban
EXECUTE sp_rename N'dbo.Tmp_estateban', N'estateban', 'OBJECT'
CREATE NONCLUSTERED INDEX IX_estateban ON dbo.estateban
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,22 +0,0 @@
BEGIN TRANSACTION
CREATE NONCLUSTERED INDEX IX_regions_name ON dbo.regions
(
regionName
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX IX_regions_handle ON dbo.regions
(
regionHandle
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX IX_regions_override ON dbo.regions
(
eastOverrideHandle,
westOverrideHandle,
southOverrideHandle,
northOverrideHandle
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,38 +0,0 @@
/* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_inventoryfolders
(
folderID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
agentID uniqueidentifier NULL DEFAULT (NULL),
parentFolderID uniqueidentifier NULL DEFAULT (NULL),
folderName varchar(64) NULL DEFAULT (NULL),
type smallint NOT NULL DEFAULT ((0)),
version int NOT NULL DEFAULT ((0))
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.inventoryfolders)
EXEC('INSERT INTO dbo.Tmp_inventoryfolders (folderID, agentID, parentFolderID, folderName, type, version)
SELECT CONVERT(uniqueidentifier, folderID), CONVERT(uniqueidentifier, agentID), CONVERT(uniqueidentifier, parentFolderID), folderName, type, version FROM dbo.inventoryfolders WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.inventoryfolders
EXECUTE sp_rename N'dbo.Tmp_inventoryfolders', N'inventoryfolders', 'OBJECT'
ALTER TABLE dbo.inventoryfolders ADD CONSTRAINT
PK__inventor__C2FABFB3173876EA PRIMARY KEY CLUSTERED
(
folderID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX owner ON dbo.inventoryfolders
(
agentID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX parent ON dbo.inventoryfolders
(
parentFolderID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,67 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_prims
(
UUID varchar(36) NOT NULL,
RegionUUID varchar(36) NULL,
ParentID int NULL,
CreationDate int NULL,
Name varchar(255) NULL,
SceneGroupID varchar(36) NULL,
Text varchar(255) NULL,
Description varchar(255) NULL,
SitName varchar(255) NULL,
TouchName varchar(255) NULL,
ObjectFlags int NULL,
CreatorID varchar(36) NULL,
OwnerID varchar(36) NULL,
GroupID varchar(36) NULL,
LastOwnerID varchar(36) NULL,
OwnerMask int NULL,
NextOwnerMask int NULL,
GroupMask int NULL,
EveryoneMask int NULL,
BaseMask int NULL,
PositionX float(53) NULL,
PositionY float(53) NULL,
PositionZ float(53) NULL,
GroupPositionX float(53) NULL,
GroupPositionY float(53) NULL,
GroupPositionZ float(53) NULL,
VelocityX float(53) NULL,
VelocityY float(53) NULL,
VelocityZ float(53) NULL,
AngularVelocityX float(53) NULL,
AngularVelocityY float(53) NULL,
AngularVelocityZ float(53) NULL,
AccelerationX float(53) NULL,
AccelerationY float(53) NULL,
AccelerationZ float(53) NULL,
RotationX float(53) NULL,
RotationY float(53) NULL,
RotationZ float(53) NULL,
RotationW float(53) NULL,
SitTargetOffsetX float(53) NULL,
SitTargetOffsetY float(53) NULL,
SitTargetOffsetZ float(53) NULL,
SitTargetOrientW float(53) NULL,
SitTargetOrientX float(53) NULL,
SitTargetOrientY float(53) NULL,
SitTargetOrientZ float(53) NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.prims)
EXEC('INSERT INTO dbo.Tmp_prims (UUID, RegionUUID, ParentID, CreationDate, Name, SceneGroupID, Text, Description, SitName, TouchName, ObjectFlags, CreatorID, OwnerID, GroupID, LastOwnerID, OwnerMask, NextOwnerMask, GroupMask, EveryoneMask, BaseMask, PositionX, PositionY, PositionZ, GroupPositionX, GroupPositionY, GroupPositionZ, VelocityX, VelocityY, VelocityZ, AngularVelocityX, AngularVelocityY, AngularVelocityZ, AccelerationX, AccelerationY, AccelerationZ, RotationX, RotationY, RotationZ, RotationW, SitTargetOffsetX, SitTargetOffsetY, SitTargetOffsetZ, SitTargetOrientW, SitTargetOrientX, SitTargetOrientY, SitTargetOrientZ)
SELECT CONVERT(varchar(36), UUID), CONVERT(varchar(36), RegionUUID), ParentID, CreationDate, Name, CONVERT(varchar(36), SceneGroupID), Text, Description, SitName, TouchName, ObjectFlags, CONVERT(varchar(36), CreatorID), CONVERT(varchar(36), OwnerID), CONVERT(varchar(36), GroupID), CONVERT(varchar(36), LastOwnerID), OwnerMask, NextOwnerMask, GroupMask, EveryoneMask, BaseMask, PositionX, PositionY, PositionZ, GroupPositionX, GroupPositionY, GroupPositionZ, VelocityX, VelocityY, VelocityZ, AngularVelocityX, AngularVelocityY, AngularVelocityZ, AccelerationX, AccelerationY, AccelerationZ, RotationX, RotationY, RotationZ, RotationW, SitTargetOffsetX, SitTargetOffsetY, SitTargetOffsetZ, SitTargetOrientW, SitTargetOrientX, SitTargetOrientY, SitTargetOrientZ FROM dbo.prims WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.prims
EXECUTE sp_rename N'dbo.Tmp_prims', N'prims', 'OBJECT'
ALTER TABLE dbo.prims ADD CONSTRAINT
PK__prims__10566F31 PRIMARY KEY CLUSTERED
(
UUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,9 +0,0 @@
BEGIN TRANSACTION
CREATE UNIQUE INDEX PrincipalID ON UserAccounts(PrincipalID);
CREATE INDEX Email ON UserAccounts(Email);
CREATE INDEX FirstName ON UserAccounts(FirstName);
CREATE INDEX LastName ON UserAccounts(LastName);
CREATE INDEX Name ON UserAccounts(FirstName,LastName);
COMMIT

View File

@ -1,15 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE [avatarattachments] (
[UUID] varchar(36) NOT NULL
, [attachpoint] int NOT NULL
, [item] varchar(36) NOT NULL
, [asset] varchar(36) NOT NULL)
CREATE NONCLUSTERED INDEX IX_avatarattachments ON dbo.avatarattachments
(
UUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,31 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_assets
(
id uniqueidentifier NOT NULL,
name varchar(64) NOT NULL,
description varchar(64) NOT NULL,
assetType tinyint NOT NULL,
local bit NOT NULL,
temporary bit NOT NULL,
data image NOT NULL,
create_time int NULL,
access_time int NULL
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.assets)
EXEC('INSERT INTO dbo.Tmp_assets (id, name, description, assetType, local, temporary, data, create_time, access_time)
SELECT CONVERT(uniqueidentifier, id), name, description, assetType, local, temporary, data, create_time, access_time FROM dbo.assets WITH (HOLDLOCK TABLOCKX)')
DROP TABLE assets
EXECUTE sp_rename N'Tmp_assets', N'assets', 'OBJECT'
ALTER TABLE dbo.assets ADD CONSTRAINT
PK__assets__id PRIMARY KEY CLUSTERED
(
id
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,22 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_estate_managers
(
EstateID int NOT NULL,
uuid uniqueidentifier NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.estate_managers)
EXEC('INSERT INTO dbo.Tmp_estate_managers (EstateID, uuid)
SELECT EstateID, CONVERT(uniqueidentifier, uuid) FROM dbo.estate_managers WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.estate_managers
EXECUTE sp_rename N'dbo.Tmp_estate_managers', N'estate_managers', 'OBJECT'
CREATE NONCLUSTERED INDEX IX_estate_managers ON dbo.estate_managers
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,68 +0,0 @@
/* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_regions
(
uuid uniqueidentifier NOT NULL,
regionHandle bigint NULL,
regionName varchar(20) NULL,
regionRecvKey varchar(128) NULL,
regionSendKey varchar(128) NULL,
regionSecret varchar(128) NULL,
regionDataURI varchar(128) NULL,
serverIP varchar(64) NULL,
serverPort int NULL,
serverURI varchar(255) NULL,
locX int NULL,
locY int NULL,
locZ int NULL,
eastOverrideHandle bigint NULL,
westOverrideHandle bigint NULL,
southOverrideHandle bigint NULL,
northOverrideHandle bigint NULL,
regionAssetURI varchar(255) NULL,
regionAssetRecvKey varchar(128) NULL,
regionAssetSendKey varchar(128) NULL,
regionUserURI varchar(255) NULL,
regionUserRecvKey varchar(128) NULL,
regionUserSendKey varchar(128) NULL,
regionMapTexture uniqueidentifier NULL,
serverHttpPort int NULL,
serverRemotingPort int NULL,
owner_uuid uniqueidentifier NOT NULL,
originUUID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000')
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.regions)
EXEC('INSERT INTO dbo.Tmp_regions (uuid, regionHandle, regionName, regionRecvKey, regionSendKey, regionSecret, regionDataURI, serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, regionMapTexture, serverHttpPort, serverRemotingPort, owner_uuid, originUUID)
SELECT CONVERT(uniqueidentifier, uuid), regionHandle, regionName, regionRecvKey, regionSendKey, regionSecret, regionDataURI, serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, CONVERT(uniqueidentifier, regionMapTexture), serverHttpPort, serverRemotingPort, CONVERT(uniqueidentifier, owner_uuid), CONVERT(uniqueidentifier, originUUID) FROM dbo.regions WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.regions
EXECUTE sp_rename N'dbo.Tmp_regions', N'regions', 'OBJECT'
ALTER TABLE dbo.regions ADD CONSTRAINT
PK__regions__uuid PRIMARY KEY CLUSTERED
(
uuid
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX IX_regions_name ON dbo.regions
(
regionName
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX IX_regions_handle ON dbo.regions
(
regionHandle
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX IX_regions_override ON dbo.regions
(
eastOverrideHandle,
westOverrideHandle,
southOverrideHandle,
northOverrideHandle
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,52 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_inventoryitems
(
inventoryID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
assetID uniqueidentifier NULL DEFAULT (NULL),
assetType int NULL DEFAULT (NULL),
parentFolderID uniqueidentifier NULL DEFAULT (NULL),
avatarID uniqueidentifier NULL DEFAULT (NULL),
inventoryName varchar(64) NULL DEFAULT (NULL),
inventoryDescription varchar(128) NULL DEFAULT (NULL),
inventoryNextPermissions int NULL DEFAULT (NULL),
inventoryCurrentPermissions int NULL DEFAULT (NULL),
invType int NULL DEFAULT (NULL),
creatorID uniqueidentifier NULL DEFAULT (NULL),
inventoryBasePermissions int NOT NULL DEFAULT ((0)),
inventoryEveryOnePermissions int NOT NULL DEFAULT ((0)),
salePrice int NULL DEFAULT (NULL),
saleType tinyint NULL DEFAULT (NULL),
creationDate int NULL DEFAULT (NULL),
groupID uniqueidentifier NULL DEFAULT (NULL),
groupOwned bit NULL DEFAULT (NULL),
flags int NULL DEFAULT (NULL),
inventoryGroupPermissions int NOT NULL DEFAULT ((0))
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.inventoryitems)
EXEC('INSERT INTO dbo.Tmp_inventoryitems (inventoryID, assetID, assetType, parentFolderID, avatarID, inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType, creatorID, inventoryBasePermissions, inventoryEveryOnePermissions, salePrice, saleType, creationDate, groupID, groupOwned, flags, inventoryGroupPermissions)
SELECT CONVERT(uniqueidentifier, inventoryID), CONVERT(uniqueidentifier, assetID), assetType, CONVERT(uniqueidentifier, parentFolderID), CONVERT(uniqueidentifier, avatarID), inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType, CONVERT(uniqueidentifier, creatorID), inventoryBasePermissions, inventoryEveryOnePermissions, salePrice, saleType, creationDate, CONVERT(uniqueidentifier, groupID), groupOwned, flags, inventoryGroupPermissions FROM dbo.inventoryitems WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.inventoryitems
EXECUTE sp_rename N'dbo.Tmp_inventoryitems', N'inventoryitems', 'OBJECT'
ALTER TABLE dbo.inventoryitems ADD CONSTRAINT
PK__inventor__C4B7BC2220C1E124 PRIMARY KEY CLUSTERED
(
inventoryID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX owner ON dbo.inventoryitems
(
avatarID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX folder ON dbo.inventoryitems
(
parentFolderID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,40 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE Tmp_primitems
(
itemID varchar(36) NOT NULL,
primID varchar(36) NULL,
assetID varchar(36) NULL,
parentFolderID varchar(36) NULL,
invType int NULL,
assetType int NULL,
name varchar(255) NULL,
description varchar(255) NULL,
creationDate varchar(255) NULL,
creatorID varchar(36) NULL,
ownerID varchar(36) NULL,
lastOwnerID varchar(36) NULL,
groupID varchar(36) NULL,
nextPermissions int NULL,
currentPermissions int NULL,
basePermissions int NULL,
everyonePermissions int NULL,
groupPermissions int NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM primitems)
EXEC('INSERT INTO Tmp_primitems (itemID, primID, assetID, parentFolderID, invType, assetType, name, description, creationDate, creatorID, ownerID, lastOwnerID, groupID, nextPermissions, currentPermissions, basePermissions, everyonePermissions, groupPermissions)
SELECT CONVERT(varchar(36), itemID), CONVERT(varchar(36), primID), CONVERT(varchar(36), assetID), CONVERT(varchar(36), parentFolderID), invType, assetType, name, description, creationDate, CONVERT(varchar(36), creatorID), CONVERT(varchar(36), ownerID), CONVERT(varchar(36), lastOwnerID), CONVERT(varchar(36), groupID), nextPermissions, currentPermissions, basePermissions, everyonePermissions, groupPermissions')
DROP TABLE primitems
EXECUTE sp_rename N'Tmp_primitems', N'primitems', 'OBJECT'
ALTER TABLE primitems ADD CONSTRAINT
PK__primitems__0A688BB1 PRIMARY KEY CLUSTERED
(
itemID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,7 +0,0 @@
BEGIN TRANSACTION
ALTER TABLE UserAccounts ADD UserLevel integer NOT NULL DEFAULT 0;
ALTER TABLE UserAccounts ADD UserFlags integer NOT NULL DEFAULT 0;
ALTER TABLE UserAccounts ADD UserTitle varchar(64) NOT NULL DEFAULT '';
COMMIT

View File

@ -1,29 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE Tmp_userfriends
(
ownerID varchar(36) NOT NULL,
friendID varchar(36) NOT NULL,
friendPerms int NOT NULL,
datetimestamp int NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM userfriends)
EXEC('INSERT INTO dbo.Tmp_userfriends (ownerID, friendID, friendPerms, datetimestamp)
SELECT CONVERT(varchar(36), ownerID), CONVERT(varchar(36), friendID), CONVERT(int, friendPerms), CONVERT(int, datetimestamp) FROM dbo.userfriends WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.userfriends
EXECUTE sp_rename N'Tmp_userfriends', N'userfriends', 'OBJECT'
CREATE NONCLUSTERED INDEX IX_userfriends_ownerID ON userfriends
(
ownerID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX IX_userfriends_friendID ON userfriends
(
friendID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1 +0,0 @@
DELETE FROM assets WHERE id = 'dc4b9f0b-d008-45c6-96a4-01dd947ac621';

View File

@ -1,22 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_estate_groups
(
EstateID int NOT NULL,
uuid uniqueidentifier NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.estate_groups)
EXEC('INSERT INTO dbo.Tmp_estate_groups (EstateID, uuid)
SELECT EstateID, CONVERT(uniqueidentifier, uuid) FROM dbo.estate_groups WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.estate_groups
EXECUTE sp_rename N'dbo.Tmp_estate_groups', N'estate_groups', 'OBJECT'
CREATE NONCLUSTERED INDEX IX_estate_groups ON dbo.estate_groups
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,5 +0,0 @@
BEGIN TRANSACTION
ALTER TABLE regions ADD access int default 0;
COMMIT

View File

@ -1,49 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE Tmp_primshapes
(
UUID varchar(36) NOT NULL,
Shape int NULL,
ScaleX float(53) NULL,
ScaleY float(53) NULL,
ScaleZ float(53) NULL,
PCode int NULL,
PathBegin int NULL,
PathEnd int NULL,
PathScaleX int NULL,
PathScaleY int NULL,
PathShearX int NULL,
PathShearY int NULL,
PathSkew int NULL,
PathCurve int NULL,
PathRadiusOffset int NULL,
PathRevolutions int NULL,
PathTaperX int NULL,
PathTaperY int NULL,
PathTwist int NULL,
PathTwistBegin int NULL,
ProfileBegin int NULL,
ProfileEnd int NULL,
ProfileCurve int NULL,
ProfileHollow int NULL,
State int NULL,
Texture image NULL,
ExtraParams image NULL
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
IF EXISTS(SELECT * FROM primshapes)
EXEC('INSERT INTO Tmp_primshapes (UUID, Shape, ScaleX, ScaleY, ScaleZ, PCode, PathBegin, PathEnd, PathScaleX, PathScaleY, PathShearX, PathShearY, PathSkew, PathCurve, PathRadiusOffset, PathRevolutions, PathTaperX, PathTaperY, PathTwist, PathTwistBegin, ProfileBegin, ProfileEnd, ProfileCurve, ProfileHollow, State, Texture, ExtraParams)
SELECT CONVERT(varchar(36), UUID), Shape, ScaleX, ScaleY, ScaleZ, PCode, PathBegin, PathEnd, PathScaleX, PathScaleY, PathShearX, PathShearY, PathSkew, PathCurve, PathRadiusOffset, PathRevolutions, PathTaperX, PathTaperY, PathTwist, PathTwistBegin, ProfileBegin, ProfileEnd, ProfileCurve, ProfileHollow, State, Texture, ExtraParams FROM primshapes WITH (HOLDLOCK TABLOCKX)')
DROP TABLE primshapes
EXECUTE sp_rename N'Tmp_primshapes', N'primshapes', 'OBJECT'
ALTER TABLE primshapes ADD CONSTRAINT
PK__primshapes__0880433F PRIMARY KEY CLUSTERED
(
UUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,5 +0,0 @@
BEGIN TRANSACTION
ALTER TABLE users add email varchar(250);
COMMIT

View File

@ -1,22 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_estate_users
(
EstateID int NOT NULL,
uuid uniqueidentifier NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.estate_users)
EXEC('INSERT INTO dbo.Tmp_estate_users (EstateID, uuid)
SELECT EstateID, CONVERT(uniqueidentifier, uuid) FROM dbo.estate_users WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.estate_users
EXECUTE sp_rename N'dbo.Tmp_estate_users', N'estate_users', 'OBJECT'
CREATE NONCLUSTERED INDEX IX_estate_users ON dbo.estate_users
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,8 +0,0 @@
BEGIN TRANSACTION
ALTER TABLE regions ADD scopeid uniqueidentifier default '00000000-0000-0000-0000-000000000000';
ALTER TABLE regions ADD DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [owner_uuid];
ALTER TABLE regions ADD sizeX integer not null default 0;
ALTER TABLE regions ADD sizeY integer not null default 0;
COMMIT

View File

@ -1,36 +0,0 @@
BEGIN TRANSACTION
ALTER TABLE prims ADD PayPrice int not null default 0
ALTER TABLE prims ADD PayButton1 int not null default 0
ALTER TABLE prims ADD PayButton2 int not null default 0
ALTER TABLE prims ADD PayButton3 int not null default 0
ALTER TABLE prims ADD PayButton4 int not null default 0
ALTER TABLE prims ADD LoopedSound varchar(36) not null default '00000000-0000-0000-0000-000000000000';
ALTER TABLE prims ADD LoopedSoundGain float not null default 0.0;
ALTER TABLE prims ADD TextureAnimation image
ALTER TABLE prims ADD OmegaX float not null default 0.0
ALTER TABLE prims ADD OmegaY float not null default 0.0
ALTER TABLE prims ADD OmegaZ float not null default 0.0
ALTER TABLE prims ADD CameraEyeOffsetX float not null default 0.0
ALTER TABLE prims ADD CameraEyeOffsetY float not null default 0.0
ALTER TABLE prims ADD CameraEyeOffsetZ float not null default 0.0
ALTER TABLE prims ADD CameraAtOffsetX float not null default 0.0
ALTER TABLE prims ADD CameraAtOffsetY float not null default 0.0
ALTER TABLE prims ADD CameraAtOffsetZ float not null default 0.0
ALTER TABLE prims ADD ForceMouselook tinyint not null default 0
ALTER TABLE prims ADD ScriptAccessPin int not null default 0
ALTER TABLE prims ADD AllowedDrop tinyint not null default 0
ALTER TABLE prims ADD DieAtEdge tinyint not null default 0
ALTER TABLE prims ADD SalePrice int not null default 10
ALTER TABLE prims ADD SaleType tinyint not null default 0
ALTER TABLE primitems add flags integer not null default 0
ALTER TABLE land ADD AuthbuyerID varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000'
CREATE index prims_regionuuid on prims(RegionUUID)
CREATE index prims_parentid on prims(ParentID)
CREATE index primitems_primid on primitems(primID)
COMMIT

View File

@ -1,57 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_users
(
UUID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
username varchar(32) NOT NULL,
lastname varchar(32) NOT NULL,
passwordHash varchar(32) NOT NULL,
passwordSalt varchar(32) NOT NULL,
homeRegion bigint NULL DEFAULT (NULL),
homeLocationX float(53) NULL DEFAULT (NULL),
homeLocationY float(53) NULL DEFAULT (NULL),
homeLocationZ float(53) NULL DEFAULT (NULL),
homeLookAtX float(53) NULL DEFAULT (NULL),
homeLookAtY float(53) NULL DEFAULT (NULL),
homeLookAtZ float(53) NULL DEFAULT (NULL),
created int NOT NULL,
lastLogin int NOT NULL,
userInventoryURI varchar(255) NULL DEFAULT (NULL),
userAssetURI varchar(255) NULL DEFAULT (NULL),
profileCanDoMask int NULL DEFAULT (NULL),
profileWantDoMask int NULL DEFAULT (NULL),
profileAboutText ntext NULL,
profileFirstText ntext NULL,
profileImage uniqueidentifier NULL DEFAULT (NULL),
profileFirstImage uniqueidentifier NULL DEFAULT (NULL),
webLoginKey uniqueidentifier NULL DEFAULT (NULL),
homeRegionID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
userFlags int NOT NULL DEFAULT ((0)),
godLevel int NOT NULL DEFAULT ((0)),
customType varchar(32) NOT NULL DEFAULT (''),
partner uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
email varchar(250) NULL
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.users)
EXEC('INSERT INTO dbo.Tmp_users (UUID, username, lastname, passwordHash, passwordSalt, homeRegion, homeLocationX, homeLocationY, homeLocationZ, homeLookAtX, homeLookAtY, homeLookAtZ, created, lastLogin, userInventoryURI, userAssetURI, profileCanDoMask, profileWantDoMask, profileAboutText, profileFirstText, profileImage, profileFirstImage, webLoginKey, homeRegionID, userFlags, godLevel, customType, partner, email)
SELECT CONVERT(uniqueidentifier, UUID), username, lastname, passwordHash, passwordSalt, homeRegion, homeLocationX, homeLocationY, homeLocationZ, homeLookAtX, homeLookAtY, homeLookAtZ, created, lastLogin, userInventoryURI, userAssetURI, profileCanDoMask, profileWantDoMask, profileAboutText, profileFirstText, CONVERT(uniqueidentifier, profileImage), CONVERT(uniqueidentifier, profileFirstImage), CONVERT(uniqueidentifier, webLoginKey), CONVERT(uniqueidentifier, homeRegionID), userFlags, godLevel, customType, CONVERT(uniqueidentifier, partner), email FROM dbo.users WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.users
EXECUTE sp_rename N'dbo.Tmp_users', N'users', 'OBJECT'
ALTER TABLE dbo.users ADD CONSTRAINT
PK__users__65A475E737A5467C PRIMARY KEY CLUSTERED
(
UUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX usernames ON dbo.users
(
username,
lastname
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,25 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_estateban
(
EstateID int NOT NULL,
bannedUUID uniqueidentifier NOT NULL,
bannedIp varchar(16) NULL,
bannedIpHostMask varchar(16) NULL,
bannedNameMask varchar(64) NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.estateban)
EXEC('INSERT INTO dbo.Tmp_estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask)
SELECT EstateID, CONVERT(uniqueidentifier, bannedUUID), bannedIp, bannedIpHostMask, bannedNameMask FROM dbo.estateban WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.estateban
EXECUTE sp_rename N'dbo.Tmp_estateban', N'estateban', 'OBJECT'
CREATE NONCLUSTERED INDEX IX_estateban ON dbo.estateban
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,9 +0,0 @@
BEGIN TRANSACTION
ALTER TABLE regions ADD [flags] integer NOT NULL DEFAULT 0;
CREATE INDEX [flags] ON regions(flags);
ALTER TABLE [regions] ADD [last_seen] integer NOT NULL DEFAULT 0;
ALTER TABLE [regions] ADD [PrincipalID] uniqueidentifier NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
ALTER TABLE [regions] ADD [Token] varchar(255) NOT NULL DEFAULT 0;
COMMIT

View File

@ -1,10 +0,0 @@
BEGIN TRANSACTION
ALTER TABLE prims ADD ColorR int not null default 0;
ALTER TABLE prims ADD ColorG int not null default 0;
ALTER TABLE prims ADD ColorB int not null default 0;
ALTER TABLE prims ADD ColorA int not null default 0;
ALTER TABLE prims ADD ParticleSystem IMAGE;
ALTER TABLE prims ADD ClickAction tinyint NOT NULL default 0;
COMMIT

View File

@ -1,42 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_agents
(
UUID uniqueidentifier NOT NULL,
sessionID uniqueidentifier NOT NULL,
secureSessionID uniqueidentifier NOT NULL,
agentIP varchar(16) NOT NULL,
agentPort int NOT NULL,
agentOnline tinyint NOT NULL,
loginTime int NOT NULL,
logoutTime int NOT NULL,
currentRegion uniqueidentifier NOT NULL,
currentHandle bigint NOT NULL,
currentPos varchar(64) NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.agents)
EXEC('INSERT INTO dbo.Tmp_agents (UUID, sessionID, secureSessionID, agentIP, agentPort, agentOnline, loginTime, logoutTime, currentRegion, currentHandle, currentPos)
SELECT CONVERT(uniqueidentifier, UUID), CONVERT(uniqueidentifier, sessionID), CONVERT(uniqueidentifier, secureSessionID), agentIP, agentPort, agentOnline, loginTime, logoutTime, CONVERT(uniqueidentifier, currentRegion), currentHandle, currentPos FROM dbo.agents WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.agents
EXECUTE sp_rename N'dbo.Tmp_agents', N'agents', 'OBJECT'
ALTER TABLE dbo.agents ADD CONSTRAINT
PK__agents__65A475E749C3F6B7 PRIMARY KEY CLUSTERED
(
UUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX session ON dbo.agents
(
sessionID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX ssession ON dbo.agents
(
secureSessionID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,49 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_estate_settings
(
EstateID int NOT NULL IDENTITY (1, 100),
EstateName varchar(64) NULL DEFAULT (NULL),
AbuseEmailToEstateOwner bit NOT NULL,
DenyAnonymous bit NOT NULL,
ResetHomeOnTeleport bit NOT NULL,
FixedSun bit NOT NULL,
DenyTransacted bit NOT NULL,
BlockDwell bit NOT NULL,
DenyIdentified bit NOT NULL,
AllowVoice bit NOT NULL,
UseGlobalTime bit NOT NULL,
PricePerMeter int NOT NULL,
TaxFree bit NOT NULL,
AllowDirectTeleport bit NOT NULL,
RedirectGridX int NOT NULL,
RedirectGridY int NOT NULL,
ParentEstateID int NOT NULL,
SunPosition float(53) NOT NULL,
EstateSkipScripts bit NOT NULL,
BillableFactor float(53) NOT NULL,
PublicAccess bit NOT NULL,
AbuseEmail varchar(255) NOT NULL,
EstateOwner uniqueidentifier NOT NULL,
DenyMinors bit NOT NULL
) ON [PRIMARY]
SET IDENTITY_INSERT dbo.Tmp_estate_settings ON
IF EXISTS(SELECT * FROM dbo.estate_settings)
EXEC('INSERT INTO dbo.Tmp_estate_settings (EstateID, EstateName, AbuseEmailToEstateOwner, DenyAnonymous, ResetHomeOnTeleport, FixedSun, DenyTransacted, BlockDwell, DenyIdentified, AllowVoice, UseGlobalTime, PricePerMeter, TaxFree, AllowDirectTeleport, RedirectGridX, RedirectGridY, ParentEstateID, SunPosition, EstateSkipScripts, BillableFactor, PublicAccess, AbuseEmail, EstateOwner, DenyMinors)
SELECT EstateID, EstateName, AbuseEmailToEstateOwner, DenyAnonymous, ResetHomeOnTeleport, FixedSun, DenyTransacted, BlockDwell, DenyIdentified, AllowVoice, UseGlobalTime, PricePerMeter, TaxFree, AllowDirectTeleport, RedirectGridX, RedirectGridY, ParentEstateID, SunPosition, EstateSkipScripts, BillableFactor, PublicAccess, AbuseEmail, CONVERT(uniqueidentifier, EstateOwner), DenyMinors FROM dbo.estate_settings WITH (HOLDLOCK TABLOCKX)')
SET IDENTITY_INSERT dbo.Tmp_estate_settings OFF
DROP TABLE dbo.estate_settings
EXECUTE sp_rename N'dbo.Tmp_estate_settings', N'estate_settings', 'OBJECT'
ALTER TABLE dbo.estate_settings ADD CONSTRAINT
PK_estate_settings PRIMARY KEY CLUSTERED
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,7 +0,0 @@
BEGIN TRANSACTION
ALTER TABLE land ADD OtherCleanTime integer NOT NULL default 0;
ALTER TABLE land ADD Dwell integer NOT NULL default 0;
COMMIT

View File

@ -1,29 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_userfriends
(
ownerID uniqueidentifier NOT NULL,
friendID uniqueidentifier NOT NULL,
friendPerms int NOT NULL,
datetimestamp int NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.userfriends)
EXEC('INSERT INTO dbo.Tmp_userfriends (ownerID, friendID, friendPerms, datetimestamp)
SELECT CONVERT(uniqueidentifier, ownerID), CONVERT(uniqueidentifier, friendID), friendPerms, datetimestamp FROM dbo.userfriends WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.userfriends
EXECUTE sp_rename N'dbo.Tmp_userfriends', N'userfriends', 'OBJECT'
CREATE NONCLUSTERED INDEX IX_userfriends_ownerID ON dbo.userfriends
(
ownerID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX IX_userfriends_friendID ON dbo.userfriends
(
friendID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,24 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_estate_map
(
RegionID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
EstateID int NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.estate_map)
EXEC('INSERT INTO dbo.Tmp_estate_map (RegionID, EstateID)
SELECT CONVERT(uniqueidentifier, RegionID), EstateID FROM dbo.estate_map WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.estate_map
EXECUTE sp_rename N'dbo.Tmp_estate_map', N'estate_map', 'OBJECT'
ALTER TABLE dbo.estate_map ADD CONSTRAINT
PK_estate_map PRIMARY KEY CLUSTERED
(
RegionID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,5 +0,0 @@
BEGIN TRANSACTION
ALTER TABLE prims ADD Material tinyint NOT NULL default 3
COMMIT

View File

@ -1,53 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_avatarappearance
(
Owner uniqueidentifier NOT NULL,
Serial int NOT NULL,
Visual_Params image NOT NULL,
Texture image NOT NULL,
Avatar_Height float(53) NOT NULL,
Body_Item uniqueidentifier NOT NULL,
Body_Asset uniqueidentifier NOT NULL,
Skin_Item uniqueidentifier NOT NULL,
Skin_Asset uniqueidentifier NOT NULL,
Hair_Item uniqueidentifier NOT NULL,
Hair_Asset uniqueidentifier NOT NULL,
Eyes_Item uniqueidentifier NOT NULL,
Eyes_Asset uniqueidentifier NOT NULL,
Shirt_Item uniqueidentifier NOT NULL,
Shirt_Asset uniqueidentifier NOT NULL,
Pants_Item uniqueidentifier NOT NULL,
Pants_Asset uniqueidentifier NOT NULL,
Shoes_Item uniqueidentifier NOT NULL,
Shoes_Asset uniqueidentifier NOT NULL,
Socks_Item uniqueidentifier NOT NULL,
Socks_Asset uniqueidentifier NOT NULL,
Jacket_Item uniqueidentifier NOT NULL,
Jacket_Asset uniqueidentifier NOT NULL,
Gloves_Item uniqueidentifier NOT NULL,
Gloves_Asset uniqueidentifier NOT NULL,
Undershirt_Item uniqueidentifier NOT NULL,
Undershirt_Asset uniqueidentifier NOT NULL,
Underpants_Item uniqueidentifier NOT NULL,
Underpants_Asset uniqueidentifier NOT NULL,
Skirt_Item uniqueidentifier NOT NULL,
Skirt_Asset uniqueidentifier NOT NULL
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.avatarappearance)
EXEC('INSERT INTO dbo.Tmp_avatarappearance (Owner, Serial, Visual_Params, Texture, Avatar_Height, Body_Item, Body_Asset, Skin_Item, Skin_Asset, Hair_Item, Hair_Asset, Eyes_Item, Eyes_Asset, Shirt_Item, Shirt_Asset, Pants_Item, Pants_Asset, Shoes_Item, Shoes_Asset, Socks_Item, Socks_Asset, Jacket_Item, Jacket_Asset, Gloves_Item, Gloves_Asset, Undershirt_Item, Undershirt_Asset, Underpants_Item, Underpants_Asset, Skirt_Item, Skirt_Asset)
SELECT CONVERT(uniqueidentifier, Owner), Serial, Visual_Params, Texture, Avatar_Height, CONVERT(uniqueidentifier, Body_Item), CONVERT(uniqueidentifier, Body_Asset), CONVERT(uniqueidentifier, Skin_Item), CONVERT(uniqueidentifier, Skin_Asset), CONVERT(uniqueidentifier, Hair_Item), CONVERT(uniqueidentifier, Hair_Asset), CONVERT(uniqueidentifier, Eyes_Item), CONVERT(uniqueidentifier, Eyes_Asset), CONVERT(uniqueidentifier, Shirt_Item), CONVERT(uniqueidentifier, Shirt_Asset), CONVERT(uniqueidentifier, Pants_Item), CONVERT(uniqueidentifier, Pants_Asset), CONVERT(uniqueidentifier, Shoes_Item), CONVERT(uniqueidentifier, Shoes_Asset), CONVERT(uniqueidentifier, Socks_Item), CONVERT(uniqueidentifier, Socks_Asset), CONVERT(uniqueidentifier, Jacket_Item), CONVERT(uniqueidentifier, Jacket_Asset), CONVERT(uniqueidentifier, Gloves_Item), CONVERT(uniqueidentifier, Gloves_Asset), CONVERT(uniqueidentifier, Undershirt_Item), CONVERT(uniqueidentifier, Undershirt_Asset), CONVERT(uniqueidentifier, Underpants_Item), CONVERT(uniqueidentifier, Underpants_Asset), CONVERT(uniqueidentifier, Skirt_Item), CONVERT(uniqueidentifier, Skirt_Asset) FROM dbo.avatarappearance WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.avatarappearance
EXECUTE sp_rename N'dbo.Tmp_avatarappearance', N'avatarappearance', 'OBJECT'
ALTER TABLE dbo.avatarappearance ADD CONSTRAINT
PK__avatarap__7DD115CC4E88ABD4 PRIMARY KEY CLUSTERED
(
Owner
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,7 +0,0 @@
BEGIN TRANSACTION
ALTER TABLE regionsettings ADD sunvectorx float NOT NULL default 0;
ALTER TABLE regionsettings ADD sunvectory float NOT NULL default 0;
ALTER TABLE regionsettings ADD sunvectorz float NOT NULL default 0;
COMMIT

View File

@ -1,24 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_avatarattachments
(
UUID uniqueidentifier NOT NULL,
attachpoint int NOT NULL,
item uniqueidentifier NOT NULL,
asset uniqueidentifier NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.avatarattachments)
EXEC('INSERT INTO dbo.Tmp_avatarattachments (UUID, attachpoint, item, asset)
SELECT CONVERT(uniqueidentifier, UUID), attachpoint, CONVERT(uniqueidentifier, item), CONVERT(uniqueidentifier, asset) FROM dbo.avatarattachments WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.avatarattachments
EXECUTE sp_rename N'dbo.Tmp_avatarattachments', N'avatarattachments', 'OBJECT'
CREATE NONCLUSTERED INDEX IX_avatarattachments ON dbo.avatarattachments
(
UUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,6 +0,0 @@
BEGIN TRANSACTION
ALTER TABLE prims ADD CollisionSound char(36) not null default '00000000-0000-0000-0000-000000000000'
ALTER TABLE prims ADD CollisionSoundVolume float not null default 0.0
COMMIT

View File

@ -1,5 +0,0 @@
BEGIN TRANSACTION
ALTER TABLE users ADD scopeID uniqueidentifier not null default '00000000-0000-0000-0000-000000000000'
COMMIT

View File

@ -1,5 +0,0 @@
BEGIN TRANSACTION
ALTER TABLE prims ADD LinkNumber integer not null default 0
COMMIT

View File

@ -1,112 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_prims
(
UUID uniqueidentifier NOT NULL,
RegionUUID uniqueidentifier NULL,
ParentID int NULL,
CreationDate int NULL,
Name varchar(255) NULL,
SceneGroupID uniqueidentifier NULL,
Text varchar(255) NULL,
Description varchar(255) NULL,
SitName varchar(255) NULL,
TouchName varchar(255) NULL,
ObjectFlags int NULL,
CreatorID uniqueidentifier NULL,
OwnerID uniqueidentifier NULL,
GroupID uniqueidentifier NULL,
LastOwnerID uniqueidentifier NULL,
OwnerMask int NULL,
NextOwnerMask int NULL,
GroupMask int NULL,
EveryoneMask int NULL,
BaseMask int NULL,
PositionX float(53) NULL,
PositionY float(53) NULL,
PositionZ float(53) NULL,
GroupPositionX float(53) NULL,
GroupPositionY float(53) NULL,
GroupPositionZ float(53) NULL,
VelocityX float(53) NULL,
VelocityY float(53) NULL,
VelocityZ float(53) NULL,
AngularVelocityX float(53) NULL,
AngularVelocityY float(53) NULL,
AngularVelocityZ float(53) NULL,
AccelerationX float(53) NULL,
AccelerationY float(53) NULL,
AccelerationZ float(53) NULL,
RotationX float(53) NULL,
RotationY float(53) NULL,
RotationZ float(53) NULL,
RotationW float(53) NULL,
SitTargetOffsetX float(53) NULL,
SitTargetOffsetY float(53) NULL,
SitTargetOffsetZ float(53) NULL,
SitTargetOrientW float(53) NULL,
SitTargetOrientX float(53) NULL,
SitTargetOrientY float(53) NULL,
SitTargetOrientZ float(53) NULL,
PayPrice int NOT NULL DEFAULT ((0)),
PayButton1 int NOT NULL DEFAULT ((0)),
PayButton2 int NOT NULL DEFAULT ((0)),
PayButton3 int NOT NULL DEFAULT ((0)),
PayButton4 int NOT NULL DEFAULT ((0)),
LoopedSound uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
LoopedSoundGain float(53) NOT NULL DEFAULT ((0.0)),
TextureAnimation image NULL,
OmegaX float(53) NOT NULL DEFAULT ((0.0)),
OmegaY float(53) NOT NULL DEFAULT ((0.0)),
OmegaZ float(53) NOT NULL DEFAULT ((0.0)),
CameraEyeOffsetX float(53) NOT NULL DEFAULT ((0.0)),
CameraEyeOffsetY float(53) NOT NULL DEFAULT ((0.0)),
CameraEyeOffsetZ float(53) NOT NULL DEFAULT ((0.0)),
CameraAtOffsetX float(53) NOT NULL DEFAULT ((0.0)),
CameraAtOffsetY float(53) NOT NULL DEFAULT ((0.0)),
CameraAtOffsetZ float(53) NOT NULL DEFAULT ((0.0)),
ForceMouselook tinyint NOT NULL DEFAULT ((0)),
ScriptAccessPin int NOT NULL DEFAULT ((0)),
AllowedDrop tinyint NOT NULL DEFAULT ((0)),
DieAtEdge tinyint NOT NULL DEFAULT ((0)),
SalePrice int NOT NULL DEFAULT ((10)),
SaleType tinyint NOT NULL DEFAULT ((0)),
ColorR int NOT NULL DEFAULT ((0)),
ColorG int NOT NULL DEFAULT ((0)),
ColorB int NOT NULL DEFAULT ((0)),
ColorA int NOT NULL DEFAULT ((0)),
ParticleSystem image NULL,
ClickAction tinyint NOT NULL DEFAULT ((0)),
Material tinyint NOT NULL DEFAULT ((3)),
CollisionSound uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
CollisionSoundVolume float(53) NOT NULL DEFAULT ((0.0)),
LinkNumber int NOT NULL DEFAULT ((0))
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.prims)
EXEC('INSERT INTO dbo.Tmp_prims (UUID, RegionUUID, ParentID, CreationDate, Name, SceneGroupID, Text, Description, SitName, TouchName, ObjectFlags, CreatorID, OwnerID, GroupID, LastOwnerID, OwnerMask, NextOwnerMask, GroupMask, EveryoneMask, BaseMask, PositionX, PositionY, PositionZ, GroupPositionX, GroupPositionY, GroupPositionZ, VelocityX, VelocityY, VelocityZ, AngularVelocityX, AngularVelocityY, AngularVelocityZ, AccelerationX, AccelerationY, AccelerationZ, RotationX, RotationY, RotationZ, RotationW, SitTargetOffsetX, SitTargetOffsetY, SitTargetOffsetZ, SitTargetOrientW, SitTargetOrientX, SitTargetOrientY, SitTargetOrientZ, PayPrice, PayButton1, PayButton2, PayButton3, PayButton4, LoopedSound, LoopedSoundGain, TextureAnimation, OmegaX, OmegaY, OmegaZ, CameraEyeOffsetX, CameraEyeOffsetY, CameraEyeOffsetZ, CameraAtOffsetX, CameraAtOffsetY, CameraAtOffsetZ, ForceMouselook, ScriptAccessPin, AllowedDrop, DieAtEdge, SalePrice, SaleType, ColorR, ColorG, ColorB, ColorA, ParticleSystem, ClickAction, Material, CollisionSound, CollisionSoundVolume, LinkNumber)
SELECT CONVERT(uniqueidentifier, UUID), CONVERT(uniqueidentifier, RegionUUID), ParentID, CreationDate, Name, CONVERT(uniqueidentifier, SceneGroupID), Text, Description, SitName, TouchName, ObjectFlags, CONVERT(uniqueidentifier, CreatorID), CONVERT(uniqueidentifier, OwnerID), CONVERT(uniqueidentifier, GroupID), CONVERT(uniqueidentifier, LastOwnerID), OwnerMask, NextOwnerMask, GroupMask, EveryoneMask, BaseMask, PositionX, PositionY, PositionZ, GroupPositionX, GroupPositionY, GroupPositionZ, VelocityX, VelocityY, VelocityZ, AngularVelocityX, AngularVelocityY, AngularVelocityZ, AccelerationX, AccelerationY, AccelerationZ, RotationX, RotationY, RotationZ, RotationW, SitTargetOffsetX, SitTargetOffsetY, SitTargetOffsetZ, SitTargetOrientW, SitTargetOrientX, SitTargetOrientY, SitTargetOrientZ, PayPrice, PayButton1, PayButton2, PayButton3, PayButton4, CONVERT(uniqueidentifier, LoopedSound), LoopedSoundGain, TextureAnimation, OmegaX, OmegaY, OmegaZ, CameraEyeOffsetX, CameraEyeOffsetY, CameraEyeOffsetZ, CameraAtOffsetX, CameraAtOffsetY, CameraAtOffsetZ, ForceMouselook, ScriptAccessPin, AllowedDrop, DieAtEdge, SalePrice, SaleType, ColorR, ColorG, ColorB, ColorA, ParticleSystem, ClickAction, Material, CONVERT(uniqueidentifier, CollisionSound), CollisionSoundVolume, LinkNumber FROM dbo.prims WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.prims
EXECUTE sp_rename N'dbo.Tmp_prims', N'prims', 'OBJECT'
ALTER TABLE dbo.prims ADD CONSTRAINT
PK__prims__10566F31 PRIMARY KEY CLUSTERED
(
UUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX prims_regionuuid ON dbo.prims
(
RegionUUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX prims_parentid ON dbo.prims
(
ParentID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,49 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_primshapes
(
UUID uniqueidentifier NOT NULL,
Shape int NULL,
ScaleX float(53) NULL,
ScaleY float(53) NULL,
ScaleZ float(53) NULL,
PCode int NULL,
PathBegin int NULL,
PathEnd int NULL,
PathScaleX int NULL,
PathScaleY int NULL,
PathShearX int NULL,
PathShearY int NULL,
PathSkew int NULL,
PathCurve int NULL,
PathRadiusOffset int NULL,
PathRevolutions int NULL,
PathTaperX int NULL,
PathTaperY int NULL,
PathTwist int NULL,
PathTwistBegin int NULL,
ProfileBegin int NULL,
ProfileEnd int NULL,
ProfileCurve int NULL,
ProfileHollow int NULL,
State int NULL,
Texture image NULL,
ExtraParams image NULL
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.primshapes)
EXEC('INSERT INTO dbo.Tmp_primshapes (UUID, Shape, ScaleX, ScaleY, ScaleZ, PCode, PathBegin, PathEnd, PathScaleX, PathScaleY, PathShearX, PathShearY, PathSkew, PathCurve, PathRadiusOffset, PathRevolutions, PathTaperX, PathTaperY, PathTwist, PathTwistBegin, ProfileBegin, ProfileEnd, ProfileCurve, ProfileHollow, State, Texture, ExtraParams)
SELECT CONVERT(uniqueidentifier, UUID), Shape, ScaleX, ScaleY, ScaleZ, PCode, PathBegin, PathEnd, PathScaleX, PathScaleY, PathShearX, PathShearY, PathSkew, PathCurve, PathRadiusOffset, PathRevolutions, PathTaperX, PathTaperY, PathTwist, PathTwistBegin, ProfileBegin, ProfileEnd, ProfileCurve, ProfileHollow, State, Texture, ExtraParams FROM dbo.primshapes WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.primshapes
EXECUTE sp_rename N'dbo.Tmp_primshapes', N'primshapes', 'OBJECT'
ALTER TABLE dbo.primshapes ADD CONSTRAINT
PK__primshapes__0880433F PRIMARY KEY CLUSTERED
(
UUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,45 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_primitems
(
itemID uniqueidentifier NOT NULL,
primID uniqueidentifier NULL,
assetID uniqueidentifier NULL,
parentFolderID uniqueidentifier NULL,
invType int NULL,
assetType int NULL,
name varchar(255) NULL,
description varchar(255) NULL,
creationDate varchar(255) NULL,
creatorID uniqueidentifier NULL,
ownerID uniqueidentifier NULL,
lastOwnerID uniqueidentifier NULL,
groupID uniqueidentifier NULL,
nextPermissions int NULL,
currentPermissions int NULL,
basePermissions int NULL,
everyonePermissions int NULL,
groupPermissions int NULL,
flags int NOT NULL DEFAULT ((0))
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.primitems)
EXEC('INSERT INTO dbo.Tmp_primitems (itemID, primID, assetID, parentFolderID, invType, assetType, name, description, creationDate, creatorID, ownerID, lastOwnerID, groupID, nextPermissions, currentPermissions, basePermissions, everyonePermissions, groupPermissions, flags)
SELECT CONVERT(uniqueidentifier, itemID), CONVERT(uniqueidentifier, primID), CONVERT(uniqueidentifier, assetID), CONVERT(uniqueidentifier, parentFolderID), invType, assetType, name, description, creationDate, CONVERT(uniqueidentifier, creatorID), CONVERT(uniqueidentifier, ownerID), CONVERT(uniqueidentifier, lastOwnerID), CONVERT(uniqueidentifier, groupID), nextPermissions, currentPermissions, basePermissions, everyonePermissions, groupPermissions, flags FROM dbo.primitems WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.primitems
EXECUTE sp_rename N'dbo.Tmp_primitems', N'primitems', 'OBJECT'
ALTER TABLE dbo.primitems ADD CONSTRAINT
PK__primitems__0A688BB1 PRIMARY KEY CLUSTERED
(
itemID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX primitems_primid ON dbo.primitems
(
primID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,19 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_terrain
(
RegionUUID uniqueidentifier NULL,
Revision int NULL,
Heightfield image NULL
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.terrain)
EXEC('INSERT INTO dbo.Tmp_terrain (RegionUUID, Revision, Heightfield)
SELECT CONVERT(uniqueidentifier, RegionUUID), Revision, Heightfield FROM dbo.terrain WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.terrain
EXECUTE sp_rename N'dbo.Tmp_terrain', N'terrain', 'OBJECT'
COMMIT

View File

@ -1,56 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_land
(
UUID uniqueidentifier NOT NULL,
RegionUUID uniqueidentifier NULL,
LocalLandID int NULL,
Bitmap image NULL,
Name varchar(255) NULL,
Description varchar(255) NULL,
OwnerUUID uniqueidentifier NULL,
IsGroupOwned int NULL,
Area int NULL,
AuctionID int NULL,
Category int NULL,
ClaimDate int NULL,
ClaimPrice int NULL,
GroupUUID uniqueidentifier NULL,
SalePrice int NULL,
LandStatus int NULL,
LandFlags int NULL,
LandingType int NULL,
MediaAutoScale int NULL,
MediaTextureUUID uniqueidentifier NULL,
MediaURL varchar(255) NULL,
MusicURL varchar(255) NULL,
PassHours float(53) NULL,
PassPrice int NULL,
SnapshotUUID uniqueidentifier NULL,
UserLocationX float(53) NULL,
UserLocationY float(53) NULL,
UserLocationZ float(53) NULL,
UserLookAtX float(53) NULL,
UserLookAtY float(53) NULL,
UserLookAtZ float(53) NULL,
AuthbuyerID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
OtherCleanTime int NOT NULL DEFAULT ((0)),
Dwell int NOT NULL DEFAULT ((0))
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.land)
EXEC('INSERT INTO dbo.Tmp_land (UUID, RegionUUID, LocalLandID, Bitmap, Name, Description, OwnerUUID, IsGroupOwned, Area, AuctionID, Category, ClaimDate, ClaimPrice, GroupUUID, SalePrice, LandStatus, LandFlags, LandingType, MediaAutoScale, MediaTextureUUID, MediaURL, MusicURL, PassHours, PassPrice, SnapshotUUID, UserLocationX, UserLocationY, UserLocationZ, UserLookAtX, UserLookAtY, UserLookAtZ, AuthbuyerID, OtherCleanTime, Dwell)
SELECT CONVERT(uniqueidentifier, UUID), CONVERT(uniqueidentifier, RegionUUID), LocalLandID, Bitmap, Name, Description, CONVERT(uniqueidentifier, OwnerUUID), IsGroupOwned, Area, AuctionID, Category, ClaimDate, ClaimPrice, CONVERT(uniqueidentifier, GroupUUID), SalePrice, LandStatus, LandFlags, LandingType, MediaAutoScale, CONVERT(uniqueidentifier, MediaTextureUUID), MediaURL, MusicURL, PassHours, PassPrice, CONVERT(uniqueidentifier, SnapshotUUID), UserLocationX, UserLocationY, UserLocationZ, UserLookAtX, UserLookAtY, UserLookAtZ, CONVERT(uniqueidentifier, AuthbuyerID), OtherCleanTime, Dwell FROM dbo.land WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.land
EXECUTE sp_rename N'dbo.Tmp_land', N'land', 'OBJECT'
ALTER TABLE dbo.land ADD CONSTRAINT
PK__land__65A475E71BFD2C07 PRIMARY KEY CLUSTERED
(
UUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,18 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_landaccesslist
(
LandUUID uniqueidentifier NULL,
AccessUUID uniqueidentifier NULL,
Flags int NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.landaccesslist)
EXEC('INSERT INTO dbo.Tmp_landaccesslist (LandUUID, AccessUUID, Flags)
SELECT CONVERT(uniqueidentifier, LandUUID), CONVERT(uniqueidentifier, AccessUUID), Flags FROM dbo.landaccesslist WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.landaccesslist
EXECUTE sp_rename N'dbo.Tmp_landaccesslist', N'landaccesslist', 'OBJECT'
COMMIT

View File

@ -1,19 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_regionban
(
regionUUID uniqueidentifier NOT NULL,
bannedUUID uniqueidentifier NOT NULL,
bannedIp varchar(16) NOT NULL,
bannedIpHostMask varchar(16) NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.regionban)
EXEC('INSERT INTO dbo.Tmp_regionban (regionUUID, bannedUUID, bannedIp, bannedIpHostMask)
SELECT CONVERT(uniqueidentifier, regionUUID), CONVERT(uniqueidentifier, bannedUUID), bannedIp, bannedIpHostMask FROM dbo.regionban WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.regionban
EXECUTE sp_rename N'dbo.Tmp_regionban', N'regionban', 'OBJECT'
COMMIT

View File

@ -1,58 +0,0 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_regionsettings
(
regionUUID uniqueidentifier NOT NULL,
block_terraform bit NOT NULL,
block_fly bit NOT NULL,
allow_damage bit NOT NULL,
restrict_pushing bit NOT NULL,
allow_land_resell bit NOT NULL,
allow_land_join_divide bit NOT NULL,
block_show_in_search bit NOT NULL,
agent_limit int NOT NULL,
object_bonus float(53) NOT NULL,
maturity int NOT NULL,
disable_scripts bit NOT NULL,
disable_collisions bit NOT NULL,
disable_physics bit NOT NULL,
terrain_texture_1 uniqueidentifier NOT NULL,
terrain_texture_2 uniqueidentifier NOT NULL,
terrain_texture_3 uniqueidentifier NOT NULL,
terrain_texture_4 uniqueidentifier NOT NULL,
elevation_1_nw float(53) NOT NULL,
elevation_2_nw float(53) NOT NULL,
elevation_1_ne float(53) NOT NULL,
elevation_2_ne float(53) NOT NULL,
elevation_1_se float(53) NOT NULL,
elevation_2_se float(53) NOT NULL,
elevation_1_sw float(53) NOT NULL,
elevation_2_sw float(53) NOT NULL,
water_height float(53) NOT NULL,
terrain_raise_limit float(53) NOT NULL,
terrain_lower_limit float(53) NOT NULL,
use_estate_sun bit NOT NULL,
fixed_sun bit NOT NULL,
sun_position float(53) NOT NULL,
covenant uniqueidentifier NULL DEFAULT (NULL),
Sandbox bit NOT NULL,
sunvectorx float(53) NOT NULL DEFAULT ((0)),
sunvectory float(53) NOT NULL DEFAULT ((0)),
sunvectorz float(53) NOT NULL DEFAULT ((0))
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.regionsettings)
EXEC('INSERT INTO dbo.Tmp_regionsettings (regionUUID, block_terraform, block_fly, allow_damage, restrict_pushing, allow_land_resell, allow_land_join_divide, block_show_in_search, agent_limit, object_bonus, maturity, disable_scripts, disable_collisions, disable_physics, terrain_texture_1, terrain_texture_2, terrain_texture_3, terrain_texture_4, elevation_1_nw, elevation_2_nw, elevation_1_ne, elevation_2_ne, elevation_1_se, elevation_2_se, elevation_1_sw, elevation_2_sw, water_height, terrain_raise_limit, terrain_lower_limit, use_estate_sun, fixed_sun, sun_position, covenant, Sandbox, sunvectorx, sunvectory, sunvectorz)
SELECT CONVERT(uniqueidentifier, regionUUID), block_terraform, block_fly, allow_damage, restrict_pushing, allow_land_resell, allow_land_join_divide, block_show_in_search, agent_limit, object_bonus, maturity, disable_scripts, disable_collisions, disable_physics, CONVERT(uniqueidentifier, terrain_texture_1), CONVERT(uniqueidentifier, terrain_texture_2), CONVERT(uniqueidentifier, terrain_texture_3), CONVERT(uniqueidentifier, terrain_texture_4), elevation_1_nw, elevation_2_nw, elevation_1_ne, elevation_2_ne, elevation_1_se, elevation_2_se, elevation_1_sw, elevation_2_sw, water_height, terrain_raise_limit, terrain_lower_limit, use_estate_sun, fixed_sun, sun_position, CONVERT(uniqueidentifier, covenant), Sandbox, sunvectorx, sunvectory, sunvectorz FROM dbo.regionsettings WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.regionsettings
EXECUTE sp_rename N'dbo.Tmp_regionsettings', N'regionsettings', 'OBJECT'
ALTER TABLE dbo.regionsettings ADD CONSTRAINT
PK__regionse__5B35159D21B6055D PRIMARY KEY CLUSTERED
(
regionUUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,5 +0,0 @@
BEGIN TRANSACTION
ALTER TABLE prims ADD PassTouches bit not null default 0
COMMIT

View File

@ -1,7 +0,0 @@
BEGIN TRANSACTION
ALTER TABLE regionsettings ADD loaded_creation_date varchar(20)
ALTER TABLE regionsettings ADD loaded_creation_time varchar(20)
ALTER TABLE regionsettings ADD loaded_creation_id varchar(64)
COMMIT

View File

@ -1,7 +0,0 @@
BEGIN TRANSACTION
ALTER TABLE regionsettings DROP COLUMN loaded_creation_date
ALTER TABLE regionsettings DROP COLUMN loaded_creation_time
ALTER TABLE regionsettings ADD loaded_creation_datetime int NOT NULL default 0
COMMIT

View File

@ -0,0 +1,100 @@
:VERSION 1
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]
:VERSION 2
BEGIN TRANSACTION
CREATE TABLE Tmp_assets
(
id varchar(36) NOT NULL,
name varchar(64) NOT NULL,
description varchar(64) NOT NULL,
assetType tinyint NOT NULL,
local bit NOT NULL,
temporary bit NOT NULL,
data image NOT NULL
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
IF EXISTS(SELECT * FROM assets)
EXEC('INSERT INTO Tmp_assets (id, name, description, assetType, local, temporary, data)
SELECT id, name, description, assetType, CONVERT(bit, local), CONVERT(bit, temporary), data FROM assets WITH (HOLDLOCK TABLOCKX)')
DROP TABLE assets
EXECUTE sp_rename N'Tmp_assets', N'assets', 'OBJECT'
ALTER TABLE dbo.assets ADD CONSTRAINT
PK__assets__id PRIMARY KEY CLUSTERED
(
id
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 3
BEGIN TRANSACTION
ALTER TABLE assets add create_time integer default 0
ALTER TABLE assets add access_time integer default 0
COMMIT
:VERSION 4
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_assets
(
id uniqueidentifier NOT NULL,
name varchar(64) NOT NULL,
description varchar(64) NOT NULL,
assetType tinyint NOT NULL,
local bit NOT NULL,
temporary bit NOT NULL,
data image NOT NULL,
create_time int NULL,
access_time int NULL
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.assets)
EXEC('INSERT INTO dbo.Tmp_assets (id, name, description, assetType, local, temporary, data, create_time, access_time)
SELECT CONVERT(uniqueidentifier, id), name, description, assetType, local, temporary, data, create_time, access_time FROM dbo.assets WITH (HOLDLOCK TABLOCKX)')
DROP TABLE assets
EXECUTE sp_rename N'Tmp_assets', N'assets', 'OBJECT'
ALTER TABLE dbo.assets ADD CONSTRAINT
PK__assets__id PRIMARY KEY CLUSTERED
(
id
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 5
DELETE FROM assets WHERE id = 'dc4b9f0b-d008-45c6-96a4-01dd947ac621';

View File

@ -1,3 +1,5 @@
:VERSION 1
BEGIN TRANSACTION
CREATE TABLE [auth] (
@ -14,4 +16,13 @@ CREATE TABLE [tokens] (
[validity] [datetime] NOT NULL )
ON [PRIMARY]
COMMIT
:VERSION 2
BEGIN TRANSACTION
INSERT INTO auth (UUID, passwordHash, passwordSalt, webLoginKey, accountType) SELECT [UUID] AS UUID, [passwordHash] AS passwordHash, [passwordSalt] AS passwordSalt, [webLoginKey] AS webLoginKey, 'UserAccount' as [accountType] FROM users;
COMMIT

View File

@ -1,3 +1,5 @@
:VERSION 1
BEGIN TRANSACTION
CREATE TABLE [Avatars] (

View File

@ -0,0 +1,334 @@
:VERSION 1
BEGIN TRANSACTION
CREATE TABLE [dbo].[estate_managers](
[EstateID] [int] NOT NULL,
[uuid] [varchar](36) NOT NULL,
CONSTRAINT [PK_estate_managers] PRIMARY KEY CLUSTERED
(
[EstateID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY];
CREATE TABLE [dbo].[estate_groups](
[EstateID] [int] NOT NULL,
[uuid] [varchar](36) NOT NULL,
CONSTRAINT [PK_estate_groups] PRIMARY KEY CLUSTERED
(
[EstateID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY];
CREATE TABLE [dbo].[estate_users](
[EstateID] [int] NOT NULL,
[uuid] [varchar](36) NOT NULL,
CONSTRAINT [PK_estate_users] PRIMARY KEY CLUSTERED
(
[EstateID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY];
CREATE TABLE [dbo].[estateban](
[EstateID] [int] NOT NULL,
[bannedUUID] [varchar](36) NOT NULL,
[bannedIp] [varchar](16) NOT NULL,
[bannedIpHostMask] [varchar](16) NOT NULL,
[bannedNameMask] [varchar](64) NULL DEFAULT (NULL),
CONSTRAINT [PK_estateban] PRIMARY KEY CLUSTERED
(
[EstateID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY];
CREATE TABLE [dbo].[estate_settings](
[EstateID] [int] IDENTITY(1,100) NOT NULL,
[EstateName] [varchar](64) NULL DEFAULT (NULL),
[AbuseEmailToEstateOwner] [bit] NOT NULL,
[DenyAnonymous] [bit] NOT NULL,
[ResetHomeOnTeleport] [bit] NOT NULL,
[FixedSun] [bit] NOT NULL,
[DenyTransacted] [bit] NOT NULL,
[BlockDwell] [bit] NOT NULL,
[DenyIdentified] [bit] NOT NULL,
[AllowVoice] [bit] NOT NULL,
[UseGlobalTime] [bit] NOT NULL,
[PricePerMeter] [int] NOT NULL,
[TaxFree] [bit] NOT NULL,
[AllowDirectTeleport] [bit] NOT NULL,
[RedirectGridX] [int] NOT NULL,
[RedirectGridY] [int] NOT NULL,
[ParentEstateID] [int] NOT NULL,
[SunPosition] [float] NOT NULL,
[EstateSkipScripts] [bit] NOT NULL,
[BillableFactor] [float] NOT NULL,
[PublicAccess] [bit] NOT NULL,
[AbuseEmail] [varchar](255) NOT NULL,
[EstateOwner] [varchar](36) NOT NULL,
[DenyMinors] [bit] NOT NULL,
CONSTRAINT [PK_estate_settings] PRIMARY KEY CLUSTERED
(
[EstateID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY];
CREATE TABLE [dbo].[estate_map](
[RegionID] [varchar](36) NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
[EstateID] [int] NOT NULL,
CONSTRAINT [PK_estate_map] PRIMARY KEY CLUSTERED
(
[RegionID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY];
COMMIT
:VERSION 2
BEGIN TRANSACTION
ALTER TABLE dbo.estate_managers DROP CONSTRAINT PK_estate_managers
CREATE NONCLUSTERED INDEX IX_estate_managers ON dbo.estate_managers
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
ALTER TABLE dbo.estate_groups DROP CONSTRAINT PK_estate_groups
CREATE NONCLUSTERED INDEX IX_estate_groups ON dbo.estate_groups
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
ALTER TABLE dbo.estate_users DROP CONSTRAINT PK_estate_users
CREATE NONCLUSTERED INDEX IX_estate_users ON dbo.estate_users
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 3
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_estateban
(
EstateID int NOT NULL,
bannedUUID varchar(36) NOT NULL,
bannedIp varchar(16) NULL,
bannedIpHostMask varchar(16) NULL,
bannedNameMask varchar(64) NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.estateban)
EXEC('INSERT INTO dbo.Tmp_estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask)
SELECT EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask FROM dbo.estateban')
DROP TABLE dbo.estateban
EXECUTE sp_rename N'dbo.Tmp_estateban', N'estateban', 'OBJECT'
CREATE NONCLUSTERED INDEX IX_estateban ON dbo.estateban
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 4
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_estate_managers
(
EstateID int NOT NULL,
uuid uniqueidentifier NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.estate_managers)
EXEC('INSERT INTO dbo.Tmp_estate_managers (EstateID, uuid)
SELECT EstateID, CONVERT(uniqueidentifier, uuid) FROM dbo.estate_managers WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.estate_managers
EXECUTE sp_rename N'dbo.Tmp_estate_managers', N'estate_managers', 'OBJECT'
CREATE NONCLUSTERED INDEX IX_estate_managers ON dbo.estate_managers
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 5
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_estate_groups
(
EstateID int NOT NULL,
uuid uniqueidentifier NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.estate_groups)
EXEC('INSERT INTO dbo.Tmp_estate_groups (EstateID, uuid)
SELECT EstateID, CONVERT(uniqueidentifier, uuid) FROM dbo.estate_groups WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.estate_groups
EXECUTE sp_rename N'dbo.Tmp_estate_groups', N'estate_groups', 'OBJECT'
CREATE NONCLUSTERED INDEX IX_estate_groups ON dbo.estate_groups
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 6
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_estate_users
(
EstateID int NOT NULL,
uuid uniqueidentifier NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.estate_users)
EXEC('INSERT INTO dbo.Tmp_estate_users (EstateID, uuid)
SELECT EstateID, CONVERT(uniqueidentifier, uuid) FROM dbo.estate_users WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.estate_users
EXECUTE sp_rename N'dbo.Tmp_estate_users', N'estate_users', 'OBJECT'
CREATE NONCLUSTERED INDEX IX_estate_users ON dbo.estate_users
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 7
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_estateban
(
EstateID int NOT NULL,
bannedUUID uniqueidentifier NOT NULL,
bannedIp varchar(16) NULL,
bannedIpHostMask varchar(16) NULL,
bannedNameMask varchar(64) NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.estateban)
EXEC('INSERT INTO dbo.Tmp_estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask)
SELECT EstateID, CONVERT(uniqueidentifier, bannedUUID), bannedIp, bannedIpHostMask, bannedNameMask FROM dbo.estateban WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.estateban
EXECUTE sp_rename N'dbo.Tmp_estateban', N'estateban', 'OBJECT'
CREATE NONCLUSTERED INDEX IX_estateban ON dbo.estateban
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 8
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_estate_settings
(
EstateID int NOT NULL IDENTITY (1, 100),
EstateName varchar(64) NULL DEFAULT (NULL),
AbuseEmailToEstateOwner bit NOT NULL,
DenyAnonymous bit NOT NULL,
ResetHomeOnTeleport bit NOT NULL,
FixedSun bit NOT NULL,
DenyTransacted bit NOT NULL,
BlockDwell bit NOT NULL,
DenyIdentified bit NOT NULL,
AllowVoice bit NOT NULL,
UseGlobalTime bit NOT NULL,
PricePerMeter int NOT NULL,
TaxFree bit NOT NULL,
AllowDirectTeleport bit NOT NULL,
RedirectGridX int NOT NULL,
RedirectGridY int NOT NULL,
ParentEstateID int NOT NULL,
SunPosition float(53) NOT NULL,
EstateSkipScripts bit NOT NULL,
BillableFactor float(53) NOT NULL,
PublicAccess bit NOT NULL,
AbuseEmail varchar(255) NOT NULL,
EstateOwner uniqueidentifier NOT NULL,
DenyMinors bit NOT NULL
) ON [PRIMARY]
SET IDENTITY_INSERT dbo.Tmp_estate_settings ON
IF EXISTS(SELECT * FROM dbo.estate_settings)
EXEC('INSERT INTO dbo.Tmp_estate_settings (EstateID, EstateName, AbuseEmailToEstateOwner, DenyAnonymous, ResetHomeOnTeleport, FixedSun, DenyTransacted, BlockDwell, DenyIdentified, AllowVoice, UseGlobalTime, PricePerMeter, TaxFree, AllowDirectTeleport, RedirectGridX, RedirectGridY, ParentEstateID, SunPosition, EstateSkipScripts, BillableFactor, PublicAccess, AbuseEmail, EstateOwner, DenyMinors)
SELECT EstateID, EstateName, AbuseEmailToEstateOwner, DenyAnonymous, ResetHomeOnTeleport, FixedSun, DenyTransacted, BlockDwell, DenyIdentified, AllowVoice, UseGlobalTime, PricePerMeter, TaxFree, AllowDirectTeleport, RedirectGridX, RedirectGridY, ParentEstateID, SunPosition, EstateSkipScripts, BillableFactor, PublicAccess, AbuseEmail, CONVERT(uniqueidentifier, EstateOwner), DenyMinors FROM dbo.estate_settings WITH (HOLDLOCK TABLOCKX)')
SET IDENTITY_INSERT dbo.Tmp_estate_settings OFF
DROP TABLE dbo.estate_settings
EXECUTE sp_rename N'dbo.Tmp_estate_settings', N'estate_settings', 'OBJECT'
ALTER TABLE dbo.estate_settings ADD CONSTRAINT
PK_estate_settings PRIMARY KEY CLUSTERED
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 9
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_estate_map
(
RegionID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
EstateID int NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.estate_map)
EXEC('INSERT INTO dbo.Tmp_estate_map (RegionID, EstateID)
SELECT CONVERT(uniqueidentifier, RegionID), EstateID FROM dbo.estate_map WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.estate_map
EXECUTE sp_rename N'dbo.Tmp_estate_map', N'estate_map', 'OBJECT'
ALTER TABLE dbo.estate_map ADD CONSTRAINT
PK_estate_map PRIMARY KEY CLUSTERED
(
RegionID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,3 +1,5 @@
:VERSION 1
BEGIN TRANSACTION
CREATE TABLE [Friends] (
@ -7,5 +9,12 @@ CREATE TABLE [Friends] (
[Offered] varchar(32) NOT NULL DEFAULT 0)
ON [PRIMARY]
COMMIT
:VERSION 2
BEGIN TRANSACTION
INSERT INTO Friends (PrincipalID, Friend, Flags, Offered) SELECT [ownerID], [friendID], [friendPerms], 0 FROM userfriends;
COMMIT

View File

@ -0,0 +1,225 @@
:VERSION 1
BEGIN TRANSACTION
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]
COMMIT
:VERSION 2
BEGIN TRANSACTION
CREATE TABLE Tmp_regions
(
uuid varchar(36) COLLATE Latin1_General_CI_AS NOT NULL,
regionHandle bigint NULL,
regionName varchar(20) NULL,
regionRecvKey varchar(128) NULL,
regionSendKey varchar(128) NULL,
regionSecret varchar(128) NULL,
regionDataURI varchar(128) NULL,
serverIP varchar(64) NULL,
serverPort int NULL,
serverURI varchar(255) NULL,
locX int NULL,
locY int NULL,
locZ int NULL,
eastOverrideHandle bigint NULL,
westOverrideHandle bigint NULL,
southOverrideHandle bigint NULL,
northOverrideHandle bigint NULL,
regionAssetURI varchar(255) NULL,
regionAssetRecvKey varchar(128) NULL,
regionAssetSendKey varchar(128) NULL,
regionUserURI varchar(255) NULL,
regionUserRecvKey varchar(128) NULL,
regionUserSendKey varchar(128) NULL,
regionMapTexture varchar(36) NULL,
serverHttpPort int NULL,
serverRemotingPort int NULL,
owner_uuid varchar(36) NULL,
originUUID varchar(36) NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000')
) ON [PRIMARY]
IF EXISTS(SELECT * FROM regions)
EXEC('INSERT INTO Tmp_regions (uuid, regionHandle, regionName, regionRecvKey, regionSendKey, regionSecret, regionDataURI, serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, regionMapTexture, serverHttpPort, serverRemotingPort, owner_uuid)
SELECT CONVERT(varchar(36), uuid), CONVERT(bigint, regionHandle), CONVERT(varchar(20), regionName), CONVERT(varchar(128), regionRecvKey), CONVERT(varchar(128), regionSendKey), CONVERT(varchar(128), regionSecret), CONVERT(varchar(128), regionDataURI), CONVERT(varchar(64), serverIP), CONVERT(int, serverPort), serverURI, CONVERT(int, locX), CONVERT(int, locY), CONVERT(int, locZ), CONVERT(bigint, eastOverrideHandle), CONVERT(bigint, westOverrideHandle), CONVERT(bigint, southOverrideHandle), CONVERT(bigint, northOverrideHandle), regionAssetURI, CONVERT(varchar(128), regionAssetRecvKey), CONVERT(varchar(128), regionAssetSendKey), regionUserURI, CONVERT(varchar(128), regionUserRecvKey), CONVERT(varchar(128), regionUserSendKey), CONVERT(varchar(36), regionMapTexture), CONVERT(int, serverHttpPort), CONVERT(int, serverRemotingPort), owner_uuid FROM regions')
DROP TABLE regions
EXECUTE sp_rename N'Tmp_regions', N'regions', 'OBJECT'
ALTER TABLE regions ADD CONSTRAINT
PK__regions__uuid PRIMARY KEY CLUSTERED
(
uuid
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 3
BEGIN TRANSACTION
CREATE NONCLUSTERED INDEX IX_regions_name ON dbo.regions
(
regionName
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX IX_regions_handle ON dbo.regions
(
regionHandle
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX IX_regions_override ON dbo.regions
(
eastOverrideHandle,
westOverrideHandle,
southOverrideHandle,
northOverrideHandle
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 4
/* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_regions
(
uuid uniqueidentifier NOT NULL,
regionHandle bigint NULL,
regionName varchar(20) NULL,
regionRecvKey varchar(128) NULL,
regionSendKey varchar(128) NULL,
regionSecret varchar(128) NULL,
regionDataURI varchar(128) NULL,
serverIP varchar(64) NULL,
serverPort int NULL,
serverURI varchar(255) NULL,
locX int NULL,
locY int NULL,
locZ int NULL,
eastOverrideHandle bigint NULL,
westOverrideHandle bigint NULL,
southOverrideHandle bigint NULL,
northOverrideHandle bigint NULL,
regionAssetURI varchar(255) NULL,
regionAssetRecvKey varchar(128) NULL,
regionAssetSendKey varchar(128) NULL,
regionUserURI varchar(255) NULL,
regionUserRecvKey varchar(128) NULL,
regionUserSendKey varchar(128) NULL,
regionMapTexture uniqueidentifier NULL,
serverHttpPort int NULL,
serverRemotingPort int NULL,
owner_uuid uniqueidentifier NOT NULL,
originUUID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000')
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.regions)
EXEC('INSERT INTO dbo.Tmp_regions (uuid, regionHandle, regionName, regionRecvKey, regionSendKey, regionSecret, regionDataURI, serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, regionMapTexture, serverHttpPort, serverRemotingPort, owner_uuid, originUUID)
SELECT CONVERT(uniqueidentifier, uuid), regionHandle, regionName, regionRecvKey, regionSendKey, regionSecret, regionDataURI, serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, CONVERT(uniqueidentifier, regionMapTexture), serverHttpPort, serverRemotingPort, CONVERT(uniqueidentifier, owner_uuid), CONVERT(uniqueidentifier, originUUID) FROM dbo.regions WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.regions
EXECUTE sp_rename N'dbo.Tmp_regions', N'regions', 'OBJECT'
ALTER TABLE dbo.regions ADD CONSTRAINT
PK__regions__uuid PRIMARY KEY CLUSTERED
(
uuid
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX IX_regions_name ON dbo.regions
(
regionName
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX IX_regions_handle ON dbo.regions
(
regionHandle
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX IX_regions_override ON dbo.regions
(
eastOverrideHandle,
westOverrideHandle,
southOverrideHandle,
northOverrideHandle
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 5
BEGIN TRANSACTION
ALTER TABLE regions ADD access int default 0;
COMMIT
:VERSION 6
BEGIN TRANSACTION
ALTER TABLE regions ADD scopeid uniqueidentifier default '00000000-0000-0000-0000-000000000000';
ALTER TABLE regions ADD DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [owner_uuid];
ALTER TABLE regions ADD sizeX integer not null default 0;
ALTER TABLE regions ADD sizeY integer not null default 0;
COMMIT
:VERSION 7
BEGIN TRANSACTION
ALTER TABLE regions ADD [flags] integer NOT NULL DEFAULT 0;
CREATE INDEX [flags] ON regions(flags);
ALTER TABLE [regions] ADD [last_seen] integer NOT NULL DEFAULT 0;
ALTER TABLE [regions] ADD [PrincipalID] uniqueidentifier NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
ALTER TABLE [regions] ADD [Token] varchar(255) NOT NULL DEFAULT 0;
COMMIT

View File

@ -0,0 +1,174 @@
:VERSION 1
BEGIN TRANSACTION
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]
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]
COMMIT
:VERSION 2
BEGIN TRANSACTION
ALTER TABLE inventoryitems ADD inventoryGroupPermissions INTEGER NOT NULL default 0
COMMIT
:VERSION 3
/* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_inventoryfolders
(
folderID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
agentID uniqueidentifier NULL DEFAULT (NULL),
parentFolderID uniqueidentifier NULL DEFAULT (NULL),
folderName varchar(64) NULL DEFAULT (NULL),
type smallint NOT NULL DEFAULT ((0)),
version int NOT NULL DEFAULT ((0))
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.inventoryfolders)
EXEC('INSERT INTO dbo.Tmp_inventoryfolders (folderID, agentID, parentFolderID, folderName, type, version)
SELECT CONVERT(uniqueidentifier, folderID), CONVERT(uniqueidentifier, agentID), CONVERT(uniqueidentifier, parentFolderID), folderName, type, version FROM dbo.inventoryfolders WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.inventoryfolders
EXECUTE sp_rename N'dbo.Tmp_inventoryfolders', N'inventoryfolders', 'OBJECT'
ALTER TABLE dbo.inventoryfolders ADD CONSTRAINT
PK__inventor__C2FABFB3173876EA PRIMARY KEY CLUSTERED
(
folderID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX owner ON dbo.inventoryfolders
(
agentID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX parent ON dbo.inventoryfolders
(
parentFolderID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 4
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_inventoryitems
(
inventoryID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
assetID uniqueidentifier NULL DEFAULT (NULL),
assetType int NULL DEFAULT (NULL),
parentFolderID uniqueidentifier NULL DEFAULT (NULL),
avatarID uniqueidentifier NULL DEFAULT (NULL),
inventoryName varchar(64) NULL DEFAULT (NULL),
inventoryDescription varchar(128) NULL DEFAULT (NULL),
inventoryNextPermissions int NULL DEFAULT (NULL),
inventoryCurrentPermissions int NULL DEFAULT (NULL),
invType int NULL DEFAULT (NULL),
creatorID uniqueidentifier NULL DEFAULT (NULL),
inventoryBasePermissions int NOT NULL DEFAULT ((0)),
inventoryEveryOnePermissions int NOT NULL DEFAULT ((0)),
salePrice int NULL DEFAULT (NULL),
saleType tinyint NULL DEFAULT (NULL),
creationDate int NULL DEFAULT (NULL),
groupID uniqueidentifier NULL DEFAULT (NULL),
groupOwned bit NULL DEFAULT (NULL),
flags int NULL DEFAULT (NULL),
inventoryGroupPermissions int NOT NULL DEFAULT ((0))
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.inventoryitems)
EXEC('INSERT INTO dbo.Tmp_inventoryitems (inventoryID, assetID, assetType, parentFolderID, avatarID, inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType, creatorID, inventoryBasePermissions, inventoryEveryOnePermissions, salePrice, saleType, creationDate, groupID, groupOwned, flags, inventoryGroupPermissions)
SELECT CONVERT(uniqueidentifier, inventoryID), CONVERT(uniqueidentifier, assetID), assetType, CONVERT(uniqueidentifier, parentFolderID), CONVERT(uniqueidentifier, avatarID), inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType, CONVERT(uniqueidentifier, creatorID), inventoryBasePermissions, inventoryEveryOnePermissions, salePrice, saleType, creationDate, CONVERT(uniqueidentifier, groupID), groupOwned, flags, inventoryGroupPermissions FROM dbo.inventoryitems WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.inventoryitems
EXECUTE sp_rename N'dbo.Tmp_inventoryitems', N'inventoryitems', 'OBJECT'
ALTER TABLE dbo.inventoryitems ADD CONSTRAINT
PK__inventor__C4B7BC2220C1E124 PRIMARY KEY CLUSTERED
(
inventoryID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX owner ON dbo.inventoryitems
(
avatarID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX folder ON dbo.inventoryitems
(
parentFolderID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT

View File

@ -1,3 +1,5 @@
:VERSION 1
BEGIN TRANSACTION
CREATE TABLE [logs] (

View File

@ -1,3 +1,5 @@
:VERSION 1
BEGIN TRANSACTION
CREATE TABLE [Presence] (
@ -16,4 +18,13 @@ CREATE TABLE [Presence] (
)
ON [PRIMARY]
COMMIT
:VERSION 2
BEGIN TRANSACTION
CREATE UNIQUE INDEX SessionID ON Presence(SessionID);
CREATE INDEX UserID ON Presence(UserID);
COMMIT

View File

@ -0,0 +1,929 @@

:VERSION 1
CREATE TABLE [dbo].[prims](
[UUID] [varchar](255) NOT NULL,
[RegionUUID] [varchar](255) NULL,
[ParentID] [int] NULL,
[CreationDate] [int] NULL,
[Name] [varchar](255) NULL,
[SceneGroupID] [varchar](255) NULL,
[Text] [varchar](255) NULL,
[Description] [varchar](255) NULL,
[SitName] [varchar](255) NULL,
[TouchName] [varchar](255) NULL,
[ObjectFlags] [int] NULL,
[CreatorID] [varchar](255) NULL,
[OwnerID] [varchar](255) NULL,
[GroupID] [varchar](255) NULL,
[LastOwnerID] [varchar](255) NULL,
[OwnerMask] [int] NULL,
[NextOwnerMask] [int] NULL,
[GroupMask] [int] NULL,
[EveryoneMask] [int] NULL,
[BaseMask] [int] NULL,
[PositionX] [float] NULL,
[PositionY] [float] NULL,
[PositionZ] [float] NULL,
[GroupPositionX] [float] NULL,
[GroupPositionY] [float] NULL,
[GroupPositionZ] [float] NULL,
[VelocityX] [float] NULL,
[VelocityY] [float] NULL,
[VelocityZ] [float] NULL,
[AngularVelocityX] [float] NULL,
[AngularVelocityY] [float] NULL,
[AngularVelocityZ] [float] NULL,
[AccelerationX] [float] NULL,
[AccelerationY] [float] NULL,
[AccelerationZ] [float] NULL,
[RotationX] [float] NULL,
[RotationY] [float] NULL,
[RotationZ] [float] NULL,
[RotationW] [float] NULL,
[SitTargetOffsetX] [float] NULL,
[SitTargetOffsetY] [float] NULL,
[SitTargetOffsetZ] [float] NULL,
[SitTargetOrientW] [float] NULL,
[SitTargetOrientX] [float] NULL,
[SitTargetOrientY] [float] NULL,
[SitTargetOrientZ] [float] NULL,
PRIMARY KEY CLUSTERED
(
[UUID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
CREATE TABLE [dbo].[primshapes](
[UUID] [varchar](255) NOT NULL,
[Shape] [int] NULL,
[ScaleX] [float] NULL,
[ScaleY] [float] NULL,
[ScaleZ] [float] NULL,
[PCode] [int] NULL,
[PathBegin] [int] NULL,
[PathEnd] [int] NULL,
[PathScaleX] [int] NULL,
[PathScaleY] [int] NULL,
[PathShearX] [int] NULL,
[PathShearY] [int] NULL,
[PathSkew] [int] NULL,
[PathCurve] [int] NULL,
[PathRadiusOffset] [int] NULL,
[PathRevolutions] [int] NULL,
[PathTaperX] [int] NULL,
[PathTaperY] [int] NULL,
[PathTwist] [int] NULL,
[PathTwistBegin] [int] NULL,
[ProfileBegin] [int] NULL,
[ProfileEnd] [int] NULL,
[ProfileCurve] [int] NULL,
[ProfileHollow] [int] NULL,
[State] [int] NULL,
[Texture] [image] NULL,
[ExtraParams] [image] NULL,
PRIMARY KEY CLUSTERED
(
[UUID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
CREATE TABLE [dbo].[primitems](
[itemID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[primID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[assetID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[parentFolderID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[invType] [int] NULL,
[assetType] [int] NULL,
[name] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[description] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[creationDate] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[creatorID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ownerID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[lastOwnerID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[groupID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[nextPermissions] [int] NULL,
[currentPermissions] [int] NULL,
[basePermissions] [int] NULL,
[everyonePermissions] [int] NULL,
[groupPermissions] [int] NULL,
PRIMARY KEY CLUSTERED
(
[itemID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
CREATE TABLE [dbo].[terrain](
[RegionUUID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Revision] [int] NULL,
[Heightfield] [image] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
CREATE TABLE [dbo].[land](
[UUID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[RegionUUID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LocalLandID] [int] NULL,
[Bitmap] [image] NULL,
[Name] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Description] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[OwnerUUID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[IsGroupOwned] [int] NULL,
[Area] [int] NULL,
[AuctionID] [int] NULL,
[Category] [int] NULL,
[ClaimDate] [int] NULL,
[ClaimPrice] [int] NULL,
[GroupUUID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SalePrice] [int] NULL,
[LandStatus] [int] NULL,
[LandFlags] [int] NULL,
[LandingType] [int] NULL,
[MediaAutoScale] [int] NULL,
[MediaTextureUUID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[MediaURL] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[MusicURL] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PassHours] [float] NULL,
[PassPrice] [int] NULL,
[SnapshotUUID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[UserLocationX] [float] NULL,
[UserLocationY] [float] NULL,
[UserLocationZ] [float] NULL,
[UserLookAtX] [float] NULL,
[UserLookAtY] [float] NULL,
[UserLookAtZ] [float] NULL,
PRIMARY KEY CLUSTERED
(
[UUID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
CREATE TABLE [dbo].[landaccesslist](
[LandUUID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[AccessUUID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Flags] [int] NULL
) ON [PRIMARY]
:VERSION 2
BEGIN TRANSACTION
CREATE TABLE regionban (
[regionUUID] VARCHAR(36) NOT NULL,
[bannedUUID] VARCHAR(36) NOT NULL,
[bannedIp] VARCHAR(16) NOT NULL,
[bannedIpHostMask] VARCHAR(16) NOT NULL)
create table [dbo].[regionsettings] (
[regionUUID] [varchar](36) not null,
[block_terraform] [bit] not null,
[block_fly] [bit] not null,
[allow_damage] [bit] not null,
[restrict_pushing] [bit] not null,
[allow_land_resell] [bit] not null,
[allow_land_join_divide] [bit] not null,
[block_show_in_search] [bit] not null,
[agent_limit] [int] not null,
[object_bonus] [float] not null,
[maturity] [int] not null,
[disable_scripts] [bit] not null,
[disable_collisions] [bit] not null,
[disable_physics] [bit] not null,
[terrain_texture_1] [varchar](36) not null,
[terrain_texture_2] [varchar](36) not null,
[terrain_texture_3] [varchar](36) not null,
[terrain_texture_4] [varchar](36) not null,
[elevation_1_nw] [float] not null,
[elevation_2_nw] [float] not null,
[elevation_1_ne] [float] not null,
[elevation_2_ne] [float] not null,
[elevation_1_se] [float] not null,
[elevation_2_se] [float] not null,
[elevation_1_sw] [float] not null,
[elevation_2_sw] [float] not null,
[water_height] [float] not null,
[terrain_raise_limit] [float] not null,
[terrain_lower_limit] [float] not null,
[use_estate_sun] [bit] not null,
[fixed_sun] [bit] not null,
[sun_position] [float] not null,
[covenant] [varchar](36) default NULL,
[Sandbox] [bit] NOT NULL,
PRIMARY KEY CLUSTERED
(
[regionUUID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
COMMIT
:VERSION 3
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_prims
(
UUID varchar(36) NOT NULL,
RegionUUID varchar(36) NULL,
ParentID int NULL,
CreationDate int NULL,
Name varchar(255) NULL,
SceneGroupID varchar(36) NULL,
Text varchar(255) NULL,
Description varchar(255) NULL,
SitName varchar(255) NULL,
TouchName varchar(255) NULL,
ObjectFlags int NULL,
CreatorID varchar(36) NULL,
OwnerID varchar(36) NULL,
GroupID varchar(36) NULL,
LastOwnerID varchar(36) NULL,
OwnerMask int NULL,
NextOwnerMask int NULL,
GroupMask int NULL,
EveryoneMask int NULL,
BaseMask int NULL,
PositionX float(53) NULL,
PositionY float(53) NULL,
PositionZ float(53) NULL,
GroupPositionX float(53) NULL,
GroupPositionY float(53) NULL,
GroupPositionZ float(53) NULL,
VelocityX float(53) NULL,
VelocityY float(53) NULL,
VelocityZ float(53) NULL,
AngularVelocityX float(53) NULL,
AngularVelocityY float(53) NULL,
AngularVelocityZ float(53) NULL,
AccelerationX float(53) NULL,
AccelerationY float(53) NULL,
AccelerationZ float(53) NULL,
RotationX float(53) NULL,
RotationY float(53) NULL,
RotationZ float(53) NULL,
RotationW float(53) NULL,
SitTargetOffsetX float(53) NULL,
SitTargetOffsetY float(53) NULL,
SitTargetOffsetZ float(53) NULL,
SitTargetOrientW float(53) NULL,
SitTargetOrientX float(53) NULL,
SitTargetOrientY float(53) NULL,
SitTargetOrientZ float(53) NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.prims)
EXEC('INSERT INTO dbo.Tmp_prims (UUID, RegionUUID, ParentID, CreationDate, Name, SceneGroupID, Text, Description, SitName, TouchName, ObjectFlags, CreatorID, OwnerID, GroupID, LastOwnerID, OwnerMask, NextOwnerMask, GroupMask, EveryoneMask, BaseMask, PositionX, PositionY, PositionZ, GroupPositionX, GroupPositionY, GroupPositionZ, VelocityX, VelocityY, VelocityZ, AngularVelocityX, AngularVelocityY, AngularVelocityZ, AccelerationX, AccelerationY, AccelerationZ, RotationX, RotationY, RotationZ, RotationW, SitTargetOffsetX, SitTargetOffsetY, SitTargetOffsetZ, SitTargetOrientW, SitTargetOrientX, SitTargetOrientY, SitTargetOrientZ)
SELECT CONVERT(varchar(36), UUID), CONVERT(varchar(36), RegionUUID), ParentID, CreationDate, Name, CONVERT(varchar(36), SceneGroupID), Text, Description, SitName, TouchName, ObjectFlags, CONVERT(varchar(36), CreatorID), CONVERT(varchar(36), OwnerID), CONVERT(varchar(36), GroupID), CONVERT(varchar(36), LastOwnerID), OwnerMask, NextOwnerMask, GroupMask, EveryoneMask, BaseMask, PositionX, PositionY, PositionZ, GroupPositionX, GroupPositionY, GroupPositionZ, VelocityX, VelocityY, VelocityZ, AngularVelocityX, AngularVelocityY, AngularVelocityZ, AccelerationX, AccelerationY, AccelerationZ, RotationX, RotationY, RotationZ, RotationW, SitTargetOffsetX, SitTargetOffsetY, SitTargetOffsetZ, SitTargetOrientW, SitTargetOrientX, SitTargetOrientY, SitTargetOrientZ FROM dbo.prims WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.prims
EXECUTE sp_rename N'dbo.Tmp_prims', N'prims', 'OBJECT'
ALTER TABLE dbo.prims ADD CONSTRAINT
PK__prims__10566F31 PRIMARY KEY CLUSTERED
(
UUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 4
BEGIN TRANSACTION
CREATE TABLE Tmp_primitems
(
itemID varchar(36) NOT NULL,
primID varchar(36) NULL,
assetID varchar(36) NULL,
parentFolderID varchar(36) NULL,
invType int NULL,
assetType int NULL,
name varchar(255) NULL,
description varchar(255) NULL,
creationDate varchar(255) NULL,
creatorID varchar(36) NULL,
ownerID varchar(36) NULL,
lastOwnerID varchar(36) NULL,
groupID varchar(36) NULL,
nextPermissions int NULL,
currentPermissions int NULL,
basePermissions int NULL,
everyonePermissions int NULL,
groupPermissions int NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM primitems)
EXEC('INSERT INTO Tmp_primitems (itemID, primID, assetID, parentFolderID, invType, assetType, name, description, creationDate, creatorID, ownerID, lastOwnerID, groupID, nextPermissions, currentPermissions, basePermissions, everyonePermissions, groupPermissions)
SELECT CONVERT(varchar(36), itemID), CONVERT(varchar(36), primID), CONVERT(varchar(36), assetID), CONVERT(varchar(36), parentFolderID), invType, assetType, name, description, creationDate, CONVERT(varchar(36), creatorID), CONVERT(varchar(36), ownerID), CONVERT(varchar(36), lastOwnerID), CONVERT(varchar(36), groupID), nextPermissions, currentPermissions, basePermissions, everyonePermissions, groupPermissions')
DROP TABLE primitems
EXECUTE sp_rename N'Tmp_primitems', N'primitems', 'OBJECT'
ALTER TABLE primitems ADD CONSTRAINT
PK__primitems__0A688BB1 PRIMARY KEY CLUSTERED
(
itemID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 5
BEGIN TRANSACTION
CREATE TABLE Tmp_primshapes
(
UUID varchar(36) NOT NULL,
Shape int NULL,
ScaleX float(53) NULL,
ScaleY float(53) NULL,
ScaleZ float(53) NULL,
PCode int NULL,
PathBegin int NULL,
PathEnd int NULL,
PathScaleX int NULL,
PathScaleY int NULL,
PathShearX int NULL,
PathShearY int NULL,
PathSkew int NULL,
PathCurve int NULL,
PathRadiusOffset int NULL,
PathRevolutions int NULL,
PathTaperX int NULL,
PathTaperY int NULL,
PathTwist int NULL,
PathTwistBegin int NULL,
ProfileBegin int NULL,
ProfileEnd int NULL,
ProfileCurve int NULL,
ProfileHollow int NULL,
State int NULL,
Texture image NULL,
ExtraParams image NULL
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
IF EXISTS(SELECT * FROM primshapes)
EXEC('INSERT INTO Tmp_primshapes (UUID, Shape, ScaleX, ScaleY, ScaleZ, PCode, PathBegin, PathEnd, PathScaleX, PathScaleY, PathShearX, PathShearY, PathSkew, PathCurve, PathRadiusOffset, PathRevolutions, PathTaperX, PathTaperY, PathTwist, PathTwistBegin, ProfileBegin, ProfileEnd, ProfileCurve, ProfileHollow, State, Texture, ExtraParams)
SELECT CONVERT(varchar(36), UUID), Shape, ScaleX, ScaleY, ScaleZ, PCode, PathBegin, PathEnd, PathScaleX, PathScaleY, PathShearX, PathShearY, PathSkew, PathCurve, PathRadiusOffset, PathRevolutions, PathTaperX, PathTaperY, PathTwist, PathTwistBegin, ProfileBegin, ProfileEnd, ProfileCurve, ProfileHollow, State, Texture, ExtraParams FROM primshapes WITH (HOLDLOCK TABLOCKX)')
DROP TABLE primshapes
EXECUTE sp_rename N'Tmp_primshapes', N'primshapes', 'OBJECT'
ALTER TABLE primshapes ADD CONSTRAINT
PK__primshapes__0880433F PRIMARY KEY CLUSTERED
(
UUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 6
BEGIN TRANSACTION
ALTER TABLE prims ADD PayPrice int not null default 0
ALTER TABLE prims ADD PayButton1 int not null default 0
ALTER TABLE prims ADD PayButton2 int not null default 0
ALTER TABLE prims ADD PayButton3 int not null default 0
ALTER TABLE prims ADD PayButton4 int not null default 0
ALTER TABLE prims ADD LoopedSound varchar(36) not null default '00000000-0000-0000-0000-000000000000';
ALTER TABLE prims ADD LoopedSoundGain float not null default 0.0;
ALTER TABLE prims ADD TextureAnimation image
ALTER TABLE prims ADD OmegaX float not null default 0.0
ALTER TABLE prims ADD OmegaY float not null default 0.0
ALTER TABLE prims ADD OmegaZ float not null default 0.0
ALTER TABLE prims ADD CameraEyeOffsetX float not null default 0.0
ALTER TABLE prims ADD CameraEyeOffsetY float not null default 0.0
ALTER TABLE prims ADD CameraEyeOffsetZ float not null default 0.0
ALTER TABLE prims ADD CameraAtOffsetX float not null default 0.0
ALTER TABLE prims ADD CameraAtOffsetY float not null default 0.0
ALTER TABLE prims ADD CameraAtOffsetZ float not null default 0.0
ALTER TABLE prims ADD ForceMouselook tinyint not null default 0
ALTER TABLE prims ADD ScriptAccessPin int not null default 0
ALTER TABLE prims ADD AllowedDrop tinyint not null default 0
ALTER TABLE prims ADD DieAtEdge tinyint not null default 0
ALTER TABLE prims ADD SalePrice int not null default 10
ALTER TABLE prims ADD SaleType tinyint not null default 0
ALTER TABLE primitems add flags integer not null default 0
ALTER TABLE land ADD AuthbuyerID varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000'
CREATE index prims_regionuuid on prims(RegionUUID)
CREATE index prims_parentid on prims(ParentID)
CREATE index primitems_primid on primitems(primID)
COMMIT
:VERSION 7
BEGIN TRANSACTION
ALTER TABLE prims ADD ColorR int not null default 0;
ALTER TABLE prims ADD ColorG int not null default 0;
ALTER TABLE prims ADD ColorB int not null default 0;
ALTER TABLE prims ADD ColorA int not null default 0;
ALTER TABLE prims ADD ParticleSystem IMAGE;
ALTER TABLE prims ADD ClickAction tinyint NOT NULL default 0;
COMMIT
:VERSION 8
BEGIN TRANSACTION
ALTER TABLE land ADD OtherCleanTime integer NOT NULL default 0;
ALTER TABLE land ADD Dwell integer NOT NULL default 0;
COMMIT
:VERSION 9
BEGIN TRANSACTION
ALTER TABLE prims ADD Material tinyint NOT NULL default 3
COMMIT
:VERSION 10
BEGIN TRANSACTION
ALTER TABLE regionsettings ADD sunvectorx float NOT NULL default 0;
ALTER TABLE regionsettings ADD sunvectory float NOT NULL default 0;
ALTER TABLE regionsettings ADD sunvectorz float NOT NULL default 0;
COMMIT
:VERSION 11
BEGIN TRANSACTION
ALTER TABLE prims ADD CollisionSound char(36) not null default '00000000-0000-0000-0000-000000000000'
ALTER TABLE prims ADD CollisionSoundVolume float not null default 0.0
COMMIT
:VERSION 12
BEGIN TRANSACTION
ALTER TABLE prims ADD LinkNumber integer not null default 0
COMMIT
:VERSION 13
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_prims
(
UUID uniqueidentifier NOT NULL,
RegionUUID uniqueidentifier NULL,
ParentID int NULL,
CreationDate int NULL,
Name varchar(255) NULL,
SceneGroupID uniqueidentifier NULL,
Text varchar(255) NULL,
Description varchar(255) NULL,
SitName varchar(255) NULL,
TouchName varchar(255) NULL,
ObjectFlags int NULL,
CreatorID uniqueidentifier NULL,
OwnerID uniqueidentifier NULL,
GroupID uniqueidentifier NULL,
LastOwnerID uniqueidentifier NULL,
OwnerMask int NULL,
NextOwnerMask int NULL,
GroupMask int NULL,
EveryoneMask int NULL,
BaseMask int NULL,
PositionX float(53) NULL,
PositionY float(53) NULL,
PositionZ float(53) NULL,
GroupPositionX float(53) NULL,
GroupPositionY float(53) NULL,
GroupPositionZ float(53) NULL,
VelocityX float(53) NULL,
VelocityY float(53) NULL,
VelocityZ float(53) NULL,
AngularVelocityX float(53) NULL,
AngularVelocityY float(53) NULL,
AngularVelocityZ float(53) NULL,
AccelerationX float(53) NULL,
AccelerationY float(53) NULL,
AccelerationZ float(53) NULL,
RotationX float(53) NULL,
RotationY float(53) NULL,
RotationZ float(53) NULL,
RotationW float(53) NULL,
SitTargetOffsetX float(53) NULL,
SitTargetOffsetY float(53) NULL,
SitTargetOffsetZ float(53) NULL,
SitTargetOrientW float(53) NULL,
SitTargetOrientX float(53) NULL,
SitTargetOrientY float(53) NULL,
SitTargetOrientZ float(53) NULL,
PayPrice int NOT NULL DEFAULT ((0)),
PayButton1 int NOT NULL DEFAULT ((0)),
PayButton2 int NOT NULL DEFAULT ((0)),
PayButton3 int NOT NULL DEFAULT ((0)),
PayButton4 int NOT NULL DEFAULT ((0)),
LoopedSound uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
LoopedSoundGain float(53) NOT NULL DEFAULT ((0.0)),
TextureAnimation image NULL,
OmegaX float(53) NOT NULL DEFAULT ((0.0)),
OmegaY float(53) NOT NULL DEFAULT ((0.0)),
OmegaZ float(53) NOT NULL DEFAULT ((0.0)),
CameraEyeOffsetX float(53) NOT NULL DEFAULT ((0.0)),
CameraEyeOffsetY float(53) NOT NULL DEFAULT ((0.0)),
CameraEyeOffsetZ float(53) NOT NULL DEFAULT ((0.0)),
CameraAtOffsetX float(53) NOT NULL DEFAULT ((0.0)),
CameraAtOffsetY float(53) NOT NULL DEFAULT ((0.0)),
CameraAtOffsetZ float(53) NOT NULL DEFAULT ((0.0)),
ForceMouselook tinyint NOT NULL DEFAULT ((0)),
ScriptAccessPin int NOT NULL DEFAULT ((0)),
AllowedDrop tinyint NOT NULL DEFAULT ((0)),
DieAtEdge tinyint NOT NULL DEFAULT ((0)),
SalePrice int NOT NULL DEFAULT ((10)),
SaleType tinyint NOT NULL DEFAULT ((0)),
ColorR int NOT NULL DEFAULT ((0)),
ColorG int NOT NULL DEFAULT ((0)),
ColorB int NOT NULL DEFAULT ((0)),
ColorA int NOT NULL DEFAULT ((0)),
ParticleSystem image NULL,
ClickAction tinyint NOT NULL DEFAULT ((0)),
Material tinyint NOT NULL DEFAULT ((3)),
CollisionSound uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
CollisionSoundVolume float(53) NOT NULL DEFAULT ((0.0)),
LinkNumber int NOT NULL DEFAULT ((0))
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.prims)
EXEC('INSERT INTO dbo.Tmp_prims (UUID, RegionUUID, ParentID, CreationDate, Name, SceneGroupID, Text, Description, SitName, TouchName, ObjectFlags, CreatorID, OwnerID, GroupID, LastOwnerID, OwnerMask, NextOwnerMask, GroupMask, EveryoneMask, BaseMask, PositionX, PositionY, PositionZ, GroupPositionX, GroupPositionY, GroupPositionZ, VelocityX, VelocityY, VelocityZ, AngularVelocityX, AngularVelocityY, AngularVelocityZ, AccelerationX, AccelerationY, AccelerationZ, RotationX, RotationY, RotationZ, RotationW, SitTargetOffsetX, SitTargetOffsetY, SitTargetOffsetZ, SitTargetOrientW, SitTargetOrientX, SitTargetOrientY, SitTargetOrientZ, PayPrice, PayButton1, PayButton2, PayButton3, PayButton4, LoopedSound, LoopedSoundGain, TextureAnimation, OmegaX, OmegaY, OmegaZ, CameraEyeOffsetX, CameraEyeOffsetY, CameraEyeOffsetZ, CameraAtOffsetX, CameraAtOffsetY, CameraAtOffsetZ, ForceMouselook, ScriptAccessPin, AllowedDrop, DieAtEdge, SalePrice, SaleType, ColorR, ColorG, ColorB, ColorA, ParticleSystem, ClickAction, Material, CollisionSound, CollisionSoundVolume, LinkNumber)
SELECT CONVERT(uniqueidentifier, UUID), CONVERT(uniqueidentifier, RegionUUID), ParentID, CreationDate, Name, CONVERT(uniqueidentifier, SceneGroupID), Text, Description, SitName, TouchName, ObjectFlags, CONVERT(uniqueidentifier, CreatorID), CONVERT(uniqueidentifier, OwnerID), CONVERT(uniqueidentifier, GroupID), CONVERT(uniqueidentifier, LastOwnerID), OwnerMask, NextOwnerMask, GroupMask, EveryoneMask, BaseMask, PositionX, PositionY, PositionZ, GroupPositionX, GroupPositionY, GroupPositionZ, VelocityX, VelocityY, VelocityZ, AngularVelocityX, AngularVelocityY, AngularVelocityZ, AccelerationX, AccelerationY, AccelerationZ, RotationX, RotationY, RotationZ, RotationW, SitTargetOffsetX, SitTargetOffsetY, SitTargetOffsetZ, SitTargetOrientW, SitTargetOrientX, SitTargetOrientY, SitTargetOrientZ, PayPrice, PayButton1, PayButton2, PayButton3, PayButton4, CONVERT(uniqueidentifier, LoopedSound), LoopedSoundGain, TextureAnimation, OmegaX, OmegaY, OmegaZ, CameraEyeOffsetX, CameraEyeOffsetY, CameraEyeOffsetZ, CameraAtOffsetX, CameraAtOffsetY, CameraAtOffsetZ, ForceMouselook, ScriptAccessPin, AllowedDrop, DieAtEdge, SalePrice, SaleType, ColorR, ColorG, ColorB, ColorA, ParticleSystem, ClickAction, Material, CONVERT(uniqueidentifier, CollisionSound), CollisionSoundVolume, LinkNumber FROM dbo.prims WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.prims
EXECUTE sp_rename N'dbo.Tmp_prims', N'prims', 'OBJECT'
ALTER TABLE dbo.prims ADD CONSTRAINT
PK__prims__10566F31 PRIMARY KEY CLUSTERED
(
UUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX prims_regionuuid ON dbo.prims
(
RegionUUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX prims_parentid ON dbo.prims
(
ParentID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 14
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_primshapes
(
UUID uniqueidentifier NOT NULL,
Shape int NULL,
ScaleX float(53) NULL,
ScaleY float(53) NULL,
ScaleZ float(53) NULL,
PCode int NULL,
PathBegin int NULL,
PathEnd int NULL,
PathScaleX int NULL,
PathScaleY int NULL,
PathShearX int NULL,
PathShearY int NULL,
PathSkew int NULL,
PathCurve int NULL,
PathRadiusOffset int NULL,
PathRevolutions int NULL,
PathTaperX int NULL,
PathTaperY int NULL,
PathTwist int NULL,
PathTwistBegin int NULL,
ProfileBegin int NULL,
ProfileEnd int NULL,
ProfileCurve int NULL,
ProfileHollow int NULL,
State int NULL,
Texture image NULL,
ExtraParams image NULL
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.primshapes)
EXEC('INSERT INTO dbo.Tmp_primshapes (UUID, Shape, ScaleX, ScaleY, ScaleZ, PCode, PathBegin, PathEnd, PathScaleX, PathScaleY, PathShearX, PathShearY, PathSkew, PathCurve, PathRadiusOffset, PathRevolutions, PathTaperX, PathTaperY, PathTwist, PathTwistBegin, ProfileBegin, ProfileEnd, ProfileCurve, ProfileHollow, State, Texture, ExtraParams)
SELECT CONVERT(uniqueidentifier, UUID), Shape, ScaleX, ScaleY, ScaleZ, PCode, PathBegin, PathEnd, PathScaleX, PathScaleY, PathShearX, PathShearY, PathSkew, PathCurve, PathRadiusOffset, PathRevolutions, PathTaperX, PathTaperY, PathTwist, PathTwistBegin, ProfileBegin, ProfileEnd, ProfileCurve, ProfileHollow, State, Texture, ExtraParams FROM dbo.primshapes WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.primshapes
EXECUTE sp_rename N'dbo.Tmp_primshapes', N'primshapes', 'OBJECT'
ALTER TABLE dbo.primshapes ADD CONSTRAINT
PK__primshapes__0880433F PRIMARY KEY CLUSTERED
(
UUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 15
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_primitems
(
itemID uniqueidentifier NOT NULL,
primID uniqueidentifier NULL,
assetID uniqueidentifier NULL,
parentFolderID uniqueidentifier NULL,
invType int NULL,
assetType int NULL,
name varchar(255) NULL,
description varchar(255) NULL,
creationDate varchar(255) NULL,
creatorID uniqueidentifier NULL,
ownerID uniqueidentifier NULL,
lastOwnerID uniqueidentifier NULL,
groupID uniqueidentifier NULL,
nextPermissions int NULL,
currentPermissions int NULL,
basePermissions int NULL,
everyonePermissions int NULL,
groupPermissions int NULL,
flags int NOT NULL DEFAULT ((0))
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.primitems)
EXEC('INSERT INTO dbo.Tmp_primitems (itemID, primID, assetID, parentFolderID, invType, assetType, name, description, creationDate, creatorID, ownerID, lastOwnerID, groupID, nextPermissions, currentPermissions, basePermissions, everyonePermissions, groupPermissions, flags)
SELECT CONVERT(uniqueidentifier, itemID), CONVERT(uniqueidentifier, primID), CONVERT(uniqueidentifier, assetID), CONVERT(uniqueidentifier, parentFolderID), invType, assetType, name, description, creationDate, CONVERT(uniqueidentifier, creatorID), CONVERT(uniqueidentifier, ownerID), CONVERT(uniqueidentifier, lastOwnerID), CONVERT(uniqueidentifier, groupID), nextPermissions, currentPermissions, basePermissions, everyonePermissions, groupPermissions, flags FROM dbo.primitems WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.primitems
EXECUTE sp_rename N'dbo.Tmp_primitems', N'primitems', 'OBJECT'
ALTER TABLE dbo.primitems ADD CONSTRAINT
PK__primitems__0A688BB1 PRIMARY KEY CLUSTERED
(
itemID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX primitems_primid ON dbo.primitems
(
primID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 16
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_terrain
(
RegionUUID uniqueidentifier NULL,
Revision int NULL,
Heightfield image NULL
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.terrain)
EXEC('INSERT INTO dbo.Tmp_terrain (RegionUUID, Revision, Heightfield)
SELECT CONVERT(uniqueidentifier, RegionUUID), Revision, Heightfield FROM dbo.terrain WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.terrain
EXECUTE sp_rename N'dbo.Tmp_terrain', N'terrain', 'OBJECT'
COMMIT
:VERSION 17
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_land
(
UUID uniqueidentifier NOT NULL,
RegionUUID uniqueidentifier NULL,
LocalLandID int NULL,
Bitmap image NULL,
Name varchar(255) NULL,
Description varchar(255) NULL,
OwnerUUID uniqueidentifier NULL,
IsGroupOwned int NULL,
Area int NULL,
AuctionID int NULL,
Category int NULL,
ClaimDate int NULL,
ClaimPrice int NULL,
GroupUUID uniqueidentifier NULL,
SalePrice int NULL,
LandStatus int NULL,
LandFlags int NULL,
LandingType int NULL,
MediaAutoScale int NULL,
MediaTextureUUID uniqueidentifier NULL,
MediaURL varchar(255) NULL,
MusicURL varchar(255) NULL,
PassHours float(53) NULL,
PassPrice int NULL,
SnapshotUUID uniqueidentifier NULL,
UserLocationX float(53) NULL,
UserLocationY float(53) NULL,
UserLocationZ float(53) NULL,
UserLookAtX float(53) NULL,
UserLookAtY float(53) NULL,
UserLookAtZ float(53) NULL,
AuthbuyerID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
OtherCleanTime int NOT NULL DEFAULT ((0)),
Dwell int NOT NULL DEFAULT ((0))
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.land)
EXEC('INSERT INTO dbo.Tmp_land (UUID, RegionUUID, LocalLandID, Bitmap, Name, Description, OwnerUUID, IsGroupOwned, Area, AuctionID, Category, ClaimDate, ClaimPrice, GroupUUID, SalePrice, LandStatus, LandFlags, LandingType, MediaAutoScale, MediaTextureUUID, MediaURL, MusicURL, PassHours, PassPrice, SnapshotUUID, UserLocationX, UserLocationY, UserLocationZ, UserLookAtX, UserLookAtY, UserLookAtZ, AuthbuyerID, OtherCleanTime, Dwell)
SELECT CONVERT(uniqueidentifier, UUID), CONVERT(uniqueidentifier, RegionUUID), LocalLandID, Bitmap, Name, Description, CONVERT(uniqueidentifier, OwnerUUID), IsGroupOwned, Area, AuctionID, Category, ClaimDate, ClaimPrice, CONVERT(uniqueidentifier, GroupUUID), SalePrice, LandStatus, LandFlags, LandingType, MediaAutoScale, CONVERT(uniqueidentifier, MediaTextureUUID), MediaURL, MusicURL, PassHours, PassPrice, CONVERT(uniqueidentifier, SnapshotUUID), UserLocationX, UserLocationY, UserLocationZ, UserLookAtX, UserLookAtY, UserLookAtZ, CONVERT(uniqueidentifier, AuthbuyerID), OtherCleanTime, Dwell FROM dbo.land WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.land
EXECUTE sp_rename N'dbo.Tmp_land', N'land', 'OBJECT'
ALTER TABLE dbo.land ADD CONSTRAINT
PK__land__65A475E71BFD2C07 PRIMARY KEY CLUSTERED
(
UUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 18
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_landaccesslist
(
LandUUID uniqueidentifier NULL,
AccessUUID uniqueidentifier NULL,
Flags int NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.landaccesslist)
EXEC('INSERT INTO dbo.Tmp_landaccesslist (LandUUID, AccessUUID, Flags)
SELECT CONVERT(uniqueidentifier, LandUUID), CONVERT(uniqueidentifier, AccessUUID), Flags FROM dbo.landaccesslist WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.landaccesslist
EXECUTE sp_rename N'dbo.Tmp_landaccesslist', N'landaccesslist', 'OBJECT'
COMMIT
:VERSION 19
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_regionban
(
regionUUID uniqueidentifier NOT NULL,
bannedUUID uniqueidentifier NOT NULL,
bannedIp varchar(16) NOT NULL,
bannedIpHostMask varchar(16) NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.regionban)
EXEC('INSERT INTO dbo.Tmp_regionban (regionUUID, bannedUUID, bannedIp, bannedIpHostMask)
SELECT CONVERT(uniqueidentifier, regionUUID), CONVERT(uniqueidentifier, bannedUUID), bannedIp, bannedIpHostMask FROM dbo.regionban WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.regionban
EXECUTE sp_rename N'dbo.Tmp_regionban', N'regionban', 'OBJECT'
COMMIT
:VERSION 20
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_regionsettings
(
regionUUID uniqueidentifier NOT NULL,
block_terraform bit NOT NULL,
block_fly bit NOT NULL,
allow_damage bit NOT NULL,
restrict_pushing bit NOT NULL,
allow_land_resell bit NOT NULL,
allow_land_join_divide bit NOT NULL,
block_show_in_search bit NOT NULL,
agent_limit int NOT NULL,
object_bonus float(53) NOT NULL,
maturity int NOT NULL,
disable_scripts bit NOT NULL,
disable_collisions bit NOT NULL,
disable_physics bit NOT NULL,
terrain_texture_1 uniqueidentifier NOT NULL,
terrain_texture_2 uniqueidentifier NOT NULL,
terrain_texture_3 uniqueidentifier NOT NULL,
terrain_texture_4 uniqueidentifier NOT NULL,
elevation_1_nw float(53) NOT NULL,
elevation_2_nw float(53) NOT NULL,
elevation_1_ne float(53) NOT NULL,
elevation_2_ne float(53) NOT NULL,
elevation_1_se float(53) NOT NULL,
elevation_2_se float(53) NOT NULL,
elevation_1_sw float(53) NOT NULL,
elevation_2_sw float(53) NOT NULL,
water_height float(53) NOT NULL,
terrain_raise_limit float(53) NOT NULL,
terrain_lower_limit float(53) NOT NULL,
use_estate_sun bit NOT NULL,
fixed_sun bit NOT NULL,
sun_position float(53) NOT NULL,
covenant uniqueidentifier NULL DEFAULT (NULL),
Sandbox bit NOT NULL,
sunvectorx float(53) NOT NULL DEFAULT ((0)),
sunvectory float(53) NOT NULL DEFAULT ((0)),
sunvectorz float(53) NOT NULL DEFAULT ((0))
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.regionsettings)
EXEC('INSERT INTO dbo.Tmp_regionsettings (regionUUID, block_terraform, block_fly, allow_damage, restrict_pushing, allow_land_resell, allow_land_join_divide, block_show_in_search, agent_limit, object_bonus, maturity, disable_scripts, disable_collisions, disable_physics, terrain_texture_1, terrain_texture_2, terrain_texture_3, terrain_texture_4, elevation_1_nw, elevation_2_nw, elevation_1_ne, elevation_2_ne, elevation_1_se, elevation_2_se, elevation_1_sw, elevation_2_sw, water_height, terrain_raise_limit, terrain_lower_limit, use_estate_sun, fixed_sun, sun_position, covenant, Sandbox, sunvectorx, sunvectory, sunvectorz)
SELECT CONVERT(uniqueidentifier, regionUUID), block_terraform, block_fly, allow_damage, restrict_pushing, allow_land_resell, allow_land_join_divide, block_show_in_search, agent_limit, object_bonus, maturity, disable_scripts, disable_collisions, disable_physics, CONVERT(uniqueidentifier, terrain_texture_1), CONVERT(uniqueidentifier, terrain_texture_2), CONVERT(uniqueidentifier, terrain_texture_3), CONVERT(uniqueidentifier, terrain_texture_4), elevation_1_nw, elevation_2_nw, elevation_1_ne, elevation_2_ne, elevation_1_se, elevation_2_se, elevation_1_sw, elevation_2_sw, water_height, terrain_raise_limit, terrain_lower_limit, use_estate_sun, fixed_sun, sun_position, CONVERT(uniqueidentifier, covenant), Sandbox, sunvectorx, sunvectory, sunvectorz FROM dbo.regionsettings WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.regionsettings
EXECUTE sp_rename N'dbo.Tmp_regionsettings', N'regionsettings', 'OBJECT'
ALTER TABLE dbo.regionsettings ADD CONSTRAINT
PK__regionse__5B35159D21B6055D PRIMARY KEY CLUSTERED
(
regionUUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 21
BEGIN TRANSACTION
ALTER TABLE prims ADD PassTouches bit not null default 0
COMMIT
:VERSION 22
BEGIN TRANSACTION
ALTER TABLE regionsettings ADD loaded_creation_date varchar(20)
ALTER TABLE regionsettings ADD loaded_creation_time varchar(20)
ALTER TABLE regionsettings ADD loaded_creation_id varchar(64)
COMMIT
:VERSION 23
BEGIN TRANSACTION
ALTER TABLE regionsettings DROP COLUMN loaded_creation_date
ALTER TABLE regionsettings DROP COLUMN loaded_creation_time
ALTER TABLE regionsettings ADD loaded_creation_datetime int NOT NULL default 0
COMMIT

View File

@ -0,0 +1,55 @@
:VERSION 1
CREATE TABLE [UserAccounts] (
[PrincipalID] uniqueidentifier NOT NULL,
[ScopeID] uniqueidentifier NOT NULL,
[FirstName] [varchar](64) NOT NULL,
[LastName] [varchar](64) NOT NULL,
[Email] [varchar](64) NULL,
[ServiceURLs] [text] NULL,
[Created] [int] default NULL,
PRIMARY KEY CLUSTERED
(
[PrincipalID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
:VERSION 2
BEGIN TRANSACTION
INSERT INTO UserAccounts (PrincipalID, ScopeID, FirstName, LastName, Email, ServiceURLs, Created) SELECT [UUID] AS PrincipalID, '00000000-0000-0000-0000-000000000000' AS ScopeID,
username AS FirstName,
lastname AS LastName,
email as Email, (
'AssetServerURI=' +
userAssetURI + ' InventoryServerURI=' + userInventoryURI + ' GatewayURI= HomeURI=') AS ServiceURLs,
created as Created FROM users;
COMMIT
:VERSION 3
BEGIN TRANSACTION
CREATE UNIQUE INDEX PrincipalID ON UserAccounts(PrincipalID);
CREATE INDEX Email ON UserAccounts(Email);
CREATE INDEX FirstName ON UserAccounts(FirstName);
CREATE INDEX LastName ON UserAccounts(LastName);
CREATE INDEX Name ON UserAccounts(FirstName,LastName);
COMMIT
:VERSION 4
BEGIN TRANSACTION
ALTER TABLE UserAccounts ADD UserLevel integer NOT NULL DEFAULT 0;
ALTER TABLE UserAccounts ADD UserFlags integer NOT NULL DEFAULT 0;
ALTER TABLE UserAccounts ADD UserTitle varchar(64) NOT NULL DEFAULT '';
COMMIT

View File

@ -0,0 +1,421 @@
:VERSION 1
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]
:VERSION 2
BEGIN TRANSACTION
ALTER TABLE users ADD homeRegionID varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000';
ALTER TABLE users ADD userFlags int NOT NULL default 0;
ALTER TABLE users ADD godLevel int NOT NULL default 0;
ALTER TABLE users ADD customType varchar(32) not null default '';
ALTER TABLE users ADD partner varchar(36) not null default '00000000-0000-0000-0000-000000000000';
COMMIT
:VERSION 3
BEGIN TRANSACTION
CREATE TABLE [avatarattachments] (
[UUID] varchar(36) NOT NULL
, [attachpoint] int NOT NULL
, [item] varchar(36) NOT NULL
, [asset] varchar(36) NOT NULL)
CREATE NONCLUSTERED INDEX IX_avatarattachments ON dbo.avatarattachments
(
UUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 4
BEGIN TRANSACTION
CREATE TABLE Tmp_userfriends
(
ownerID varchar(36) NOT NULL,
friendID varchar(36) NOT NULL,
friendPerms int NOT NULL,
datetimestamp int NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM userfriends)
EXEC('INSERT INTO dbo.Tmp_userfriends (ownerID, friendID, friendPerms, datetimestamp)
SELECT CONVERT(varchar(36), ownerID), CONVERT(varchar(36), friendID), CONVERT(int, friendPerms), CONVERT(int, datetimestamp) FROM dbo.userfriends WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.userfriends
EXECUTE sp_rename N'Tmp_userfriends', N'userfriends', 'OBJECT'
CREATE NONCLUSTERED INDEX IX_userfriends_ownerID ON userfriends
(
ownerID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX IX_userfriends_friendID ON userfriends
(
friendID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 5
BEGIN TRANSACTION
ALTER TABLE users add email varchar(250);
COMMIT
:VERSION 6
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_users
(
UUID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
username varchar(32) NOT NULL,
lastname varchar(32) NOT NULL,
passwordHash varchar(32) NOT NULL,
passwordSalt varchar(32) NOT NULL,
homeRegion bigint NULL DEFAULT (NULL),
homeLocationX float(53) NULL DEFAULT (NULL),
homeLocationY float(53) NULL DEFAULT (NULL),
homeLocationZ float(53) NULL DEFAULT (NULL),
homeLookAtX float(53) NULL DEFAULT (NULL),
homeLookAtY float(53) NULL DEFAULT (NULL),
homeLookAtZ float(53) NULL DEFAULT (NULL),
created int NOT NULL,
lastLogin int NOT NULL,
userInventoryURI varchar(255) NULL DEFAULT (NULL),
userAssetURI varchar(255) NULL DEFAULT (NULL),
profileCanDoMask int NULL DEFAULT (NULL),
profileWantDoMask int NULL DEFAULT (NULL),
profileAboutText ntext NULL,
profileFirstText ntext NULL,
profileImage uniqueidentifier NULL DEFAULT (NULL),
profileFirstImage uniqueidentifier NULL DEFAULT (NULL),
webLoginKey uniqueidentifier NULL DEFAULT (NULL),
homeRegionID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
userFlags int NOT NULL DEFAULT ((0)),
godLevel int NOT NULL DEFAULT ((0)),
customType varchar(32) NOT NULL DEFAULT (''),
partner uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
email varchar(250) NULL
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.users)
EXEC('INSERT INTO dbo.Tmp_users (UUID, username, lastname, passwordHash, passwordSalt, homeRegion, homeLocationX, homeLocationY, homeLocationZ, homeLookAtX, homeLookAtY, homeLookAtZ, created, lastLogin, userInventoryURI, userAssetURI, profileCanDoMask, profileWantDoMask, profileAboutText, profileFirstText, profileImage, profileFirstImage, webLoginKey, homeRegionID, userFlags, godLevel, customType, partner, email)
SELECT CONVERT(uniqueidentifier, UUID), username, lastname, passwordHash, passwordSalt, homeRegion, homeLocationX, homeLocationY, homeLocationZ, homeLookAtX, homeLookAtY, homeLookAtZ, created, lastLogin, userInventoryURI, userAssetURI, profileCanDoMask, profileWantDoMask, profileAboutText, profileFirstText, CONVERT(uniqueidentifier, profileImage), CONVERT(uniqueidentifier, profileFirstImage), CONVERT(uniqueidentifier, webLoginKey), CONVERT(uniqueidentifier, homeRegionID), userFlags, godLevel, customType, CONVERT(uniqueidentifier, partner), email FROM dbo.users WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.users
EXECUTE sp_rename N'dbo.Tmp_users', N'users', 'OBJECT'
ALTER TABLE dbo.users ADD CONSTRAINT
PK__users__65A475E737A5467C PRIMARY KEY CLUSTERED
(
UUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX usernames ON dbo.users
(
username,
lastname
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 7
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_agents
(
UUID uniqueidentifier NOT NULL,
sessionID uniqueidentifier NOT NULL,
secureSessionID uniqueidentifier NOT NULL,
agentIP varchar(16) NOT NULL,
agentPort int NOT NULL,
agentOnline tinyint NOT NULL,
loginTime int NOT NULL,
logoutTime int NOT NULL,
currentRegion uniqueidentifier NOT NULL,
currentHandle bigint NOT NULL,
currentPos varchar(64) NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.agents)
EXEC('INSERT INTO dbo.Tmp_agents (UUID, sessionID, secureSessionID, agentIP, agentPort, agentOnline, loginTime, logoutTime, currentRegion, currentHandle, currentPos)
SELECT CONVERT(uniqueidentifier, UUID), CONVERT(uniqueidentifier, sessionID), CONVERT(uniqueidentifier, secureSessionID), agentIP, agentPort, agentOnline, loginTime, logoutTime, CONVERT(uniqueidentifier, currentRegion), currentHandle, currentPos FROM dbo.agents WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.agents
EXECUTE sp_rename N'dbo.Tmp_agents', N'agents', 'OBJECT'
ALTER TABLE dbo.agents ADD CONSTRAINT
PK__agents__65A475E749C3F6B7 PRIMARY KEY CLUSTERED
(
UUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX session ON dbo.agents
(
sessionID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX ssession ON dbo.agents
(
secureSessionID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 8
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_userfriends
(
ownerID uniqueidentifier NOT NULL,
friendID uniqueidentifier NOT NULL,
friendPerms int NOT NULL,
datetimestamp int NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.userfriends)
EXEC('INSERT INTO dbo.Tmp_userfriends (ownerID, friendID, friendPerms, datetimestamp)
SELECT CONVERT(uniqueidentifier, ownerID), CONVERT(uniqueidentifier, friendID), friendPerms, datetimestamp FROM dbo.userfriends WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.userfriends
EXECUTE sp_rename N'dbo.Tmp_userfriends', N'userfriends', 'OBJECT'
CREATE NONCLUSTERED INDEX IX_userfriends_ownerID ON dbo.userfriends
(
ownerID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX IX_userfriends_friendID ON dbo.userfriends
(
friendID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 9
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_avatarappearance
(
Owner uniqueidentifier NOT NULL,
Serial int NOT NULL,
Visual_Params image NOT NULL,
Texture image NOT NULL,
Avatar_Height float(53) NOT NULL,
Body_Item uniqueidentifier NOT NULL,
Body_Asset uniqueidentifier NOT NULL,
Skin_Item uniqueidentifier NOT NULL,
Skin_Asset uniqueidentifier NOT NULL,
Hair_Item uniqueidentifier NOT NULL,
Hair_Asset uniqueidentifier NOT NULL,
Eyes_Item uniqueidentifier NOT NULL,
Eyes_Asset uniqueidentifier NOT NULL,
Shirt_Item uniqueidentifier NOT NULL,
Shirt_Asset uniqueidentifier NOT NULL,
Pants_Item uniqueidentifier NOT NULL,
Pants_Asset uniqueidentifier NOT NULL,
Shoes_Item uniqueidentifier NOT NULL,
Shoes_Asset uniqueidentifier NOT NULL,
Socks_Item uniqueidentifier NOT NULL,
Socks_Asset uniqueidentifier NOT NULL,
Jacket_Item uniqueidentifier NOT NULL,
Jacket_Asset uniqueidentifier NOT NULL,
Gloves_Item uniqueidentifier NOT NULL,
Gloves_Asset uniqueidentifier NOT NULL,
Undershirt_Item uniqueidentifier NOT NULL,
Undershirt_Asset uniqueidentifier NOT NULL,
Underpants_Item uniqueidentifier NOT NULL,
Underpants_Asset uniqueidentifier NOT NULL,
Skirt_Item uniqueidentifier NOT NULL,
Skirt_Asset uniqueidentifier NOT NULL
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.avatarappearance)
EXEC('INSERT INTO dbo.Tmp_avatarappearance (Owner, Serial, Visual_Params, Texture, Avatar_Height, Body_Item, Body_Asset, Skin_Item, Skin_Asset, Hair_Item, Hair_Asset, Eyes_Item, Eyes_Asset, Shirt_Item, Shirt_Asset, Pants_Item, Pants_Asset, Shoes_Item, Shoes_Asset, Socks_Item, Socks_Asset, Jacket_Item, Jacket_Asset, Gloves_Item, Gloves_Asset, Undershirt_Item, Undershirt_Asset, Underpants_Item, Underpants_Asset, Skirt_Item, Skirt_Asset)
SELECT CONVERT(uniqueidentifier, Owner), Serial, Visual_Params, Texture, Avatar_Height, CONVERT(uniqueidentifier, Body_Item), CONVERT(uniqueidentifier, Body_Asset), CONVERT(uniqueidentifier, Skin_Item), CONVERT(uniqueidentifier, Skin_Asset), CONVERT(uniqueidentifier, Hair_Item), CONVERT(uniqueidentifier, Hair_Asset), CONVERT(uniqueidentifier, Eyes_Item), CONVERT(uniqueidentifier, Eyes_Asset), CONVERT(uniqueidentifier, Shirt_Item), CONVERT(uniqueidentifier, Shirt_Asset), CONVERT(uniqueidentifier, Pants_Item), CONVERT(uniqueidentifier, Pants_Asset), CONVERT(uniqueidentifier, Shoes_Item), CONVERT(uniqueidentifier, Shoes_Asset), CONVERT(uniqueidentifier, Socks_Item), CONVERT(uniqueidentifier, Socks_Asset), CONVERT(uniqueidentifier, Jacket_Item), CONVERT(uniqueidentifier, Jacket_Asset), CONVERT(uniqueidentifier, Gloves_Item), CONVERT(uniqueidentifier, Gloves_Asset), CONVERT(uniqueidentifier, Undershirt_Item), CONVERT(uniqueidentifier, Undershirt_Asset), CONVERT(uniqueidentifier, Underpants_Item), CONVERT(uniqueidentifier, Underpants_Asset), CONVERT(uniqueidentifier, Skirt_Item), CONVERT(uniqueidentifier, Skirt_Asset) FROM dbo.avatarappearance WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.avatarappearance
EXECUTE sp_rename N'dbo.Tmp_avatarappearance', N'avatarappearance', 'OBJECT'
ALTER TABLE dbo.avatarappearance ADD CONSTRAINT
PK__avatarap__7DD115CC4E88ABD4 PRIMARY KEY CLUSTERED
(
Owner
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 10
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_avatarattachments
(
UUID uniqueidentifier NOT NULL,
attachpoint int NOT NULL,
item uniqueidentifier NOT NULL,
asset uniqueidentifier NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.avatarattachments)
EXEC('INSERT INTO dbo.Tmp_avatarattachments (UUID, attachpoint, item, asset)
SELECT CONVERT(uniqueidentifier, UUID), attachpoint, CONVERT(uniqueidentifier, item), CONVERT(uniqueidentifier, asset) FROM dbo.avatarattachments WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.avatarattachments
EXECUTE sp_rename N'dbo.Tmp_avatarattachments', N'avatarattachments', 'OBJECT'
CREATE NONCLUSTERED INDEX IX_avatarattachments ON dbo.avatarattachments
(
UUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 11
BEGIN TRANSACTION
ALTER TABLE users ADD scopeID uniqueidentifier not null default '00000000-0000-0000-0000-000000000000'
COMMIT

View File

@ -72,59 +72,116 @@ namespace OpenSim.Data
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private string _type;
private DbConnection _conn;
// private string _subtype;
private Assembly _assem;
private Regex _match;
protected string _type;
protected DbConnection _conn;
protected Assembly _assem;
private static readonly string _migrations_create = "create table migrations(name varchar(100), version int)";
// private static readonly string _migrations_init = "insert into migrations values('migrations', 1)";
// private static readonly string _migrations_find = "select version from migrations where name='migrations'";
private Regex _match_old;
private Regex _match_new;
public Migration(DbConnection conn, Assembly assem, string type)
{
_type = type;
_conn = conn;
_assem = assem;
_match = new Regex(@"\.(\d\d\d)_" + _type + @"\.sql");
Initialize();
/// <summary>Have the parameterless constructor just so we can specify it as a generic parameter with the new() constraint.
/// Currently this is only used in the tests. A Migration instance created this way must be then
/// initialized with Initialize(). Regular creation should be through the parameterized constructors.
/// </summary>
public Migration()
{
}
public Migration(DbConnection conn, Assembly assem, string subtype, string type)
{
Initialize(conn, assem, type, subtype);
}
public Migration(DbConnection conn, Assembly assem, string type)
{
Initialize(conn, assem, type, "");
}
/// <summary>Must be called after creating with the parameterless constructor.
/// NOTE that the Migration class now doesn't access database in any way during initialization.
/// Specifically, it won't check if the [migrations] table exists. Such checks are done later:
/// automatically on Update(), or you can explicitly call InitMigrationsTable().
/// </summary>
/// <param name="conn"></param>
/// <param name="assem"></param>
/// <param name="subtype"></param>
/// <param name="type"></param>
public void Initialize (DbConnection conn, Assembly assem, string type, string subtype)
{
_type = type;
_conn = conn;
_assem = assem;
_match = new Regex(subtype + @"\.(\d\d\d)_" + _type + @"\.sql");
Initialize();
_match_old = new Regex(subtype + @"\.(\d\d\d)_" + _type + @"\.sql");
string s = String.IsNullOrEmpty(subtype) ? _type : _type + @"\." + subtype;
_match_new = new Regex(@"\." + s + @"\.migrations(?:\.(?<ver>\d+)$|.*)");
}
private void Initialize()
public void InitMigrationsTable()
{
// clever, eh, we figure out which migrations version we are
int migration_version = FindVersion(_conn, "migrations");
if (migration_version > 0)
return;
// If not, create the migration tables
using (DbCommand cmd = _conn.CreateCommand())
// NOTE: normally when the [migrations] table is created, the version record for 'migrations' is
// added immediately. However, if for some reason the table is there but empty, we want to handle that as well.
int ver = FindVersion(_conn, "migrations");
if (ver <= 0) // -1 = no table, 0 = no version record
{
cmd.CommandText = _migrations_create;
cmd.ExecuteNonQuery();
if( ver < 0 )
ExecuteScript("create table migrations(name varchar(100), version int)");
InsertVersion("migrations", 1);
}
InsertVersion("migrations", 1);
}
/// <summary>Executes a script, possibly in a database-specific way.
/// It can be redefined for a specific DBMS, if necessary. Specifically,
/// to avoid problems with proc definitions in MySQL, we must use
/// MySqlScript class instead of just DbCommand. We don't want to bring
/// MySQL references here, so instead define a MySQLMigration class
/// in OpenSim.Data.MySQL
/// </summary>
/// <param name="conn"></param>
/// <param name="script">Array of strings, one-per-batch (often just one)</param>
protected virtual void ExecuteScript(DbConnection conn, string[] script)
{
using (DbCommand cmd = conn.CreateCommand())
{
cmd.CommandTimeout = 0;
foreach (string sql in script)
{
cmd.CommandText = sql;
try
{
cmd.ExecuteNonQuery();
}
catch(Exception e)
{
throw new Exception(e.Message + " in SQL: " + sql);
}
}
}
}
protected void ExecuteScript(DbConnection conn, string sql)
{
ExecuteScript(conn, new string[]{sql});
}
protected void ExecuteScript(string sql)
{
ExecuteScript(_conn, sql);
}
protected void ExecuteScript(string[] script)
{
ExecuteScript(_conn, script);
}
public void Update()
{
int version = 0;
version = FindVersion(_conn, _type);
InitMigrationsTable();
SortedList<int, string> migrations = GetMigrationsAfter(version);
int version = FindVersion(_conn, _type);
SortedList<int, string[]> migrations = GetMigrationsAfter(version);
if (migrations.Count < 1)
return;
@ -132,57 +189,40 @@ namespace OpenSim.Data
m_log.InfoFormat("[MIGRATIONS] Upgrading {0} to latest revision {1}.", _type, migrations.Keys[migrations.Count - 1]);
m_log.Info("[MIGRATIONS] NOTE: this may take a while, don't interupt this process!");
using (DbCommand cmd = _conn.CreateCommand())
foreach (KeyValuePair<int, string[]> kvp in migrations)
{
foreach (KeyValuePair<int, string> kvp in migrations)
{
int newversion = kvp.Key;
cmd.CommandText = kvp.Value;
// we need to up the command timeout to infinite as we might be doing long migrations.
cmd.CommandTimeout = 0;
try
{
cmd.ExecuteNonQuery();
}
catch (Exception e)
{
m_log.DebugFormat("[MIGRATIONS] Cmd was {0}", cmd.CommandText);
m_log.DebugFormat("[MIGRATIONS]: An error has occurred in the migration {0}.\n This may mean you could see errors trying to run OpenSim. If you see database related errors, you will need to fix the issue manually. Continuing.", e.Message);
cmd.CommandText = "ROLLBACK;";
cmd.ExecuteNonQuery();
}
int newversion = kvp.Key;
// we need to up the command timeout to infinite as we might be doing long migrations.
if (version == 0)
{
InsertVersion(_type, newversion);
}
else
{
UpdateVersion(_type, newversion);
}
version = newversion;
/* [AlexRa 01-May-10]: We can't always just run any SQL in a single batch (= ExecuteNonQuery()). Things like
* stored proc definitions might have to be sent to the server each in a separate batch.
* This is certainly so for MS SQL; not sure how the MySQL connector sorts out the mess
* with 'delimiter @@'/'delimiter ;' around procs. So each "script" this code executes now is not
* a single string, but an array of strings, executed separately.
*/
try
{
ExecuteScript(kvp.Value);
}
catch (Exception e)
{
m_log.DebugFormat("[MIGRATIONS] Cmd was {0}", e.Message.Replace("\n", " "));
m_log.Debug("[MIGRATIONS]: An error has occurred in the migration. This may mean you could see errors trying to run OpenSim. If you see database related errors, you will need to fix the issue manually. Continuing.");
ExecuteScript("ROLLBACK;");
}
if (version == 0)
{
InsertVersion(_type, newversion);
}
else
{
UpdateVersion(_type, newversion);
}
version = newversion;
}
}
// private int MaxVersion()
// {
// int max = 0;
// string[] names = _assem.GetManifestResourceNames();
// foreach (string s in names)
// {
// Match m = _match.Match(s);
// if (m.Success)
// {
// int MigrationVersion = int.Parse(m.Groups[1].ToString());
// if (MigrationVersion > max)
// max = MigrationVersion;
// }
// }
// return max;
// }
public int Version
{
get { return FindVersion(_conn, _type); }
@ -206,7 +246,7 @@ namespace OpenSim.Data
try
{
cmd.CommandText = "select version from migrations where name='" + type + "' order by version desc";
using (IDataReader reader = cmd.ExecuteReader())
using (DbDataReader reader = cmd.ExecuteReader())
{
if (reader.Read())
{
@ -217,7 +257,8 @@ namespace OpenSim.Data
}
catch
{
// Something went wrong, so we're version 0
// Something went wrong (probably no table), so we're at version -1
version = -1;
}
}
return version;
@ -225,57 +266,151 @@ namespace OpenSim.Data
private void InsertVersion(string type, int version)
{
using (DbCommand cmd = _conn.CreateCommand())
{
cmd.CommandText = "insert into migrations(name, version) values('" + type + "', " + version + ")";
m_log.InfoFormat("[MIGRATIONS]: Creating {0} at version {1}", type, version);
cmd.ExecuteNonQuery();
}
m_log.InfoFormat("[MIGRATIONS]: Creating {0} at version {1}", type, version);
ExecuteScript("insert into migrations(name, version) values('" + type + "', " + version + ")");
}
private void UpdateVersion(string type, int version)
{
using (DbCommand cmd = _conn.CreateCommand())
{
cmd.CommandText = "update migrations set version=" + version + " where name='" + type + "'";
m_log.InfoFormat("[MIGRATIONS]: Updating {0} to version {1}", type, version);
cmd.ExecuteNonQuery();
}
m_log.InfoFormat("[MIGRATIONS]: Updating {0} to version {1}", type, version);
ExecuteScript("update migrations set version=" + version + " where name='" + type + "'");
}
// private SortedList<int, string> GetAllMigrations()
// {
// return GetMigrationsAfter(0);
// }
private delegate void FlushProc();
private SortedList<int, string> GetMigrationsAfter(int after)
/// <summary>Scans for migration resources in either old-style "scattered" (one file per version)
/// or new-style "integrated" format (single file with ":VERSION nnn" sections).
/// In the new-style migrations it also recognizes ':GO' separators for parts of the SQL script
/// that must be sent to the server separately. The old-style migrations are loaded each in one piece
/// and don't support the ':GO' feature.
/// </summary>
/// <param name="after">The version we are currently at. Scan for any higher versions</param>
/// <returns>A list of string arrays, representing the scripts.</returns>
private SortedList<int, string[]> GetMigrationsAfter(int after)
{
string[] names = _assem.GetManifestResourceNames();
SortedList<int, string> migrations = new SortedList<int, string>();
// because life is funny if we don't
Array.Sort(names);
SortedList<int, string[]> migrations = new SortedList<int, string[]>();
string[] names = _assem.GetManifestResourceNames();
if( names.Length == 0 ) // should never happen
return migrations;
Array.Sort(names); // we want all the migrations ordered
int nLastVerFound = 0;
Match m = null;
string sFile = Array.FindLast(names, nm => { m = _match_new.Match(nm); return m.Success; }); // ; nm.StartsWith(sPrefix, StringComparison.InvariantCultureIgnoreCase
if( (m != null) && !String.IsNullOrEmpty(sFile) )
{
/* The filename should be '<StoreName>.migrations[.NNN]' where NNN
* is the last version number defined in the file. If the '.NNN' part is recognized, the code can skip
* the file without looking inside if we have a higher version already. Without the suffix we read
* the file anyway and use the version numbers inside. Any unrecognized suffix (such as '.sql')
* is valid but ignored.
*
* NOTE that we expect only one 'merged' migration file. If there are several, we take the last one.
* If you are numbering them, leave only the latest one in the project or at least make sure they numbered
* to come up in the correct order (e.g. 'SomeStore.migrations.001' rather than 'SomeStore.migrations.1')
*/
if (m.Groups.Count > 1 && int.TryParse(m.Groups[1].Value, out nLastVerFound))
{
if( nLastVerFound <= after )
goto scan_old_style;
}
System.Text.StringBuilder sb = new System.Text.StringBuilder(4096);
int nVersion = -1;
List<string> script = new List<string>();
FlushProc flush = delegate()
{
if (sb.Length > 0) // last SQL stmt to script list
{
script.Add(sb.ToString());
sb.Length = 0;
}
if ( (nVersion > 0) && (nVersion > after) && (script.Count > 0) && !migrations.ContainsKey(nVersion)) // script to the versioned script list
{
migrations[nVersion] = script.ToArray();
}
script.Clear();
};
using (Stream resource = _assem.GetManifestResourceStream(sFile))
using (StreamReader resourceReader = new StreamReader(resource))
{
int nLineNo = 0;
while (!resourceReader.EndOfStream)
{
string sLine = resourceReader.ReadLine();
nLineNo++;
if( String.IsNullOrEmpty(sLine) || sLine.StartsWith("#") ) // ignore a comment or empty line
continue;
if (sLine.Trim().Equals(":GO", StringComparison.InvariantCultureIgnoreCase))
{
if (sb.Length == 0) continue;
if (nVersion > after)
script.Add(sb.ToString());
sb.Length = 0;
continue;
}
if (sLine.StartsWith(":VERSION ", StringComparison.InvariantCultureIgnoreCase)) // ":VERSION nnn"
{
flush();
int n = sLine.IndexOf('#'); // Comment is allowed in version sections, ignored
if (n >= 0)
sLine = sLine.Substring(0, n);
if (!int.TryParse(sLine.Substring(9).Trim(), out nVersion))
{
m_log.ErrorFormat("[MIGRATIONS]: invalid version marker at {0}: line {1}. Migration failed!", sFile, nLineNo);
break;
}
}
else
{
sb.AppendLine(sLine);
}
}
flush();
// If there are scattered migration files as well, only look for those with higher version numbers.
if (after < nVersion)
after = nVersion;
}
}
scan_old_style:
// scan "old style" migration pieces anyway, ignore any versions already filled from the single file
foreach (string s in names)
{
Match m = _match.Match(s);
m = _match_old.Match(s);
if (m.Success)
{
int version = int.Parse(m.Groups[1].ToString());
if (version > after)
if ( (version > after) && !migrations.ContainsKey(version) )
{
using (Stream resource = _assem.GetManifestResourceStream(s))
{
using (StreamReader resourceReader = new StreamReader(resource))
{
string resourceString = resourceReader.ReadToEnd();
migrations.Add(version, resourceString);
string sql = resourceReader.ReadToEnd();
migrations.Add(version, new string[]{sql});
}
}
}
}
}
if (migrations.Count < 1) {
if (migrations.Count < 1)
{
m_log.InfoFormat("[MIGRATIONS]: {0} up to date, no migrations to apply", _type);
}
return migrations;

View File

@ -33,6 +33,7 @@ using log4net;
using MySql.Data.MySqlClient;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Data;
namespace OpenSim.Data.MySQL
{
@ -111,7 +112,7 @@ namespace OpenSim.Data.MySQL
dbcon.Open();
using (MySqlCommand cmd = new MySqlCommand(
"SELECT name, description, assetType, local, temporary, asset_flags, data FROM assets WHERE id=?id",
"SELECT name, description, assetType, local, temporary, asset_flags, CreatorID, data FROM assets WHERE id=?id",
dbcon))
{
cmd.Parameters.AddWithValue("?id", assetID.ToString());
@ -122,7 +123,7 @@ namespace OpenSim.Data.MySQL
{
if (dbReader.Read())
{
asset = new AssetBase(assetID, (string)dbReader["name"], (sbyte)dbReader["assetType"], UUID.Zero.ToString());
asset = new AssetBase(assetID, (string)dbReader["name"], (sbyte)dbReader["assetType"], dbReader["CreatorID"].ToString());
asset.Data = (byte[])dbReader["data"];
asset.Description = (string)dbReader["description"];
@ -162,8 +163,8 @@ namespace OpenSim.Data.MySQL
MySqlCommand cmd =
new MySqlCommand(
"replace INTO assets(id, name, description, assetType, local, temporary, create_time, access_time, asset_flags, data)" +
"VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?asset_flags, ?data)",
"replace INTO assets(id, name, description, assetType, local, temporary, create_time, access_time, asset_flags, CreatorID, data)" +
"VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?asset_flags, ?CreatorID, ?data)",
dbcon);
string assetName = asset.Name;
@ -195,6 +196,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("?temporary", asset.Temporary);
cmd.Parameters.AddWithValue("?create_time", now);
cmd.Parameters.AddWithValue("?access_time", now);
cmd.Parameters.AddWithValue("?CreatorID", asset.Metadata.CreatorID);
cmd.Parameters.AddWithValue("?asset_flags", (int)asset.Flags);
cmd.Parameters.AddWithValue("?data", asset.Data);
cmd.ExecuteNonQuery();
@ -304,7 +306,7 @@ namespace OpenSim.Data.MySQL
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
MySqlCommand cmd = new MySqlCommand("SELECT name,description,assetType,temporary,id,asset_flags FROM assets LIMIT ?start, ?count", dbcon);
MySqlCommand cmd = new MySqlCommand("SELECT name,description,assetType,temporary,id,asset_flags,CreatorID FROM assets LIMIT ?start, ?count", dbcon);
cmd.Parameters.AddWithValue("?start", start);
cmd.Parameters.AddWithValue("?count", count);
@ -320,7 +322,8 @@ namespace OpenSim.Data.MySQL
metadata.Type = (sbyte)dbReader["assetType"];
metadata.Temporary = Convert.ToBoolean(dbReader["temporary"]); // Not sure if this is correct.
metadata.Flags = (AssetFlags)Convert.ToInt32(dbReader["asset_flags"]);
metadata.FullID = new UUID((string)dbReader["id"]);
metadata.FullID = DBGuid.FromDB(dbReader["id"]);
metadata.CreatorID = dbReader["CreatorID"].ToString();
// Current SHA1s are not stored/computed.
metadata.SHA1 = new byte[] { };

View File

@ -34,6 +34,7 @@ using MySql.Data.MySqlClient;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Data;
namespace OpenSim.Data.MySQL
{
@ -156,20 +157,13 @@ namespace OpenSim.Data.MySQL
foreach (string name in FieldList)
{
if (m_FieldMap[name].GetValue(es) is bool)
if (m_FieldMap[name].FieldType == typeof(bool))
{
int v = Convert.ToInt32(r[name]);
if (v != 0)
m_FieldMap[name].SetValue(es, true);
else
m_FieldMap[name].SetValue(es, false);
m_FieldMap[name].SetValue(es, Convert.ToInt32(r[name]) != 0);
}
else if (m_FieldMap[name].GetValue(es) is UUID)
else if (m_FieldMap[name].FieldType == typeof(UUID))
{
UUID uuid = UUID.Zero;
UUID.TryParse(r[name].ToString(), out uuid);
m_FieldMap[name].SetValue(es, uuid);
m_FieldMap[name].SetValue(es, DBGuid.FromDB(r[name]));
}
else
{
@ -385,11 +379,7 @@ namespace OpenSim.Data.MySQL
while (r.Read())
{
// EstateBan eb = new EstateBan();
UUID uuid = new UUID();
UUID.TryParse(r["uuid"].ToString(), out uuid);
uuids.Add(uuid);
uuids.Add(DBGuid.FromDB(r["uuid"]));
}
}
}
@ -490,7 +480,7 @@ namespace OpenSim.Data.MySQL
using (IDataReader reader = cmd.ExecuteReader())
{
while(reader.Read())
result.Add(new UUID(reader["RegionID"].ToString()));
result.Add(DBGuid.FromDB(reader["RegionID"]));
reader.Close();
}
}

View File

@ -148,19 +148,16 @@ namespace OpenSim.Data.MySQL
foreach (string name in m_Fields.Keys)
{
if (m_Fields[name].GetValue(row) is bool)
if (m_Fields[name].FieldType == typeof(bool))
{
int v = Convert.ToInt32(reader[name]);
m_Fields[name].SetValue(row, v != 0 ? true : false);
}
else if (m_Fields[name].GetValue(row) is UUID)
else if (m_Fields[name].FieldType == typeof(UUID))
{
UUID uuid = UUID.Zero;
UUID.TryParse(reader[name].ToString(), out uuid);
m_Fields[name].SetValue(row, uuid);
m_Fields[name].SetValue(row, DBGuid.FromDB(reader[name]));
}
else if (m_Fields[name].GetValue(row) is int)
else if (m_Fields[name].FieldType == typeof(int))
{
int v = Convert.ToInt32(reader[name]);
m_Fields[name].SetValue(row, v);

View File

@ -32,6 +32,7 @@ using log4net;
using MySql.Data.MySqlClient;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Data;
namespace OpenSim.Data.MySQL
{
@ -285,31 +286,23 @@ namespace OpenSim.Data.MySQL
InventoryItemBase item = new InventoryItemBase();
// TODO: this is to handle a case where NULLs creep in there, which we are not sure is endemic to the system, or legacy. It would be nice to live fix these.
if (reader["creatorID"] == null)
{
item.CreatorId = UUID.Zero.ToString();
}
else
{
item.CreatorId = (string)reader["creatorID"];
}
// ( DBGuid.FromDB() reads db NULLs as well, returns UUID.Zero )
item.CreatorId = reader["creatorID"].ToString();
// Be a bit safer in parsing these because the
// database doesn't enforce them to be not null, and
// the inventory still works if these are weird in the
// db
UUID Owner = UUID.Zero;
UUID GroupID = UUID.Zero;
UUID.TryParse((string)reader["avatarID"], out Owner);
UUID.TryParse((string)reader["groupID"], out GroupID);
item.Owner = Owner;
item.GroupID = GroupID;
// (Empty is Ok, but "weird" will throw!)
item.Owner = DBGuid.FromDB(reader["avatarID"]);
item.GroupID = DBGuid.FromDB(reader["groupID"]);
// Rest of the parsing. If these UUID's fail, we're dead anyway
item.ID = new UUID((string) reader["inventoryID"]);
item.AssetID = new UUID((string) reader["assetID"]);
item.ID = DBGuid.FromDB(reader["inventoryID"]);
item.AssetID = DBGuid.FromDB(reader["assetID"]);
item.AssetType = (int) reader["assetType"];
item.Folder = new UUID((string) reader["parentFolderID"]);
item.Folder = DBGuid.FromDB(reader["parentFolderID"]);
item.Name = (string)(reader["inventoryName"] ?? String.Empty);
item.Description = (string)(reader["inventoryDescription"] ?? String.Empty);
item.NextPermissions = (uint) reader["inventoryNextPermissions"];
@ -382,9 +375,9 @@ namespace OpenSim.Data.MySQL
try
{
InventoryFolderBase folder = new InventoryFolderBase();
folder.Owner = new UUID((string) reader["agentID"]);
folder.ParentID = new UUID((string) reader["parentFolderID"]);
folder.ID = new UUID((string) reader["folderID"]);
folder.Owner = DBGuid.FromDB(reader["agentID"]);
folder.ParentID = DBGuid.FromDB(reader["parentFolderID"]);
folder.ID = DBGuid.FromDB(reader["folderID"]);
folder.Name = (string) reader["folderName"];
folder.Type = (short) reader["type"];
folder.Version = (ushort) ((int) reader["version"]);

View File

@ -38,6 +38,7 @@ using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Data;
namespace OpenSim.Data.MySQL
{
@ -269,7 +270,7 @@ namespace OpenSim.Data.MySQL
using (IDataReader reader = ExecuteReader(cmd))
{
while (reader.Read())
uuids.Add(new UUID(reader["UUID"].ToString()));
uuids.Add(DBGuid.FromDB(reader["UUID"].ToString()));
}
// delete the main prims
@ -422,7 +423,7 @@ namespace OpenSim.Data.MySQL
else
prim.Shape = BuildShape(reader);
UUID parentID = new UUID(reader["SceneGroupID"].ToString());
UUID parentID = DBGuid.FromDB(reader["SceneGroupID"].ToString());
if (parentID != prim.UUID)
prim.ParentUUID = parentID;
@ -500,7 +501,7 @@ namespace OpenSim.Data.MySQL
{
if (!(itemReader["primID"] is DBNull))
{
UUID primID = new UUID(itemReader["primID"].ToString());
UUID primID = DBGuid.FromDB(itemReader["primID"].ToString());
if (prims.ContainsKey(primID))
primsWithInventory.Add(prims[primID]);
}
@ -738,7 +739,7 @@ namespace OpenSim.Data.MySQL
}
else
{
UUID.TryParse(result["region_id"].ToString(), out nWP.regionID);
nWP.regionID = DBGuid.FromDB(result["region_id"]);
nWP.waterColor.X = Convert.ToSingle(result["water_color_r"]);
nWP.waterColor.Y = Convert.ToSingle(result["water_color_g"]);
nWP.waterColor.Z = Convert.ToSingle(result["water_color_b"]);
@ -1055,7 +1056,14 @@ namespace OpenSim.Data.MySQL
private SceneObjectPart BuildPrim(IDataReader row)
{
SceneObjectPart prim = new SceneObjectPart();
prim.UUID = new UUID((string)row["UUID"]);
// depending on the MySQL connector version, CHAR(36) may be already converted to Guid!
prim.UUID = DBGuid.FromDB(row["UUID"]);
prim.CreatorID = DBGuid.FromDB(row["CreatorID"]);
prim.OwnerID = DBGuid.FromDB(row["OwnerID"]);
prim.GroupID = DBGuid.FromDB(row["GroupID"]);
prim.LastOwnerID = DBGuid.FromDB(row["LastOwnerID"]);
// explicit conversion of integers is required, which sort
// of sucks. No idea if there is a shortcut here or not.
prim.CreationDate = (int)row["CreationDate"];
@ -1074,15 +1082,12 @@ namespace OpenSim.Data.MySQL
prim.TouchName = (string)row["TouchName"];
// Permissions
prim.ObjectFlags = (uint)(int)row["ObjectFlags"];
prim.CreatorID = new UUID((string)row["CreatorID"]);
prim.OwnerID = new UUID((string)row["OwnerID"]);
prim.GroupID = new UUID((string)row["GroupID"]);
prim.LastOwnerID = new UUID((string)row["LastOwnerID"]);
prim.OwnerMask = (uint)(int)row["OwnerMask"];
prim.NextOwnerMask = (uint)(int)row["NextOwnerMask"];
prim.GroupMask = (uint)(int)row["GroupMask"];
prim.EveryoneMask = (uint)(int)row["EveryoneMask"];
prim.BaseMask = (uint)(int)row["BaseMask"];
// Vectors
prim.OffsetPosition = new Vector3(
(float)(double)row["PositionX"],
@ -1134,7 +1139,7 @@ namespace OpenSim.Data.MySQL
prim.PayPrice[3] = (int)row["PayButton3"];
prim.PayPrice[4] = (int)row["PayButton4"];
prim.Sound = new UUID(row["LoopedSound"].ToString());
prim.Sound = DBGuid.FromDB(row["LoopedSound"].ToString());
prim.SoundGain = (float)(double)row["LoopedSoundGain"];
prim.SoundFlags = 1; // If it's persisted at all, it's looped
@ -1161,16 +1166,10 @@ namespace OpenSim.Data.MySQL
(float)(double)row["CameraAtOffsetZ"]
));
if ((sbyte)row["ForceMouselook"] != 0)
prim.SetForceMouselook(true);
prim.SetForceMouselook((sbyte)row["ForceMouselook"] != 0);
prim.ScriptAccessPin = (int)row["ScriptAccessPin"];
if ((sbyte)row["AllowedDrop"] != 0)
prim.AllowedDrop = true;
if ((sbyte)row["DieAtEdge"] != 0)
prim.DIE_AT_EDGE = true;
prim.AllowedDrop = ((sbyte)row["AllowedDrop"] != 0);
prim.DIE_AT_EDGE = ((sbyte)row["DieAtEdge"] != 0);
prim.SalePrice = (int)row["SalePrice"];
prim.ObjectSaleType = unchecked((byte)(sbyte)row["SaleType"]);
@ -1180,11 +1179,10 @@ namespace OpenSim.Data.MySQL
if (!(row["ClickAction"] is DBNull))
prim.ClickAction = unchecked((byte)(sbyte)row["ClickAction"]);
prim.CollisionSound = new UUID(row["CollisionSound"].ToString());
prim.CollisionSound = DBGuid.FromDB(row["CollisionSound"]);
prim.CollisionSoundVolume = (float)(double)row["CollisionSoundVolume"];
if ((sbyte)row["PassTouches"] != 0)
prim.PassTouches = true;
prim.PassTouches = ((sbyte)row["PassTouches"] != 0);
prim.LinkNum = (int)row["LinkNumber"];
return prim;
@ -1200,10 +1198,10 @@ namespace OpenSim.Data.MySQL
{
TaskInventoryItem taskItem = new TaskInventoryItem();
taskItem.ItemID = new UUID((String)row["itemID"]);
taskItem.ParentPartID = new UUID((String)row["primID"]);
taskItem.AssetID = new UUID((String)row["assetID"]);
taskItem.ParentID = new UUID((String)row["parentFolderID"]);
taskItem.ItemID = DBGuid.FromDB(row["itemID"]);
taskItem.ParentPartID = DBGuid.FromDB(row["primID"]);
taskItem.AssetID = DBGuid.FromDB(row["assetID"]);
taskItem.ParentID = DBGuid.FromDB(row["parentFolderID"]);
taskItem.InvType = Convert.ToInt32(row["invType"]);
taskItem.Type = Convert.ToInt32(row["assetType"]);
@ -1211,10 +1209,10 @@ namespace OpenSim.Data.MySQL
taskItem.Name = (String)row["name"];
taskItem.Description = (String)row["description"];
taskItem.CreationDate = Convert.ToUInt32(row["creationDate"]);
taskItem.CreatorID = new UUID((String)row["creatorID"]);
taskItem.OwnerID = new UUID((String)row["ownerID"]);
taskItem.LastOwnerID = new UUID((String)row["lastOwnerID"]);
taskItem.GroupID = new UUID((String)row["groupID"]);
taskItem.CreatorID = DBGuid.FromDB(row["creatorID"]);
taskItem.OwnerID = DBGuid.FromDB(row["ownerID"]);
taskItem.LastOwnerID = DBGuid.FromDB(row["lastOwnerID"]);
taskItem.GroupID = DBGuid.FromDB(row["groupID"]);
taskItem.NextPermissions = Convert.ToUInt32(row["nextPermissions"]);
taskItem.CurrentPermissions = Convert.ToUInt32(row["currentPermissions"]);
@ -1230,7 +1228,7 @@ namespace OpenSim.Data.MySQL
{
RegionSettings newSettings = new RegionSettings();
newSettings.RegionUUID = new UUID((string) row["regionUUID"]);
newSettings.RegionUUID = DBGuid.FromDB(row["regionUUID"]);
newSettings.BlockTerraform = Convert.ToBoolean(row["block_terraform"]);
newSettings.AllowDamage = Convert.ToBoolean(row["allow_damage"]);
newSettings.BlockFly = Convert.ToBoolean(row["block_fly"]);
@ -1244,10 +1242,10 @@ namespace OpenSim.Data.MySQL
newSettings.DisableScripts = Convert.ToBoolean(row["disable_scripts"]);
newSettings.DisableCollisions = Convert.ToBoolean(row["disable_collisions"]);
newSettings.DisablePhysics = Convert.ToBoolean(row["disable_physics"]);
newSettings.TerrainTexture1 = new UUID((String) row["terrain_texture_1"]);
newSettings.TerrainTexture2 = new UUID((String) row["terrain_texture_2"]);
newSettings.TerrainTexture3 = new UUID((String) row["terrain_texture_3"]);
newSettings.TerrainTexture4 = new UUID((String) row["terrain_texture_4"]);
newSettings.TerrainTexture1 = DBGuid.FromDB(row["terrain_texture_1"]);
newSettings.TerrainTexture2 = DBGuid.FromDB(row["terrain_texture_2"]);
newSettings.TerrainTexture3 = DBGuid.FromDB(row["terrain_texture_3"]);
newSettings.TerrainTexture4 = DBGuid.FromDB(row["terrain_texture_4"]);
newSettings.Elevation1NW = Convert.ToDouble(row["elevation_1_nw"]);
newSettings.Elevation2NW = Convert.ToDouble(row["elevation_2_nw"]);
newSettings.Elevation1NE = Convert.ToDouble(row["elevation_1_ne"]);
@ -1268,7 +1266,7 @@ namespace OpenSim.Data.MySQL
);
newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]);
newSettings.SunPosition = Convert.ToDouble(row["sun_position"]);
newSettings.Covenant = new UUID((String) row["covenant"]);
newSettings.Covenant = DBGuid.FromDB(row["covenant"]);
newSettings.LoadedCreationDateTime = Convert.ToInt32(row["loaded_creation_datetime"]);
@ -1277,7 +1275,7 @@ namespace OpenSim.Data.MySQL
else
newSettings.LoadedCreationID = (String) row["loaded_creation_id"];
newSettings.TerrainImageID = new UUID((String)row["map_tile_ID"]);
newSettings.TerrainImageID = DBGuid.FromDB(row["map_tile_ID"]);
return newSettings;
}
@ -1291,7 +1289,7 @@ namespace OpenSim.Data.MySQL
{
LandData newData = new LandData();
newData.GlobalID = new UUID((String) row["UUID"]);
newData.GlobalID = DBGuid.FromDB(row["UUID"]);
newData.LocalID = Convert.ToInt32(row["LocalLandID"]);
// Bitmap is a byte[512]
@ -1299,7 +1297,7 @@ namespace OpenSim.Data.MySQL
newData.Name = (String) row["Name"];
newData.Description = (String) row["Description"];
newData.OwnerID = new UUID((String)row["OwnerUUID"]);
newData.OwnerID = DBGuid.FromDB(row["OwnerUUID"]);
newData.IsGroupOwned = Convert.ToBoolean(row["IsGroupOwned"]);
newData.Area = Convert.ToInt32(row["Area"]);
newData.AuctionID = Convert.ToUInt32(row["AuctionID"]); //Unimplemented
@ -1307,14 +1305,14 @@ namespace OpenSim.Data.MySQL
//Enum libsecondlife.Parcel.ParcelCategory
newData.ClaimDate = Convert.ToInt32(row["ClaimDate"]);
newData.ClaimPrice = Convert.ToInt32(row["ClaimPrice"]);
newData.GroupID = new UUID((String) row["GroupUUID"]);
newData.GroupID = DBGuid.FromDB(row["GroupUUID"]);
newData.SalePrice = Convert.ToInt32(row["SalePrice"]);
newData.Status = (ParcelStatus) Convert.ToInt32(row["LandStatus"]);
//Enum. libsecondlife.Parcel.ParcelStatus
newData.Flags = Convert.ToUInt32(row["LandFlags"]);
newData.LandingType = Convert.ToByte(row["LandingType"]);
newData.MediaAutoScale = Convert.ToByte(row["MediaAutoScale"]);
newData.MediaID = new UUID((String) row["MediaTextureUUID"]);
newData.MediaID = DBGuid.FromDB(row["MediaTextureUUID"]);
newData.MediaURL = (String) row["MediaURL"];
newData.MusicURL = (String) row["MusicURL"];
newData.PassHours = Convert.ToSingle(row["PassHours"]);
@ -1358,7 +1356,7 @@ namespace OpenSim.Data.MySQL
private static ParcelManager.ParcelAccessEntry BuildLandAccessData(IDataReader row)
{
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = new UUID((string) row["AccessUUID"]);
entry.AgentID = DBGuid.FromDB(row["AccessUUID"]);
entry.Flags = (AccessList) Convert.ToInt32(row["Flags"]);
entry.Time = new DateTime();
return entry;

View File

@ -0,0 +1,83 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.IO;
using System.Reflection;
using System.Text.RegularExpressions;
using log4net;
using MySql.Data.MySqlClient;
namespace OpenSim.Data.MySQL
{
/// <summary>This is a MySQL-customized migration processor. The only difference is in how
/// it executes SQL scripts (using MySqlScript instead of MyCommand)
///
/// </summary>
public class MySqlMigration : Migration
{
public MySqlMigration()
: base()
{
}
public MySqlMigration(DbConnection conn, Assembly assem, string subtype, string type) :
base(conn, assem, subtype, type)
{
}
public MySqlMigration(DbConnection conn, Assembly assem, string type) :
base(conn, assem, type)
{
}
protected override void ExecuteScript(DbConnection conn, string[] script)
{
if (!(conn is MySqlConnection))
{
base.ExecuteScript(conn, script);
return;
}
MySqlScript scr = new MySqlScript((MySqlConnection)conn);
{
foreach (string sql in script)
{
scr.Query = sql;
scr.Error += delegate(object sender, MySqlScriptErrorEventArgs args)
{
throw new Exception(sql);
};
scr.Execute();
}
}
}
}
}

View File

@ -31,6 +31,7 @@ using System.Collections.Generic;
using System.Data;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Data;
using MySql.Data.MySqlClient;
namespace OpenSim.Data.MySQL
@ -143,12 +144,9 @@ namespace OpenSim.Data.MySQL
RegionData ret = new RegionData();
ret.Data = new Dictionary<string, object>();
UUID regionID;
UUID.TryParse(result["uuid"].ToString(), out regionID);
ret.RegionID = regionID;
UUID scope;
UUID.TryParse(result["ScopeID"].ToString(), out scope);
ret.ScopeID = scope;
ret.RegionID = DBGuid.FromDB(result["uuid"]);
ret.ScopeID = DBGuid.FromDB(result["ScopeID"]);
ret.RegionName = result["regionName"].ToString();
ret.posX = Convert.ToInt32(result["locX"]);
ret.posY = Convert.ToInt32(result["locY"]);

View File

@ -1,15 +0,0 @@
BEGIN;
CREATE TABLE `assets` (
`id` binary(16) NOT NULL,
`name` varchar(64) NOT NULL,
`description` varchar(64) NOT NULL,
`assetType` tinyint(4) NOT NULL,
`invType` tinyint(4) NOT NULL,
`local` tinyint(1) NOT NULL,
`temporary` tinyint(1) NOT NULL,
`data` longblob NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1';
COMMIT;

View File

@ -1,5 +0,0 @@
BEGIN;
CREATE TABLE Avatars (PrincipalID CHAR(36) NOT NULL, Name VARCHAR(32) NOT NULL, Value VARCHAR(255) NOT NULL DEFAULT '', PRIMARY KEY(PrincipalID, Name), KEY(PrincipalID));
COMMIT;

View File

@ -1,9 +0,0 @@
BEGIN;
CREATE TABLE `Friends` (
`PrincipalID` CHAR(36) NOT NULL,
`FriendID` VARCHAR(255) NOT NULL,
`Flags` CHAR(16) NOT NULL DEFAULT '0'
) ENGINE=InnoDB;
COMMIT;

View File

@ -1,5 +0,0 @@
BEGIN;
CREATE TABLE `Friends` (`PrincipalID` CHAR(36) NOT NULL, `Friend` VARCHAR(255) NOT NULL, `Flags` VARCHAR(16) NOT NULL DEFAULT 0, `Offered` VARCHAR(32) NOT NULL DEFAULT 0, PRIMARY KEY(`PrincipalID`, `Friend`), KEY(`PrincipalID`));
COMMIT;

View File

@ -1,40 +0,0 @@
BEGIN;
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 (`folderID`),
KEY `owner` (`agentID`),
KEY `parent` (`parentFolderID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `inventoryitems` (
`inventoryID` varchar(36) NOT NULL default '',
`assetID` varchar(36) default NULL,
`assetType` int(11) default NULL,
`parentFolderID` varchar(36) default NULL,
`avatarID` varchar(36) default NULL,
`inventoryName` varchar(64) default NULL,
`inventoryDescription` varchar(128) default NULL,
`inventoryNextPermissions` int(10) unsigned default NULL,
`inventoryCurrentPermissions` int(10) unsigned default NULL,
`invType` int(11) default NULL,
`creatorID` varchar(36) default NULL,
`inventoryBasePermissions` int(10) unsigned NOT NULL default 0,
`inventoryEveryOnePermissions` int(10) unsigned NOT NULL default 0,
`salePrice` int(11) NOT NULL default 0,
`saleType` tinyint(4) NOT NULL default 0,
`creationDate` int(11) NOT NULL default 0,
`groupID` varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000',
`groupOwned` tinyint(4) NOT NULL default 0,
`flags` int(11) unsigned NOT NULL default 0,
PRIMARY KEY (`inventoryID`),
KEY `owner` (`avatarID`),
KEY `folder` (`parentFolderID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
COMMIT;

View File

@ -1,154 +0,0 @@
BEGIN;
CREATE TABLE `prims` (
`UUID` varchar(255) NOT NULL,
`RegionUUID` varchar(255) default NULL,
`ParentID` int(11) default NULL,
`CreationDate` int(11) default NULL,
`Name` varchar(255) default NULL,
`SceneGroupID` varchar(255) default NULL,
`Text` varchar(255) default NULL,
`Description` varchar(255) default NULL,
`SitName` varchar(255) default NULL,
`TouchName` varchar(255) default NULL,
`ObjectFlags` int(11) default NULL,
`CreatorID` varchar(255) default NULL,
`OwnerID` varchar(255) default NULL,
`GroupID` varchar(255) default NULL,
`LastOwnerID` varchar(255) default NULL,
`OwnerMask` int(11) default NULL,
`NextOwnerMask` int(11) default NULL,
`GroupMask` int(11) default NULL,
`EveryoneMask` int(11) default NULL,
`BaseMask` int(11) default NULL,
`PositionX` float default NULL,
`PositionY` float default NULL,
`PositionZ` float default NULL,
`GroupPositionX` float default NULL,
`GroupPositionY` float default NULL,
`GroupPositionZ` float default NULL,
`VelocityX` float default NULL,
`VelocityY` float default NULL,
`VelocityZ` float default NULL,
`AngularVelocityX` float default NULL,
`AngularVelocityY` float default NULL,
`AngularVelocityZ` float default NULL,
`AccelerationX` float default NULL,
`AccelerationY` float default NULL,
`AccelerationZ` float default NULL,
`RotationX` float default NULL,
`RotationY` float default NULL,
`RotationZ` float default NULL,
`RotationW` float default NULL,
`SitTargetOffsetX` float default NULL,
`SitTargetOffsetY` float default NULL,
`SitTargetOffsetZ` float default NULL,
`SitTargetOrientW` float default NULL,
`SitTargetOrientX` float default NULL,
`SitTargetOrientY` float default NULL,
`SitTargetOrientZ` float default NULL,
PRIMARY KEY (`UUID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `primshapes` (
`UUID` varchar(255) NOT NULL,
`Shape` int(11) default NULL,
`ScaleX` float default NULL,
`ScaleY` float default NULL,
`ScaleZ` float default NULL,
`PCode` int(11) default NULL,
`PathBegin` int(11) default NULL,
`PathEnd` int(11) default NULL,
`PathScaleX` int(11) default NULL,
`PathScaleY` int(11) default NULL,
`PathShearX` int(11) default NULL,
`PathShearY` int(11) default NULL,
`PathSkew` int(11) default NULL,
`PathCurve` int(11) default NULL,
`PathRadiusOffset` int(11) default NULL,
`PathRevolutions` int(11) default NULL,
`PathTaperX` int(11) default NULL,
`PathTaperY` int(11) default NULL,
`PathTwist` int(11) default NULL,
`PathTwistBegin` int(11) default NULL,
`ProfileBegin` int(11) default NULL,
`ProfileEnd` int(11) default NULL,
`ProfileCurve` int(11) default NULL,
`ProfileHollow` int(11) default NULL,
`State` int(11) default NULL,
`Texture` longblob,
`ExtraParams` longblob,
PRIMARY KEY (`UUID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `primitems` (
`itemID` varchar(255) NOT NULL,
`primID` varchar(255) default NULL,
`assetID` varchar(255) default NULL,
`parentFolderID` varchar(255) default NULL,
`invType` int(11) default NULL,
`assetType` int(11) default NULL,
`name` varchar(255) default NULL,
`description` varchar(255) default NULL,
`creationDate` bigint(20) default NULL,
`creatorID` varchar(255) default NULL,
`ownerID` varchar(255) default NULL,
`lastOwnerID` varchar(255) default NULL,
`groupID` varchar(255) default NULL,
`nextPermissions` int(11) default NULL,
`currentPermissions` int(11) default NULL,
`basePermissions` int(11) default NULL,
`everyonePermissions` int(11) default NULL,
`groupPermissions` int(11) default NULL,
PRIMARY KEY (`itemID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `terrain` (
`RegionUUID` varchar(255) default NULL,
`Revision` int(11) default NULL,
`Heightfield` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `land` (
`UUID` varchar(255) NOT NULL,
`RegionUUID` varchar(255) default NULL,
`LocalLandID` int(11) default NULL,
`Bitmap` longblob,
`Name` varchar(255) default NULL,
`Description` varchar(255) default NULL,
`OwnerUUID` varchar(255) default NULL,
`IsGroupOwned` int(11) default NULL,
`Area` int(11) default NULL,
`AuctionID` int(11) default NULL,
`Category` int(11) default NULL,
`ClaimDate` int(11) default NULL,
`ClaimPrice` int(11) default NULL,
`GroupUUID` varchar(255) default NULL,
`SalePrice` int(11) default NULL,
`LandStatus` int(11) default NULL,
`LandFlags` int(11) default NULL,
`LandingType` int(11) default NULL,
`MediaAutoScale` int(11) default NULL,
`MediaTextureUUID` varchar(255) default NULL,
`MediaURL` varchar(255) default NULL,
`MusicURL` varchar(255) default NULL,
`PassHours` float default NULL,
`PassPrice` int(11) default NULL,
`SnapshotUUID` varchar(255) default NULL,
`UserLocationX` float default NULL,
`UserLocationY` float default NULL,
`UserLocationZ` float default NULL,
`UserLookAtX` float default NULL,
`UserLookAtY` float default NULL,
`UserLookAtZ` float default NULL,
`AuthbuyerID` varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000',
PRIMARY KEY (`UUID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `landaccesslist` (
`LandUUID` varchar(255) default NULL,
`AccessUUID` varchar(255) default NULL,
`Flags` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
COMMIT;

View File

@ -1,13 +0,0 @@
BEGIN;
CREATE TABLE `UserAccounts` (
`PrincipalID` CHAR(36) NOT NULL,
`ScopeID` CHAR(36) NOT NULL,
`FirstName` VARCHAR(64) NOT NULL,
`LastName` VARCHAR(64) NOT NULL,
`Email` VARCHAR(64),
`ServiceURLs` TEXT,
`Created` INT(11)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
COMMIT;

View File

@ -1,9 +0,0 @@
BEGIN;
ALTER TABLE assets change id oldid binary(16);
ALTER TABLE assets add id varchar(36) not null default '';
UPDATE assets set id = concat(substr(hex(oldid),1,8),"-",substr(hex(oldid),9,4),"-",substr(hex(oldid),13,4),"-",substr(hex(oldid),17,4),"-",substr(hex(oldid),21,12));
ALTER TABLE assets drop oldid;
ALTER TABLE assets add constraint primary key(id);
COMMIT;

View File

@ -1,5 +0,0 @@
BEGIN;
INSERT INTO auth (UUID, passwordHash, passwordSalt, webLoginKey) SELECT `UUID` AS UUID, `passwordHash` AS passwordHash, `passwordSalt` AS passwordSalt, `webLoginKey` AS webLoginKey FROM users;
COMMIT;

Some files were not shown because too many files have changed in this diff Show More