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/SQLiteDialect/001_RegionStore.sql | 60 +++++++++++++++++++--- .../Resources/SQLiteDialect/001_UserStore.sql | 39 ++++++++++++-- 2 files changed, 88 insertions(+), 11 deletions(-) (limited to 'OpenSim/Data/NHibernate/Resources/SQLiteDialect') 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; -- cgit v1.1