From 40f34aeffd64e2aa81cecb2e861f60d6e8886198 Mon Sep 17 00:00:00 2001
From: Charles Krinke
Date: Sun, 11 Jan 2009 18:24:16 +0000
Subject: Thank you kindly, Tlaukkan (Tommil) for a patch that: Fixed all
NHibernate unit tests by implementing missing persistency methods, tables,
columns and fixing bugs in the existing implementation. Two minor changes to
classes outside NHibernate module: Added Scene instantiation for
SceneObjectGroup in OpenSim.Data.Tests.BasicRegionTest as this was required
by the NHibernate persistency. In the process added also mock constructor to
Scene which only populates RegionInfo in the scene which is used by
ScenePart.RegionUUID. NHibernate module is still in experimental state and
has not been tested at opensim region or ugaim runtime configuration. Adding
unit tests to build is not yet advisable nor using NHibernate module in any
production setup.
---
.../Resources/MySQLDialect/001_RegionStore.sql | 80 ++++++++--------
.../Resources/MySQLDialect/001_UserStore.sql | 102 +++++++++++++--------
.../Resources/MySQLDialect/003_RegionStore.sql | 72 +++++++++++++--
.../NHibernate/Resources/RegionSettings.hbm.xml | 56 +++++++++++
.../Data/NHibernate/Resources/RegionStore.hbm.xml | 12 ++-
.../Resources/SQLiteDialect/001_RegionStore.sql | 60 ++++++++++--
.../Resources/SQLiteDialect/001_UserStore.sql | 39 +++++++-
.../NHibernate/Resources/UserAgentData.hbm.xml | 17 +++-
.../NHibernate/Resources/UserAppearance.hbm.xml | 1 +
.../Data/NHibernate/Resources/UserFriend.hbm.xml | 11 +++
.../NHibernate/Resources/UserProfileData.hbm.xml | 16 +++-
11 files changed, 360 insertions(+), 106 deletions(-)
create mode 100644 OpenSim/Data/NHibernate/Resources/RegionSettings.hbm.xml
create mode 100644 OpenSim/Data/NHibernate/Resources/UserFriend.hbm.xml
(limited to 'OpenSim/Data/NHibernate/Resources')
diff --git a/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_RegionStore.sql b/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_RegionStore.sql
index 99a5227..158ebb4 100644
--- a/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_RegionStore.sql
+++ b/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_RegionStore.sql
@@ -1,8 +1,15 @@
CREATE TABLE `Prims` (
+ `UUID` char(36) NOT NULL default '',
+ `RegionID` char(36) default NULL,
+ `GroupID` char(36) default NULL,
`ParentID` int(11) default NULL,
+ `ParentUUID` char(36) default NULL,
+ `OwnerID` char(36) default NULL,
+ `LastOwnerID` char(36) default NULL,
+ `CreatorID` char(36) default NULL,
`CreationDate` int(11) default NULL,
+ `LinkNum` int(11) default NULL,
`Name` varchar(255) default NULL,
- `ParentUUID` char(36) default NULL,
`Text` varchar(255) default NULL,
`Description` varchar(255) default NULL,
`SitName` varchar(255) default NULL,
@@ -13,43 +20,43 @@ CREATE TABLE `Prims` (
`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,
- `UUID` char(36) NOT NULL default '',
- `RegionID` char(36) default NULL,
- `CreatorID` char(36) default NULL,
- `OwnerID` char(36) default NULL,
- `GroupID` char(36) default NULL,
- `LastOwnerID` char(36) default NULL,
+ `Material` int(1) default NULL,
+ `ScriptAccessPin` int(11) default NULL,
+ `TextureAnimation` blob,
+ `ParticleSystem` blob,
+ `ClickAction` int(1) default NULL,
+ `Color` int(11) default NULL,
+ `PositionX` double default NULL,
+ `PositionY` double default NULL,
+ `PositionZ` double default NULL,
+ `GroupPositionX` double default NULL,
+ `GroupPositionY` double default NULL,
+ `GroupPositionZ` double default NULL,
+ `VelocityX` double default NULL,
+ `VelocityY` double default NULL,
+ `VelocityZ` double default NULL,
+ `AngularVelocityX` double default NULL,
+ `AngularVelocityY` double default NULL,
+ `AngularVelocityZ` double default NULL,
+ `AccelerationX` double default NULL,
+ `AccelerationY` double default NULL,
+ `AccelerationZ` double default NULL,
+ `RotationX` double default NULL,
+ `RotationY` double default NULL,
+ `RotationZ` double default NULL,
+ `RotationW` double default NULL,
+ `SitTargetOffsetX` double default NULL,
+ `SitTargetOffsetY` double default NULL,
+ `SitTargetOffsetZ` double default NULL,
+ `SitTargetOrientW` double default NULL,
+ `SitTargetOrientX` double default NULL,
+ `SitTargetOrientY` double default NULL,
+ `SitTargetOrientZ` double default NULL,
-- this is the shape
`Shape` int(11) default NULL,
- `ScaleX` float default NULL,
- `ScaleY` float default NULL,
- `ScaleZ` float default NULL,
+ `ScaleX` double default NULL,
+ `ScaleY` double default NULL,
+ `ScaleZ` double default NULL,
`PCode` int(11) default NULL,
`PathBegin` int(11) default NULL,
`PathEnd` int(11) default NULL,
@@ -77,3 +84,4 @@ CREATE TABLE `Prims` (
KEY `prims_parentuuid` (`ParentUUID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
diff --git a/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_UserStore.sql b/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_UserStore.sql
index 5db5d29..a66f5b8 100644
--- a/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_UserStore.sql
+++ b/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_UserStore.sql
@@ -1,12 +1,12 @@
START TRANSACTION;
CREATE TABLE `UserAgents` (
- `ProfileID` varchar(255) NOT NULL,
+ `ProfileID` varchar(36) NOT NULL,
`AgentIP` varchar(24) default NULL,
`AgentPort` int(11) default NULL,
`AgentOnline` tinyint(1) default NULL,
- `SessionID` varchar(255) default NULL,
- `SecureSessionID` varchar(255) default NULL,
+ `SessionID` varchar(36) default NULL,
+ `SecureSessionID` varchar(36) default NULL,
`InitialRegion` varchar(255) default NULL,
`Region` varchar(255) default NULL,
`LoginTime` int(11) default NULL,
@@ -15,16 +15,21 @@ CREATE TABLE `UserAgents` (
`PositionX` float default NULL,
`PositionY` float default NULL,
`PositionZ` float default NULL,
+ `LookAtX` float default NULL,
+ `LookAtY` float default NULL,
+ `LookAtZ` float default NULL,
PRIMARY KEY (`ProfileID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `UserProfiles` (
- `ID` varchar(255) NOT NULL,
+ `ID` varchar(36) NOT NULL,
+ `WebLoginKey` varchar(36) default NULL,
`FirstName` varchar(32) default NULL,
`SurName` varchar(32) default NULL,
+ `Email` varchar(250) default NULL,
`PasswordHash` varchar(32) default NULL,
`PasswordSalt` varchar(32) default NULL,
- `WebLoginKey` varchar(255) default NULL,
+ `HomeRegionID` varchar(36) default NULL,
`HomeRegionX` int(11) default NULL,
`HomeRegionY` int(11) default NULL,
`HomeLocationX` float default NULL,
@@ -35,50 +40,67 @@ CREATE TABLE `UserProfiles` (
`HomeLookAtZ` float default NULL,
`Created` int(11) default NULL,
`LastLogin` int(11) default NULL,
- `RootInventoryFolderID` varchar(255) default NULL,
`UserInventoryURI` varchar(255) default NULL,
`UserAssetURI` varchar(255) default NULL,
- `Image` varchar(255) default NULL,
- `FirstLifeImage` varchar(255) default NULL,
- `AboutText` varchar(255) default NULL,
- `FirstLifeAboutText` varchar(255) default NULL,
+ `Image` varchar(36) default NULL,
+ `FirstLifeImage` varchar(36) default NULL,
+ `AboutText` text default NULL,
+ `FirstLifeAboutText` text default NULL,
+ `CanDoMask` int(11) default NULL,
+ `WantDoMask` int(11) default NULL,
+ `UserFlags` int(11) default NULL,
+ `GodLevel` int(11) default NULL,
+ `CustomType` varchar(32) default NULL,
+ `Partner` varchar(36) default NULL,
+ `RootInventoryFolderID` varchar(36) default NULL,
PRIMARY KEY (`ID`),
- KEY `user_surname` (`SurName`),
- KEY `user_firstname` (`FirstName`)
+ INDEX `UserSurnameIndex` (`SurName`),
+ INDEX `UserFirstNameIndex` (`FirstName`),
+ UNIQUE INDEX `UserFullNameIndex` (`SurName`,`FirstName`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `UserAppearances` (
- `Owner` varchar(255) NOT NULL,
- `BodyItem` varchar(255) default NULL,
- `BodyAsset` varchar(255) default NULL,
- `SkinItem` varchar(255) default NULL,
- `SkinAsset` varchar(255) default NULL,
- `HairItem` varchar(255) default NULL,
- `HairAsset` varchar(255) default NULL,
- `EyesItem` varchar(255) default NULL,
- `EyesAsset` varchar(255) default NULL,
- `ShirtItem` varchar(255) default NULL,
- `ShirtAsset` varchar(255) default NULL,
- `PantsItem` varchar(255) default NULL,
- `PantsAsset` varchar(255) default NULL,
- `ShoesItem` varchar(255) default NULL,
- `ShoesAsset` varchar(255) default NULL,
- `SocksItem` varchar(255) default NULL,
- `SocksAsset` varchar(255) default NULL,
- `JacketItem` varchar(255) default NULL,
- `JacketAsset` varchar(255) default NULL,
- `GlovesItem` varchar(255) default NULL,
- `GlovesAsset` varchar(255) default NULL,
- `UnderShirtItem` varchar(255) default NULL,
- `UnderShirtAsset` varchar(255) default NULL,
- `UnderPantsItem` varchar(255) default NULL,
- `UnderPantsAsset` varchar(255) default NULL,
- `SkirtItem` varchar(255) default NULL,
- `SkirtAsset` varchar(255) default NULL,
+ `Owner` varchar(36) NOT NULL,
+ `BodyItem` varchar(36) default NULL,
+ `BodyAsset` varchar(36) default NULL,
+ `SkinItem` varchar(36) default NULL,
+ `SkinAsset` varchar(36) default NULL,
+ `HairItem` varchar(36) default NULL,
+ `HairAsset` varchar(36) default NULL,
+ `EyesItem` varchar(36) default NULL,
+ `EyesAsset` varchar(36) default NULL,
+ `ShirtItem` varchar(36) default NULL,
+ `ShirtAsset` varchar(36) default NULL,
+ `PantsItem` varchar(36) default NULL,
+ `PantsAsset` varchar(36) default NULL,
+ `ShoesItem` varchar(36) default NULL,
+ `ShoesAsset` varchar(36) default NULL,
+ `SocksItem` varchar(36) default NULL,
+ `SocksAsset` varchar(36) default NULL,
+ `JacketItem` varchar(36) default NULL,
+ `JacketAsset` varchar(36) default NULL,
+ `GlovesItem` varchar(36) default NULL,
+ `GlovesAsset` varchar(36) default NULL,
+ `UnderShirtItem` varchar(36) default NULL,
+ `UnderShirtAsset` varchar(36) default NULL,
+ `UnderPantsItem` varchar(36) default NULL,
+ `UnderPantsAsset` varchar(36) default NULL,
+ `SkirtItem` varchar(36) default NULL,
+ `SkirtAsset` varchar(36) default NULL,
`Texture` longblob,
`VisualParams` longblob,
`Serial` int(11) default NULL,
+ `AvatarHeight` float default NULL,
PRIMARY KEY (`Owner`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-COMMIT;
\ No newline at end of file
+CREATE TABLE `UserFriends` (
+ `UserFriendID` VARCHAR(36) NOT NULL,
+ `OwnerID` VARCHAR(36) NOT NULL,
+ `FriendID` VARCHAR(36) NOT NULL,
+ `FriendPermissions` INT(11) NOT NULL,
+ PRIMARY KEY (`UserFriendID`),
+ UNIQUE INDEX (`OwnerID`,`FriendID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+COMMIT;
diff --git a/OpenSim/Data/NHibernate/Resources/MySQLDialect/003_RegionStore.sql b/OpenSim/Data/NHibernate/Resources/MySQLDialect/003_RegionStore.sql
index 230e93c..e30287b 100644
--- a/OpenSim/Data/NHibernate/Resources/MySQLDialect/003_RegionStore.sql
+++ b/OpenSim/Data/NHibernate/Resources/MySQLDialect/003_RegionStore.sql
@@ -1,26 +1,78 @@
BEGIN;
CREATE TABLE `PrimItems` (
+ `ItemID` char(36) NOT NULL default '',
+ `GroupID` char(36) default NULL,
+ `PrimID` char(36) default NULL,
+ `ParentFolderID` char(36) default NULL,
+ `AssetID` char(36) default NULL,
+ `OwnerID` char(36) default NULL,
+ `LastOwnerID` char(36) default NULL,
+ `CreatorID` char(36) default NULL,
+ `CreationDate` bigint(20) default NULL,
`InvType` int(11) default NULL,
`Name` varchar(255) default NULL,
`Description` varchar(255) default NULL,
- `CreationDate` bigint(20) 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,
`Flags` int(11) NOT NULL default '0',
- `ItemID` char(36) NOT NULL default '',
- `PrimID` char(36) default NULL,
- `AssetID` char(36) default NULL,
- `ParentFolderID` char(36) default NULL,
- `CreatorID` char(36) default NULL,
- `OwnerID` char(36) default NULL,
- `GroupID` char(36) default NULL,
- `LastOwnerID` char(36) default NULL,
PRIMARY KEY (`ItemID`),
KEY `primitems_primid` (`PrimID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-COMMIT;
\ No newline at end of file
+CREATE TABLE RegionSettings (
+ `RegionID` char(36) default NULL,
+
+ `BlockTerraform` bit(1) default NULL,
+ `BlockFly` bit(1) default NULL,
+ `AllowDamage` bit(1) default NULL,
+ `RestrictPushing` bit(1) default NULL,
+ `AllowLandResell` bit(1) default NULL,
+ `AllowLandJoinDivide` bit(1) default NULL,
+ `BlockShowInSearch` bit(1) default NULL,
+
+ `AgentLimit` int(11) default NULL,
+ `ObjectBonus` double default NULL,
+ `Maturity` int(11) default NULL,
+
+ `DisableScripts` bit(1) default NULL,
+ `DisableCollisions` bit(1) default NULL,
+ `DisablePhysics` bit(1) default NULL,
+
+ `TerrainTexture1` char(36) default NULL,
+ `TerrainTexture2` char(36) default NULL,
+ `TerrainTexture3` char(36) default NULL,
+ `TerrainTexture4` char(36) default NULL,
+
+ `Elevation1NW` double default NULL,
+ `Elevation2NW` double default NULL,
+ `Elevation1NE` double default NULL,
+ `Elevation2NE` double default NULL,
+ `Elevation1SE` double default NULL,
+ `Elevation2SE` double default NULL,
+ `Elevation1SW` double default NULL,
+ `Elevation2SW` double default NULL,
+
+ `WaterHeight` double default NULL,
+ `TerrainRaiseLimit` double default NULL,
+ `TerrainLowerLimit` double default NULL,
+
+ `UseEstateSun` bit(1) default NULL,
+ `Sandbox` bit(1) default NULL,
+
+ `SunVectorX` double default NULL,
+ `SunVectorY` double default NULL,
+ `SunVectorZ` double default NULL,
+
+ `FixedSun` bit(1) default NULL,
+ `SunPosition` double default NULL,
+
+ `Covenant` char(36) default NULL,
+
+ PRIMARY KEY (RegionID)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+COMMIT;
diff --git a/OpenSim/Data/NHibernate/Resources/RegionSettings.hbm.xml b/OpenSim/Data/NHibernate/Resources/RegionSettings.hbm.xml
new file mode 100644
index 0000000..5cfccba
--- /dev/null
+++ b/OpenSim/Data/NHibernate/Resources/RegionSettings.hbm.xml
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OpenSim/Data/NHibernate/Resources/RegionStore.hbm.xml b/OpenSim/Data/NHibernate/Resources/RegionStore.hbm.xml
index 1851904..3144b0b 100644
--- a/OpenSim/Data/NHibernate/Resources/RegionStore.hbm.xml
+++ b/OpenSim/Data/NHibernate/Resources/RegionStore.hbm.xml
@@ -13,12 +13,14 @@
-
+
+
-
+
+
@@ -26,6 +28,12 @@
+
+
+
+
+
+
diff --git a/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_RegionStore.sql b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_RegionStore.sql
index d557b9a..eaa0964 100644
--- a/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_RegionStore.sql
+++ b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_RegionStore.sql
@@ -2,25 +2,32 @@ BEGIN TRANSACTION;
create table Prims (
UUID TEXT not null,
+ RegionID TEXT,
+ GroupID TEXT,
ParentID INTEGER,
ParentUUID TEXT,
- RegionID TEXT,
+ OwnerID TEXT,
+ LastOwnerID TEXT,
+ CreatorID TEXT,
CreationDate INTEGER,
+ LinkNum INTEGER,
Name TEXT,
Text TEXT,
Description TEXT,
SitName TEXT,
TouchName TEXT,
ObjectFlags INTEGER,
- CreatorID TEXT,
- OwnerID TEXT,
- GroupID TEXT,
- LastOwnerID TEXT,
OwnerMask INTEGER,
NextOwnerMask INTEGER,
GroupMask INTEGER,
EveryoneMask INTEGER,
BaseMask INTEGER,
+ Material INTEGER,
+ ScriptAccessPin INTEGER,
+ TextureAnimation BLOB,
+ ParticleSystem BLOB,
+ ClickAction INTEGER,
+ Color INTEGER,
PositionX NUMERIC,
PositionY NUMERIC,
PositionZ NUMERIC,
@@ -99,4 +106,45 @@ create table PrimItems (
primary key (ItemID)
);
-COMMIT;
\ No newline at end of file
+CREATE TABLE RegionSettings (
+ RegionID TEXT not null,
+ BlockTerraform BIT,
+ BlockFly BIT,
+ AllowDamage BIT,
+ RestrictPushing BIT,
+ AllowLandResell BIT,
+ AllowLandJoinDivide BIT,
+ BlockShowInSearch BIT,
+ AgentLimit INTEGER,
+ ObjectBonus NUMERIC,
+ Maturity INTEGER,
+ DisableScripts BIT,
+ DisableCollisions BIT,
+ DisablePhysics BIT,
+ TerrainTexture1 TEXT,
+ TerrainTexture2 TEXT,
+ TerrainTexture3 TEXT,
+ TerrainTexture4 TEXT,
+ Elevation1NW NUMERIC,
+ Elevation2NW NUMERIC,
+ Elevation1NE NUMERIC,
+ Elevation2NE NUMERIC,
+ Elevation1SE NUMERIC,
+ Elevation2SE NUMERIC,
+ Elevation1SW NUMERIC,
+ Elevation2SW NUMERIC,
+ WaterHeight NUMERIC,
+ TerrainRaiseLimit NUMERIC,
+ TerrainLowerLimit NUMERIC,
+ UseEstateSun BIT,
+ Sandbox BIT,
+ SunVectorX NUMERIC,
+ SunVectorY NUMERIC,
+ SunVectorZ NUMERIC,
+ FixedSun BIT,
+ SunPosition NUMERIC,
+ Covenant TEXT,
+ primary key (RegionID)
+);
+
+COMMIT;
diff --git a/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_UserStore.sql b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_UserStore.sql
index 8d1ba5c..c5e42d5 100644
--- a/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_UserStore.sql
+++ b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_UserStore.sql
@@ -12,15 +12,24 @@ create table UserAgents (
LoginTime INTEGER,
LogoutTime INTEGER,
Handle INTEGER,
+ PositionX NUMERIC,
+ PositionY NUMERIC,
+ PositionZ NUMERIC,
+ LookAtX NUMERIC,
+ LookAtY NUMERIC,
+ LookAtZ NUMERIC,
primary key (ProfileID)
);
+
create table UserProfiles (
ID TEXT not null,
+ WebLoginKey TEXT,
FirstName TEXT,
SurName TEXT,
+ Email TEXT,
PasswordHash TEXT,
PasswordSalt TEXT,
- WebLoginKey TEXT,
+ HomeRegionID TEXT,
HomeRegionX INTEGER,
HomeRegionY INTEGER,
HomeLocationX NUMERIC,
@@ -31,15 +40,22 @@ create table UserProfiles (
HomeLookAtZ NUMERIC,
Created INTEGER,
LastLogin INTEGER,
- RootInventoryFolderID TEXT,
UserInventoryURI TEXT,
UserAssetURI TEXT,
Image TEXT,
FirstLifeImage TEXT,
AboutText TEXT,
FirstLifeAboutText TEXT,
+ RootInventoryFolderID TEXT,
+ `CanDoMask` INTEGER,
+ `WantDoMask` INTEGER,
+ `UserFlags` INTEGER,
+ `GodLevel` INTEGER,
+ `CustomType` TEXT,
+ `Partner` TEXT,
primary key (ID)
);
+
create table UserAppearances (
Owner TEXT not null,
BodyItem TEXT,
@@ -71,9 +87,22 @@ create table UserAppearances (
Texture BLOB,
VisualParams BLOB,
Serial INTEGER,
+ AvatarHeight NUMERIC,
primary key (Owner)
);
-create index user_firstname on UserProfiles (FirstName);
-create index user_surname on UserProfiles (SurName);
-COMMIT;
\ No newline at end of file
+
+CREATE TABLE UserFriends (
+ UserFriendID TEXT,
+ OwnerID TEXT,
+ FriendID TEXT,
+ FriendPermissions INTEGER,
+ primary key (UserFriendID)
+);
+
+create index UserFirstNameIndex on UserProfiles (FirstName);
+create index UserSurnameIndex on UserProfiles (SurName);
+create unique index UserFullNameIndex on UserProfiles (FirstName,SurName);
+create unique index UserFriendsOwnerFriendIndex on UserFriends (OwnerID,FriendID);
+
+COMMIT;
diff --git a/OpenSim/Data/NHibernate/Resources/UserAgentData.hbm.xml b/OpenSim/Data/NHibernate/Resources/UserAgentData.hbm.xml
index e10fb8f..70b6998 100644
--- a/OpenSim/Data/NHibernate/Resources/UserAgentData.hbm.xml
+++ b/OpenSim/Data/NHibernate/Resources/UserAgentData.hbm.xml
@@ -4,6 +4,7 @@
+
@@ -14,8 +15,18 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OpenSim/Data/NHibernate/Resources/UserAppearance.hbm.xml b/OpenSim/Data/NHibernate/Resources/UserAppearance.hbm.xml
index b633c34..21e547f 100644
--- a/OpenSim/Data/NHibernate/Resources/UserAppearance.hbm.xml
+++ b/OpenSim/Data/NHibernate/Resources/UserAppearance.hbm.xml
@@ -33,5 +33,6 @@
+
diff --git a/OpenSim/Data/NHibernate/Resources/UserFriend.hbm.xml b/OpenSim/Data/NHibernate/Resources/UserFriend.hbm.xml
new file mode 100644
index 0000000..70961b0
--- /dev/null
+++ b/OpenSim/Data/NHibernate/Resources/UserFriend.hbm.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OpenSim/Data/NHibernate/Resources/UserProfileData.hbm.xml b/OpenSim/Data/NHibernate/Resources/UserProfileData.hbm.xml
index 740a9f1..5b1f9b0 100644
--- a/OpenSim/Data/NHibernate/Resources/UserProfileData.hbm.xml
+++ b/OpenSim/Data/NHibernate/Resources/UserProfileData.hbm.xml
@@ -4,11 +4,13 @@
-
-
+
+
+
+
-
+
@@ -19,12 +21,18 @@
-
+
+
+
+
+
+
+
--
cgit v1.1