From ff8a76825841533bdc5d534b6f58b2ab964ea6c6 Mon Sep 17 00:00:00 2001 From: Fernando Oliveira Date: Sat, 12 Oct 2013 16:33:45 -0500 Subject: Fernando Oliveira's Postgress SQL Server Data Connector as a single commit. * Added PostGreSQL support * Added MySQL/MySQLXGroupData.cs * PostgreSQL data access implementation * PostgreSQL dll binarie and RegionStore.migrations * Migrations Scripts from MSSQL to POSTGRES * Postgres SQL Type fixes * Postgres SQL Connection string * Data type issues * more fixes * tests and +tests * UUID x string - FIGHT! * Fixed PG types to internal csharp types * More data type fix (PostgreSQL fields are case sensitive) :( * more field case sensitive fixes * changed the migration files to be case sensitive for fields. * fixed fields case * finished converting, now search for hidden bugs. * some more fixes * bool type fixed * more case fixes; * creatorID case fixed * case fields fixed * fixed default now() for TMStamp fields with don't allow nulls. * fix case sensitve for Region name and Estate name * fixed case for names for search * fix class name Error * Bug fixed on select and migrations * Un-Reverting my change due to Postgres issue with the ILIKE function * Fixed some issued for Diva Distro * Fixes for integration with Diva Distro * Added System.Core to prebuild.xml for PG project * Configured to make DIff for Push to OpenSim Project * Diffs only to PostgreSQL mods. --- OpenSim/Data/PGSQL/Resources/AssetStore.migrations | 94 ++ OpenSim/Data/PGSQL/Resources/AuthStore.migrations | 32 + OpenSim/Data/PGSQL/Resources/Avatar.migrations | 59 + .../Data/PGSQL/Resources/EstateStore.migrations | 307 ++++++ .../Data/PGSQL/Resources/FriendsStore.migrations | 44 + OpenSim/Data/PGSQL/Resources/GridStore.migrations | 242 +++++ .../Data/PGSQL/Resources/GridUserStore.migrations | 60 ++ .../Data/PGSQL/Resources/HGTravelStore.migrations | 17 + OpenSim/Data/PGSQL/Resources/IM_Store.migrations | 26 + .../Data/PGSQL/Resources/InventoryStore.migrations | 211 ++++ OpenSim/Data/PGSQL/Resources/LogStore.migrations | 16 + OpenSim/Data/PGSQL/Resources/Presence.migrations | 30 + .../Data/PGSQL/Resources/RegionStore.migrations | 1136 ++++++++++++++++++++ .../Data/PGSQL/Resources/UserAccount.migrations | 51 + .../Data/PGSQL/Resources/UserProfiles.migrations | 83 ++ OpenSim/Data/PGSQL/Resources/UserStore.migrations | 404 +++++++ .../Data/PGSQL/Resources/XAssetStore.migrations | 27 + .../PGSQL/Resources/os_groups_Store.migrations | 94 ++ 18 files changed, 2933 insertions(+) create mode 100644 OpenSim/Data/PGSQL/Resources/AssetStore.migrations create mode 100644 OpenSim/Data/PGSQL/Resources/AuthStore.migrations create mode 100644 OpenSim/Data/PGSQL/Resources/Avatar.migrations create mode 100644 OpenSim/Data/PGSQL/Resources/EstateStore.migrations create mode 100644 OpenSim/Data/PGSQL/Resources/FriendsStore.migrations create mode 100644 OpenSim/Data/PGSQL/Resources/GridStore.migrations create mode 100644 OpenSim/Data/PGSQL/Resources/GridUserStore.migrations create mode 100644 OpenSim/Data/PGSQL/Resources/HGTravelStore.migrations create mode 100644 OpenSim/Data/PGSQL/Resources/IM_Store.migrations create mode 100644 OpenSim/Data/PGSQL/Resources/InventoryStore.migrations create mode 100644 OpenSim/Data/PGSQL/Resources/LogStore.migrations create mode 100644 OpenSim/Data/PGSQL/Resources/Presence.migrations create mode 100644 OpenSim/Data/PGSQL/Resources/RegionStore.migrations create mode 100644 OpenSim/Data/PGSQL/Resources/UserAccount.migrations create mode 100644 OpenSim/Data/PGSQL/Resources/UserProfiles.migrations create mode 100644 OpenSim/Data/PGSQL/Resources/UserStore.migrations create mode 100644 OpenSim/Data/PGSQL/Resources/XAssetStore.migrations create mode 100644 OpenSim/Data/PGSQL/Resources/os_groups_Store.migrations (limited to 'OpenSim/Data/PGSQL/Resources') diff --git a/OpenSim/Data/PGSQL/Resources/AssetStore.migrations b/OpenSim/Data/PGSQL/Resources/AssetStore.migrations new file mode 100644 index 0000000..b6db585 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/AssetStore.migrations @@ -0,0 +1,94 @@ +:VERSION 1 + +CREATE TABLE assets ( + "id" varchar(36) NOT NULL PRIMARY KEY, + "name" varchar(64) NOT NULL, + "description" varchar(64) NOT NULL, + "assetType" smallint NOT NULL, + "local" smallint NOT NULL, + "temporary" smallint NOT NULL, + "data" bytea NOT NULL +) ; + +:VERSION 2 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_assets + ( + "id" varchar(36) NOT NULL, + "name" varchar(64) NOT NULL, + "description" varchar(64) NOT NULL, + "assetType" smallint NOT NULL, + "local" boolean NOT NULL, + "temporary" boolean NOT NULL, + "data" bytea NOT NULL + ) ; + +INSERT INTO Tmp_assets ("id", "name", "description", "assetType", "local", "temporary", "data") + SELECT "id", "name", "description", "assetType", case when "local" = 1 then true else false end, case when "temporary" = 1 then true else false end, "data" + FROM assets ; + +DROP TABLE assets; + +Alter table Tmp_assets + rename to assets; + +ALTER TABLE assets ADD PRIMARY KEY ("id"); + +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 Tmp_assets + ( + "id" uuid NOT NULL, + "name" varchar(64) NOT NULL, + "description" varchar(64) NOT NULL, + "assetType" smallint NOT NULL, + "local" boolean NOT NULL, + "temporary" boolean NOT NULL, + "data" bytea NOT NULL, + "create_time" int NULL, + "access_time" int NULL + ) ; + + +INSERT INTO Tmp_assets ("id", "name", "description", "assetType", "local", "temporary", "data", "create_time", "access_time") + SELECT cast("id" as uuid), "name", "description", "assetType", "local", "temporary", "data", "create_time", "access_time" + FROM assets ; + +DROP TABLE assets; + +Alter table Tmp_assets + rename to assets; + + ALTER TABLE assets ADD PRIMARY KEY ("id"); + +COMMIT; + + +:VERSION 5 + +DELETE FROM assets WHERE "id" = 'dc4b9f0b-d008-45c6-96a4-01dd947ac621'; + +:VERSION 6 + +ALTER TABLE assets ADD "asset_flags" INTEGER NOT NULL DEFAULT 0; + +:VERSION 7 + +alter table assets add "creatorid" varchar(36) not null default ''; diff --git a/OpenSim/Data/PGSQL/Resources/AuthStore.migrations b/OpenSim/Data/PGSQL/Resources/AuthStore.migrations new file mode 100644 index 0000000..a1f5b61 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/AuthStore.migrations @@ -0,0 +1,32 @@ +:VERSION 1 + +BEGIN TRANSACTION; + +CREATE TABLE auth ( + uuid uuid NOT NULL default '00000000-0000-0000-0000-000000000000', + "passwordHash" varchar(32) NOT NULL, + "passwordSalt" varchar(32) NOT NULL, + "webLoginKey" varchar(255) NOT NULL, + "accountType" VARCHAR(32) NOT NULL DEFAULT 'UserAccount' +) ; + +CREATE TABLE tokens ( + uuid uuid NOT NULL default '00000000-0000-0000-0000-000000000000', + token varchar(255) NOT NULL, + validity TIMESTAMP NOT NULL ) + ; + +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 + where exists ( Select * from information_schema.tables where table_name = 'users' ) + ; + +COMMIT; + diff --git a/OpenSim/Data/PGSQL/Resources/Avatar.migrations b/OpenSim/Data/PGSQL/Resources/Avatar.migrations new file mode 100644 index 0000000..160086d --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/Avatar.migrations @@ -0,0 +1,59 @@ +:VERSION 1 + +BEGIN TRANSACTION; + +CREATE TABLE Avatars ( +"PrincipalID" uuid NOT NULL PRIMARY KEY, +"Name" varchar(32) NOT NULL, +"Value" varchar(255) NOT NULL DEFAULT '' +); + + +COMMIT; + +:VERSION 2 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_Avatars + ( + "PrincipalID" uuid NOT NULL, + "Name" varchar(32) NOT NULL, + "Value" text NOT NULL DEFAULT '' + ) ; + + INSERT INTO Tmp_Avatars ("PrincipalID", "Name", "Value") + SELECT "PrincipalID", cast("Name" as text), "Value" + FROM Avatars ; + +DROP TABLE Avatars; + +Alter table Tmp_Avatars + rename to Avatars; + +COMMIT; + +:VERSION 3 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_Avatars + ( + "PrincipalID" uuid NOT NULL, + "Name" varchar(32) NOT NULL, + "Value" text NOT NULL DEFAULT '' +); + +ALTER TABLE Tmp_Avatars ADD PRIMARY KEY ("PrincipalID", "Name"); + + +INSERT INTO Tmp_Avatars ("PrincipalID", "Name", "Value") + SELECT "PrincipalID", "Name", cast("Value" as text) FROM Avatars ; + +DROP TABLE Avatars; + +Alter table Tmp_Avatars + rename to Avatars; + +COMMIT; + diff --git a/OpenSim/Data/PGSQL/Resources/EstateStore.migrations b/OpenSim/Data/PGSQL/Resources/EstateStore.migrations new file mode 100644 index 0000000..59270f8 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/EstateStore.migrations @@ -0,0 +1,307 @@ +:VERSION 1 + +BEGIN TRANSACTION; + +CREATE TABLE estate_managers( + "EstateID" int NOT NULL Primary Key, + uuid varchar(36) NOT NULL + ); + +CREATE TABLE estate_groups( + "EstateID" int NOT NULL, + uuid varchar(36) NOT NULL + ); + + +CREATE TABLE estate_users( + "EstateID" int NOT NULL, + uuid varchar(36) NOT NULL + ); + + +CREATE TABLE 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 + ); + +Create Sequence estate_settings_id increment by 100 start with 100; + +CREATE TABLE estate_settings( + "EstateID" integer DEFAULT nextval('estate_settings_id') NOT NULL, + "EstateName" varchar(64) NULL DEFAULT (NULL), + "AbuseEmailToEstateOwner" boolean NOT NULL, + "DenyAnonymous" boolean NOT NULL, + "ResetHomeOnTeleport" boolean NOT NULL, + "FixedSun" boolean NOT NULL, + "DenyTransacted" boolean NOT NULL, + "BlockDwell" boolean NOT NULL, + "DenyIdentified" boolean NOT NULL, + "AllowVoice" boolean NOT NULL, + "UseGlobalTime" boolean NOT NULL, + "PricePerMeter" int NOT NULL, + "TaxFree" boolean NOT NULL, + "AllowDirectTeleport" boolean NOT NULL, + "RedirectGridX" int NOT NULL, + "RedirectGridY" int NOT NULL, + "ParentEstateID" int NOT NULL, + "SunPosition" double precision NOT NULL, + "EstateSkipScripts" boolean NOT NULL, + "BillableFactor" double precision NOT NULL, + "PublicAccess" boolean NOT NULL, + "AbuseEmail" varchar(255) NOT NULL, + "EstateOwner" varchar(36) NOT NULL, + "DenyMinors" boolean NOT NULL + ); + + +CREATE TABLE estate_map( + "RegionID" varchar(36) NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'), + "EstateID" int NOT NULL + ); + +COMMIT; + +:VERSION 2 + +BEGIN TRANSACTION; + +CREATE INDEX IX_estate_managers ON estate_managers + ( + "EstateID" + ); + + +CREATE INDEX IX_estate_groups ON estate_groups + ( + "EstateID" + ); + + +CREATE INDEX IX_estate_users ON estate_users + ( + "EstateID" + ); + +COMMIT; + +:VERSION 3 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_estateban + ( + "EstateID" int NOT NULL, + "bannedUUID" varchar(36) NOT NULL, + "bannedIp" varchar(16) NULL, + "bannedIpHostMask" varchar(16) NULL, + "bannedNameMask" varchar(64) NULL + ); + + INSERT INTO Tmp_estateban ("EstateID", "bannedUUID", "bannedIp", "bannedIpHostMask", "bannedNameMask") + SELECT "EstateID", "bannedUUID", "bannedIp", "bannedIpHostMask", "bannedNameMask" FROM estateban; + +DROP TABLE estateban; + +Alter table Tmp_estateban + rename to estateban; + +CREATE INDEX IX_estateban ON estateban + ( + "EstateID" + ); + +COMMIT; + + +:VERSION 4 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_estate_managers + ( + "EstateID" int NOT NULL, + uuid uuid NOT NULL + ); + +INSERT INTO Tmp_estate_managers ("EstateID", uuid) + SELECT "EstateID", cast(uuid as uuid) FROM estate_managers; + +DROP TABLE estate_managers; + +Alter table Tmp_estate_managers + rename to estate_managers; + +CREATE INDEX IX_estate_managers ON estate_managers + ( + "EstateID" + ); + +COMMIT; + + +:VERSION 5 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_estate_groups + ( + "EstateID" int NOT NULL, + uuid uuid NOT NULL + ) ; + + INSERT INTO Tmp_estate_groups ("EstateID", uuid) + SELECT "EstateID", cast(uuid as uuid) FROM estate_groups; + +DROP TABLE estate_groups; + +Alter table Tmp_estate_groups + rename to estate_groups; + +CREATE INDEX IX_estate_groups ON estate_groups + ( + "EstateID" + ); + +COMMIT; + + +:VERSION 6 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_estate_users + ( + "EstateID" int NOT NULL, + uuid uuid NOT NULL + ); + +INSERT INTO Tmp_estate_users ("EstateID", uuid) + SELECT "EstateID", cast(uuid as uuid) FROM estate_users ; + +DROP TABLE estate_users; + +Alter table Tmp_estate_users + rename to estate_users; + +CREATE INDEX IX_estate_users ON estate_users + ( + "EstateID" + ); + +COMMIT; + + +:VERSION 7 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_estateban + ( + "EstateID" int NOT NULL, + "bannedUUID" uuid NOT NULL, + "bannedIp" varchar(16) NULL, + "bannedIpHostMask" varchar(16) NULL, + "bannedNameMask" varchar(64) NULL + ); + +INSERT INTO Tmp_estateban ("EstateID", "bannedUUID", "bannedIp", "bannedIpHostMask", "bannedNameMask") + SELECT "EstateID", cast("bannedUUID" as uuid), "bannedIp", "bannedIpHostMask", "bannedNameMask" FROM estateban ; + +DROP TABLE estateban; + +Alter table Tmp_estateban + rename to estateban; + +CREATE INDEX IX_estateban ON estateban + ( + "EstateID" + ); + +COMMIT; + + +:VERSION 8 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_estate_settings + ( + "EstateID" integer default nextval('estate_settings_id') NOT NULL, + "EstateName" varchar(64) NULL DEFAULT (NULL), + "AbuseEmailToEstateOwner" boolean NOT NULL, + "DenyAnonymous" boolean NOT NULL, + "ResetHomeOnTeleport" boolean NOT NULL, + "FixedSun" boolean NOT NULL, + "DenyTransacted" boolean NOT NULL, + "BlockDwell" boolean NOT NULL, + "DenyIdentified" boolean NOT NULL, + "AllowVoice" boolean NOT NULL, + "UseGlobalTime" boolean NOT NULL, + "PricePerMeter" int NOT NULL, + "TaxFree" boolean NOT NULL, + "AllowDirectTeleport" boolean NOT NULL, + "RedirectGridX" int NOT NULL, + "RedirectGridY" int NOT NULL, + "ParentEstateID" int NOT NULL, + "SunPosition" double precision NOT NULL, + "EstateSkipScripts" boolean NOT NULL, + "BillableFactor" double precision NOT NULL, + "PublicAccess" boolean NOT NULL, + "AbuseEmail" varchar(255) NOT NULL, + "EstateOwner" uuid NOT NULL, + "DenyMinors" boolean NOT NULL + ); + +INSERT INTO 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", cast("EstateOwner" as uuid), "DenyMinors" FROM estate_settings ; + +DROP TABLE estate_settings; + + +Alter table Tmp_estate_settings + rename to estate_settings; + + +Create index on estate_settings (lower("EstateName")); + +COMMIT; + + +:VERSION 9 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_estate_map + ( + "RegionID" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'), + "EstateID" int NOT NULL + ); + +INSERT INTO Tmp_estate_map ("RegionID", "EstateID") + SELECT cast("RegionID" as uuid), "EstateID" FROM estate_map ; + +DROP TABLE estate_map; + +Alter table Tmp_estate_map + rename to estate_map; + +COMMIT; + +:VERSION 10 + +BEGIN TRANSACTION; +ALTER TABLE estate_settings ADD COLUMN "AllowLandmark" boolean NOT NULL default true; +ALTER TABLE estate_settings ADD COLUMN "AllowParcelChanges" boolean NOT NULL default true; +ALTER TABLE estate_settings ADD COLUMN "AllowSetHome" boolean NOT NULL default true; +COMMIT; + +:VERSION 11 + +Begin transaction; + + +Commit; + diff --git a/OpenSim/Data/PGSQL/Resources/FriendsStore.migrations b/OpenSim/Data/PGSQL/Resources/FriendsStore.migrations new file mode 100644 index 0000000..a87199b --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/FriendsStore.migrations @@ -0,0 +1,44 @@ +:VERSION 1 + +BEGIN TRANSACTION; + +CREATE TABLE Friends ( +"PrincipalID" uuid NOT NULL, +"Friend" varchar(255) NOT NULL, +"Flags" char(16) NOT NULL DEFAULT '0', +"Offered" varchar(32) NOT NULL DEFAULT 0); + + +COMMIT; + +:VERSION 2 + +BEGIN TRANSACTION; + +INSERT INTO Friends ("PrincipalID", "Friend", "Flags", "Offered") +SELECT "ownerID", "friendID", "friendPerms", 0 FROM userfriends; + +COMMIT; + +:VERSION 3 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_Friends + ("PrincipalID" varchar(255) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000', + "Friend" varchar(255) NOT NULL, + "Flags" char(16) NOT NULL DEFAULT '0', + "Offered" varchar(32) NOT NULL DEFAULT 0) ; + +INSERT INTO Tmp_Friends ("PrincipalID", "Friend", "Flags", "Offered") + SELECT cast("PrincipalID" as varchar(255)), "Friend", "Flags", "Offered" FROM Friends ; + +DROP TABLE Friends; + +Alter table Tmp_Friends + rename to Friends; + +ALTER TABLE Friends ADD PRIMARY KEY("PrincipalID", "Friend"); + + +COMMIT; diff --git a/OpenSim/Data/PGSQL/Resources/GridStore.migrations b/OpenSim/Data/PGSQL/Resources/GridStore.migrations new file mode 100644 index 0000000..0ab8d2b --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/GridStore.migrations @@ -0,0 +1,242 @@ +:VERSION 1 + +BEGIN TRANSACTION; + +CREATE TABLE regions( + "regionHandle" varchar(255) NULL, + "regionName" varchar(255) NULL, + uuid varchar(255) NOT NULL PRIMARY KEY, + "regionRecvKey" varchar(255) NULL, + "regionSecret" varchar(255) NULL, + "regionSendKey" varchar(255) NULL, + "regionDataURI" varchar(255) NULL, + "serverIP" varchar(255) NULL, + "serverPort" varchar(255) NULL, + "serverURI" varchar(255) NULL, + "locX" varchar(255) NULL, + "locY" varchar(255) NULL, + "locZ" varchar(255) NULL, + "eastOverrideHandle" varchar(255) NULL, + "westOverrideHandle" varchar(255) NULL, + "southOverrideHandle" varchar(255) NULL, + "northOverrideHandle" varchar(255) NULL, + "regionAssetURI" varchar(255) NULL, + "regionAssetRecvKey" varchar(255) NULL, + "regionAssetSendKey" varchar(255) NULL, + "regionUserURI" varchar(255) NULL, + "regionUserRecvKey" varchar(255) NULL, + "regionUserSendKey" varchar(255) NULL, + "regionMapTexture" varchar(255) NULL, + "serverHttpPort" varchar(255) NULL, + "serverRemotingPort" varchar(255) NULL, + "owner_uuid" varchar(36) NULL +); + +COMMIT; + + +:VERSION 2 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_regions + ( + uuid varchar(36) 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') + ); + +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 cast(uuid as varchar(36)), cast("regionHandle" as bigint), cast("regionName" as varchar(20)), cast("regionRecvKey" as varchar(128)), cast("regionSendKey" as varchar(128)), cast("regionSecret" as varchar(128)), cast("regionDataURI" as varchar(128)), cast("serverIP" as varchar(64)), cast("serverPort" as int), "serverURI", cast("locX" as int), cast("locY" as int), cast("locZ" as int), cast("eastOverrideHandle" as bigint), cast("westOverrideHandle" as bigint), + cast("southOverrideHandle" as bigint), cast("northOverrideHandle" as bigint), "regionAssetURI", cast("regionAssetRecvKey" as varchar(128)), cast("regionAssetSendKey" as varchar(128)), "regionUserURI", cast("regionUserRecvKey" as varchar(128)), cast("regionUserSendKey" as varchar(128)), cast("regionMapTexture" as varchar(36)), + cast("serverHttpPort" as int), cast("serverRemotingPort" as int), "owner_uuid" + FROM regions; + +DROP TABLE regions; + +alter table Tmp_regions + rename to regions; + +COMMIT; + +:VERSION 3 + +BEGIN TRANSACTION; + +CREATE INDEX IX_regions_name ON regions + ( + "regionName" + ); + +CREATE INDEX IX_regions_handle ON regions + ( + "regionHandle" + ); + + +CREATE INDEX IX_regions_override ON regions + ( + "eastOverrideHandle", + "westOverrideHandle", + "southOverrideHandle", + "northOverrideHandle" + ); + +COMMIT; + + +:VERSION 4 + +/* To prevent any potential data loss issues, you should review this script in detail before running it outside the cotext of the database designer.*/ +BEGIN TRANSACTION; + +CREATE TABLE Tmp_regions + ( + uuid uuid 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" uuid NULL, + "serverHttpPort" int NULL, + "serverRemotingPort" int NULL, + "owner_uuid" uuid NOT NULL, + "originUUID" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000') + ); + + +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", "originUUID") + SELECT cast(uuid as uuid), "regionHandle", "regionName", "regionRecvKey", "regionSendKey", "regionSecret", "regionDataURI", "serverIP", "serverPort", "serverURI", "locX", "locY", "locZ", "eastOverrideHandle", "westOverrideHandle", "southOverrideHandle", "northOverrideHandle", "regionAssetURI", "regionAssetRecvKey", "regionAssetSendKey", "regionUserURI", "regionUserRecvKey", "regionUserSendKey", cast("regionMapTexture" as uuid), "serverHttpPort", "serverRemotingPort", cast( "owner_uuid" as uuid), cast("originUUID" as uuid) FROM regions ; + + +DROP TABLE regions; + +alter table Tmp_regions rename to regions; + +ALTER TABLE regions ADD CONSTRAINT + PK__regions__uuid PRIMARY KEY + ( + uuid + ); + +CREATE INDEX IX_regions_name ON regions + ( + "regionName" + ); + +CREATE INDEX IX_regions_handle ON regions + ( + "regionHandle" + ); + +CREATE INDEX IX_regions_override ON regions + ( + "eastOverrideHandle", + "westOverrideHandle", + "southOverrideHandle", + "northOverrideHandle" + ); + +COMMIT; + + +:VERSION 5 + +BEGIN TRANSACTION; + +ALTER TABLE regions ADD access int default 0; + +COMMIT; + + +:VERSION 6 + +BEGIN TRANSACTION; + +ALTER TABLE regions ADD "ScopeID" uuid default '00000000-0000-0000-0000-000000000000'; +ALTER TABLE regions alter column "owner_uuid" set DEFAULT ('00000000-0000-0000-0000-000000000000'); +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" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'; +ALTER TABLE regions ADD "Token" varchar(255) NOT NULL DEFAULT 0; + +COMMIT; + +:VERSION 8 + +BEGIN TRANSACTION; +ALTER TABLE regions ALTER COLUMN "regionName" type VarChar(128) ; + +DROP INDEX IX_regions_name; +ALTER TABLE regions ALTER COLUMN "regionName" type VarChar(128), + ALTER COLUMN "regionName" SET NOT NULL; + +CREATE INDEX IX_regions_name ON regions + ( + "regionName" + ); + +COMMIT; + +:VERSION 9 + +BEGIN TRANSACTION; + +ALTER TABLE regions ADD "parcelMapTexture" uuid NULL; + +COMMIT; + diff --git a/OpenSim/Data/PGSQL/Resources/GridUserStore.migrations b/OpenSim/Data/PGSQL/Resources/GridUserStore.migrations new file mode 100644 index 0000000..d37c4f6d --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/GridUserStore.migrations @@ -0,0 +1,60 @@ +:VERSION 1 # -------------------------- + +BEGIN TRANSACTION; + +CREATE TABLE GridUser ( + "UserID" VARCHAR(255) NOT NULL Primary Key, + "HomeRegionID" CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000', + "HomePosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>', + "HomeLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>', + "LastRegionID" CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000', + "LastPosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>', + "LastLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>', + "Online" CHAR(5) NOT NULL DEFAULT 'false', + "Login" CHAR(16) NOT NULL DEFAULT '0', + "Logout" CHAR(16) NOT NULL DEFAULT '0' +) ; + +COMMIT; + +:VERSION 2 # -------------------------- + +BEGIN TRANSACTION; + +CREATE TABLE GridUser_tmp ( + "UserID" VARCHAR(255) NOT NULL PRIMARY KEY, + "HomeRegionID" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000', + "HomePosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>', + "HomeLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>', + "LastRegionID" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000', + "LastPosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>', + "LastLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>', + "Online" CHAR(5) NOT NULL DEFAULT 'false', + "Login" CHAR(16) NOT NULL DEFAULT '0', + "Logout" CHAR(16) NOT NULL DEFAULT '0' + ); + +COMMIT; + + +INSERT INTO GridUser_tmp ("UserID" + ,"HomeRegionID" + ,"HomePosition" + ,"HomeLookAt" + ,"LastRegionID" + ,"LastPosition" + ,"LastLookAt" + ,"Online" + ,"Login" + ,"Logout") + SELECT "UserID", cast("HomeRegionID" as uuid), "HomePosition" ,"HomeLookAt" , cast("LastRegionID" as uuid), + "LastPosition" + ,"LastLookAt" + ,"Online" + ,"Login" + ,"Logout" FROM GridUser; + +DROP TABLE GridUser; + +alter table GridUser_tmp rename to GridUser; + diff --git a/OpenSim/Data/PGSQL/Resources/HGTravelStore.migrations b/OpenSim/Data/PGSQL/Resources/HGTravelStore.migrations new file mode 100644 index 0000000..adf126d --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/HGTravelStore.migrations @@ -0,0 +1,17 @@ +:VERSION 1 # -------------------------- + +BEGIN; + +CREATE TABLE hg_traveling_data ( + "SessionID" VARCHAR(36) NOT NULL Primary Key, + "UserID" VARCHAR(36) NOT NULL, + "GridExternalName" VARCHAR(255) NOT NULL DEFAULT '', + "ServiceToken" VARCHAR(255) NOT NULL DEFAULT '', + "ClientIPAddress" VARCHAR(16) NOT NULL DEFAULT '', + "MyIPAddress" VARCHAR(16) NOT NULL DEFAULT '', + "TMStamp" timestamp NOT NULL default now() +); + + +COMMIT; + diff --git a/OpenSim/Data/PGSQL/Resources/IM_Store.migrations b/OpenSim/Data/PGSQL/Resources/IM_Store.migrations new file mode 100644 index 0000000..70dc011 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/IM_Store.migrations @@ -0,0 +1,26 @@ +:VERSION 1 # -------------------------- + +BEGIN Transaction; + +Create Sequence im_offiline_id increment by 1 start with 1; + +CREATE TABLE im_offline ( + "ID" integer PRIMARY KEY NOT NULL DEFAULT nextval('im_offiline_id') , + "PrincipalID" char(36) NOT NULL default '', + "Message" text NOT NULL, + "TMStamp" timestamp NOT NULL default now() +); + +COMMIT; + +:VERSION 2 # -------------------------- + +BEGIN; + +/* +INSERT INTO `im_offline` SELECT * from `diva_im_offline`; +DROP TABLE `diva_im_offline`; +DELETE FROM `migrations` WHERE name='diva_im_Store'; +*/ + +COMMIT; diff --git a/OpenSim/Data/PGSQL/Resources/InventoryStore.migrations b/OpenSim/Data/PGSQL/Resources/InventoryStore.migrations new file mode 100644 index 0000000..b61e1f8 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/InventoryStore.migrations @@ -0,0 +1,211 @@ +:VERSION 1 + +BEGIN TRANSACTION; + +CREATE TABLE inventoryfolders ( + "folderID" varchar(36) NOT NULL default '' PRIMARY KEY, + "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 +); + + +CREATE INDEX owner ON inventoryfolders +( + "agentID" ASC +); + +CREATE INDEX parent ON inventoryfolders +( + "parentFolderID" ASC +); + + +CREATE TABLE inventoryitems ( + "inventoryID" varchar(36) NOT NULL default '' Primary Key, + "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" smallint default NULL, + "creationDate" int default NULL, + "groupID" varchar(36) default NULL, + "groupOwned" boolean default NULL, + "flags" int default NULL +); + + +CREATE INDEX ii_owner ON inventoryitems +( + "avatarID" ASC +); + +CREATE INDEX ii_folder ON inventoryitems +( + "parentFolderID" ASC +); + +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 cotext of the database designer.*/ +BEGIN TRANSACTION; + +CREATE TABLE Tmp_inventoryfolders + ( + "folderID" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'), + "agentID" uuid NULL DEFAULT (NULL), + "parentFolderID" uuid NULL DEFAULT (NULL), + "folderName" varchar(64) NULL DEFAULT (NULL), + "type" smallint NOT NULL DEFAULT ((0)), + "version" int NOT NULL DEFAULT ((0)) + ); + + INSERT INTO Tmp_inventoryfolders ("folderID", "agentID", "parentFolderID", "folderName", type, version) + SELECT cast("folderID" as uuid), cast("agentID" as uuid), cast("parentFolderID" as uuid), "folderName", "type", "version" + FROM inventoryfolders; + +DROP TABLE inventoryfolders; + +alter table Tmp_inventoryfolders rename to inventoryfolders; + +ALTER TABLE inventoryfolders ADD CONSTRAINT + PK__inventor__C2FABFB3173876EA PRIMARY KEY + ( + "folderID" + ); + +CREATE INDEX owner ON inventoryfolders + ( + "agentID" + ); + +CREATE INDEX parent ON inventoryfolders + ( + "parentFolderID" + ); + +COMMIT; + + +:VERSION 4 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_inventoryitems + ( + "inventoryID" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'), + "assetID" uuid NULL DEFAULT (NULL), + "assetType" int NULL DEFAULT (NULL), + "parentFolderID" uuid NULL DEFAULT (NULL), + "avatarID" uuid 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" uuid NULL DEFAULT (NULL), + "inventoryBasePermissions" int NOT NULL DEFAULT ((0)), + "inventoryEveryOnePermissions" int NOT NULL DEFAULT ((0)), + "salePrice" int NULL DEFAULT (NULL), + "SaleType" smallint NULL DEFAULT (NULL), + "creationDate" int NULL DEFAULT (NULL), + "groupID" uuid NULL DEFAULT (NULL), + "groupOwned" boolean NULL DEFAULT (NULL), + "flags" int NULL DEFAULT (NULL), + "inventoryGroupPermissions" int NOT NULL DEFAULT ((0)) + ); + + + INSERT INTO Tmp_inventoryitems ("inventoryID", "assetID", "assetType", "parentFolderID", "avatarID", "inventoryName", "inventoryDescription", "inventoryNextPermissions", "inventoryCurrentPermissions", "invType", "creatorID", "inventoryBasePermissions", "inventoryEveryOnePermissions", "salePrice", "SaleType", "creationDate", "groupID", "groupOwned", "flags", "inventoryGroupPermissions") + SELECT cast("inventoryID" as uuid), cast("assetID" as uuid), "assetType", cast("parentFolderID" as uuid), cast("avatarID" as uuid), "inventoryName", "inventoryDescription", "inventoryNextPermissions", "inventoryCurrentPermissions", "invType", cast("creatorID" as uuid), "inventoryBasePermissions", "inventoryEveryOnePermissions", "salePrice", "SaleType", "creationDate", cast("groupID" as uuid), "groupOwned", "flags", "inventoryGroupPermissions" + FROM inventoryitems ; + +DROP TABLE inventoryitems; + +alter table Tmp_inventoryitems rename to inventoryitems; + +ALTER TABLE inventoryitems ADD CONSTRAINT + PK__inventor__C4B7BC2220C1E124 PRIMARY KEY + ( + "inventoryID" + ); + + +CREATE INDEX ii2_owner ON inventoryitems + ( + "avatarID" + ); + +CREATE INDEX ii2_folder ON inventoryitems + ( + "parentFolderID" + ); + +COMMIT; + +:VERSION 5 + + +BEGIN TRANSACTION; + +-- # Restoring defaults: +-- # NOTE: "inventoryID" does NOT need one: it's NOT NULL PK and a unique Guid must be provided every time anyway! + +alter table inventoryitems + alter column "inventoryBasePermissions" set default 0; +alter table inventoryitems + alter column "inventoryEveryOnePermissions" set default 0; +alter table inventoryitems + alter column "inventoryGroupPermissions" set default 0 ; + +COMMIT ; + +:VERSION 7 + +BEGIN TRANSACTION; + +-- # "creatorID" goes back to VARCHAR(36) (???) + +alter table inventoryitems + alter column "creatorID" type varchar(36); + +COMMIT ; + +:VERSION 8 + +ALTER TABLE inventoryitems + alter column "creatorID" set DEFAULT '00000000-0000-0000-0000-000000000000'; + + +:VERSION 9 + +BEGIN TRANSACTION; + +--# "creatorID" goes up to VARCHAR(255) + +alter table inventoryitems + alter column "creatorID" type varchar(255); + +Commit; diff --git a/OpenSim/Data/PGSQL/Resources/LogStore.migrations b/OpenSim/Data/PGSQL/Resources/LogStore.migrations new file mode 100644 index 0000000..83727c6 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/LogStore.migrations @@ -0,0 +1,16 @@ +:VERSION 1 + +BEGIN TRANSACTION; + +CREATE TABLE logs ( + "logID" int NOT NULL Primary Key, + "target" varchar(36) default NULL, + "server" varchar(64) default NULL, + "method" varchar(64) default NULL, + "arguments" varchar(255) default NULL, + "priority" int default NULL, + "message" text +); + +COMMIT; + diff --git a/OpenSim/Data/PGSQL/Resources/Presence.migrations b/OpenSim/Data/PGSQL/Resources/Presence.migrations new file mode 100644 index 0000000..684faa2 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/Presence.migrations @@ -0,0 +1,30 @@ +:VERSION 1 + +BEGIN TRANSACTION; + +CREATE TABLE Presence ( +"UserID" varchar(255) NOT NULL, +"RegionID" uuid NOT NULL, +"SessionID" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000', +"SecureSessionID" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000' +); + + +COMMIT; + +:VERSION 2 + +BEGIN TRANSACTION; + +CREATE UNIQUE INDEX SessionID ON Presence("SessionID"); +CREATE INDEX UserID ON Presence("UserID"); + +COMMIT; + +:VERSION 2 + +BEGIN TRANSACTION; + +ALTER TABLE Presence ADD "LastSeen" Timestamp; + +COMMIT; diff --git a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations new file mode 100644 index 0000000..65eb011 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations @@ -0,0 +1,1136 @@ +begin transaction ; +:VERSION 1 + +CREATE TABLE prims( + "UUID" varchar(255) NOT NULL Primary key, + "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" double precision NULL, + "PositionY" double precision NULL, + "PositionZ" double precision NULL, + "GroupPositionX" double precision NULL, + "GroupPositionY" double precision NULL, + "GroupPositionZ" double precision NULL, + "VelocityX" double precision NULL, + "VelocityY" double precision NULL, + "VelocityZ" double precision NULL, + "AngularVelocityX" double precision NULL, + "AngularVelocityY" double precision NULL, + "AngularVelocityZ" double precision NULL, + "AccelerationX" double precision NULL, + "AccelerationY" double precision NULL, + "AccelerationZ" double precision NULL, + "RotationX" double precision NULL, + "RotationY" double precision NULL, + "RotationZ" double precision NULL, + "RotationW" double precision NULL, + "SitTargetOffsetX" double precision NULL, + "SitTargetOffsetY" double precision NULL, + "SitTargetOffsetZ" double precision NULL, + "SitTargetOrientW" double precision NULL, + "SitTargetOrientX" double precision NULL, + "SitTargetOrientY" double precision NULL, + "SitTargetOrientZ" double precision NULL + ); + +CREATE TABLE primshapes( + "UUID" varchar(255) NOT NULL primary key, + "Shape" int NULL, + "ScaleX" double precision NULL, + "ScaleY" double precision NULL, + "ScaleZ" double precision 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" bytea NULL, + "ExtraParams" bytea NULL + ); + +CREATE TABLE primitems( + "itemID" varchar(255) NOT NULL primary key, + "primID" varchar(255) NULL, + "assetID" varchar(255) NULL, + "parentFolderID" varchar(255) NULL, + "invType" int NULL, + "assetType" int NULL, + "name" varchar(255) NULL, + "description" varchar(255) NULL, + "creationDate" varchar(255) NULL, + "creatorID" varchar(255) NULL, + "ownerID" varchar(255) NULL, + "lastOwnerID" varchar(255) NULL, + "groupID" varchar(255) NULL, + "nextPermissions" int NULL, + "currentPermissions" int NULL, + "basePermissions" int NULL, + "everyonePermissions" int NULL, + "groupPermissions" int NULL + ); + +CREATE TABLE terrain( + "RegionUUID" varchar(255) NULL, + "Revision" int NULL, + "Heightfield" bytea NULL +); + + +CREATE TABLE land( + "UUID" varchar(255) NOT NULL primary key, + "RegionUUID" varchar(255) NULL, + "LocalLandID" int NULL, + "Bitmap" bytea NULL, + "Name" varchar(255) NULL, + "Description" varchar(255) NULL, + "OwnerUUID" varchar(255) NULL, + "IsGroupOwned" boolean NULL, + "Area" int NULL, + "AuctionID" int NULL, + "Category" int NULL, + "ClaimDate" int NULL, + "ClaimPrice" int NULL, + "GroupUUID" varchar(255) NULL, + "SalePrice" int NULL, + "LandStatus" int NULL, + "LandFlags" int NULL, + "LandingType" int NULL, + "MediaAutoScale" int NULL, + "MediaTextureUUID" varchar(255) NULL, + "MediaURL" varchar(255) NULL, + "MusicURL" varchar(255) NULL, + "PassHours" double precision NULL, + "PassPrice" int NULL, + "SnapshotUUID" varchar(255) NULL, + "UserLocationX" double precision NULL, + "UserLocationY" double precision NULL, + "UserLocationZ" double precision NULL, + "UserLookAtX" double precision NULL, + "UserLookAtY" double precision NULL, + "UserLookAtZ" double precision NULL +); + +Create index on land (lower("Name")); + +CREATE TABLE landaccesslist( + "LandUUID" varchar(255) NULL, + "AccessUUID" varchar(255) NULL, + "Flags" int NULL +); + +COMMIT; + +: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 regionsettings ( + "regionUUID" varchar(36) not null primary key, + "block_terraform" boolean not null, + "block_fly" boolean not null, + "allow_damage" boolean not null, + "restrict_pushing" boolean not null, + "allow_land_resell" boolean not null, + "allow_land_join_divide" boolean not null, + "block_show_in_search" boolean not null, + "agent_limit" int not null, + "object_bonus" double precision not null, + "maturity" int not null, + "disable_scripts" boolean not null, + "disable_collisions" boolean not null, + "disable_physics" boolean 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" double precision not null, + "elevation_2_nw" double precision not null, + "elevation_1_ne" double precision not null, + "elevation_2_ne" double precision not null, + "elevation_1_se" double precision not null, + "elevation_2_se" double precision not null, + "elevation_1_sw" double precision not null, + "elevation_2_sw" double precision not null, + "water_height" double precision not null, + "terrain_raise_limit" double precision not null, + "terrain_lower_limit" double precision not null, + "use_estate_sun" boolean not null, + "fixed_sun" boolean not null, + "sun_position" double precision not null, + "covenant" varchar(36) default NULL, + "Sandbox" boolean NOT NULL + ); + +COMMIT; + +:VERSION 3 + +BEGIN TRANSACTION; + +CREATE TABLE 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" double precision NULL, + "PositionY" double precision NULL, + "PositionZ" double precision NULL, + "GroupPositionX" double precision NULL, + "GroupPositionY" double precision NULL, + "GroupPositionZ" double precision NULL, + "VelocityX" double precision NULL, + "VelocityY" double precision NULL, + "VelocityZ" double precision NULL, + "AngularVelocityX" double precision NULL, + "AngularVelocityY" double precision NULL, + "AngularVelocityZ" double precision NULL, + "AccelerationX" double precision NULL, + "AccelerationY" double precision NULL, + "AccelerationZ" double precision NULL, + "RotationX" double precision NULL, + "RotationY" double precision NULL, + "RotationZ" double precision NULL, + "RotationW" double precision NULL, + "SitTargetOffsetX" double precision NULL, + "SitTargetOffsetY" double precision NULL, + "SitTargetOffsetZ" double precision NULL, + "SitTargetOrientW" double precision NULL, + "SitTargetOrientX" double precision NULL, + "SitTargetOrientY" double precision NULL, + "SitTargetOrientZ" double precision NULL + ); + +INSERT INTO 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 cast("UUID" as varchar(36)), cast("RegionUUID" as varchar(36)), "ParentID", "CreationDate", "Name", cast("SceneGroupID" as varchar(36)), "Text", "Description", "SitName", "TouchName", "ObjectFlags", cast("CreatorID" as varchar(36)), cast("OwnerID" as varchar(36)), cast( "GroupID" as varchar(36)), cast("LastOwnerID" as varchar(36)), "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 prims ; + +DROP TABLE prims; + +alter table Tmp_prims rename to prims; + + +ALTER TABLE prims ADD CONSTRAINT + PK__prims__10566F31 PRIMARY KEY + ( + "UUID" + ); + +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 + ); + +INSERT INTO Tmp_primitems ("itemID", "primID", "assetID", "parentFolderID", "invType", "assetType", "name", "description", "creationDate", "creatorID", "ownerID", "lastOwnerID", "groupID", "nextPermissions", "currentPermissions", "basePermissions", "everyonePermissions", "groupPermissions") + SELECT cast("itemID" as varchar(36)), cast("primID" as varchar(36)), cast("assetID" as varchar(36)), cast( "parentFolderID" as varchar(36)), "invType", "assetType", "name", "description", "creationDate", cast( "creatorID" as varchar(36)), cast("ownerID" as varchar(36)), cast("lastOwnerID" as varchar(36)), cast("groupID" as varchar(36)), "nextPermissions", "currentPermissions", "basePermissions", "everyonePermissions", "groupPermissions" + from primitems; + +DROP TABLE primitems; + +alter table Tmp_primitems rename to primitems; + +ALTER TABLE primitems ADD CONSTRAINT + PK__primitems__0A688BB1 PRIMARY KEY + ( + "itemID" + ); + + +COMMIT; + + +:VERSION 5 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_primshapes + ( + "UUID" varchar(36) NOT NULL, + "Shape" int NULL, + "ScaleX" double precision NULL, + "ScaleY" double precision NULL, + "ScaleZ" double precision 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" bytea NULL, + "ExtraParams" bytea NULL + ) ; + +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 cast("UUID" as varchar(36)), "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; + +DROP TABLE primshapes; + +alter table Tmp_primshapes rename to primshapes; + +ALTER TABLE primshapes ADD CONSTRAINT + PK__primshapes__0880433F PRIMARY KEY + ( + "UUID" + ) ; + +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" double precision not null default 0.0; +ALTER TABLE prims ADD "TextureAnimation" bytea; +ALTER TABLE prims ADD "OmegaX" double precision not null default 0.0; +ALTER TABLE prims ADD "OmegaY" double precision not null default 0.0; +ALTER TABLE prims ADD "OmegaZ" double precision not null default 0.0; +ALTER TABLE prims ADD "CameraEyeOffsetX" double precision not null default 0.0; +ALTER TABLE prims ADD "CameraEyeOffsetY" double precision not null default 0.0; +ALTER TABLE prims ADD "CameraEyeOffsetZ" double precision not null default 0.0; +ALTER TABLE prims ADD "CameraAtOffsetX" double precision not null default 0.0; +ALTER TABLE prims ADD "CameraAtOffsetY" double precision not null default 0.0; +ALTER TABLE prims ADD "CameraAtOffsetZ" double precision not null default 0.0; +ALTER TABLE prims ADD "ForceMouselook" smallint not null default 0; +ALTER TABLE prims ADD "ScriptAccessPin" int not null default 0; +ALTER TABLE prims ADD "AllowedDrop" smallint not null default 0; +ALTER TABLE prims ADD "DieAtEdge" smallint not null default 0; +ALTER TABLE prims ADD "SalePrice" int not null default 10; +ALTER TABLE prims ADD "SaleType" smallint 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" bytea; +ALTER TABLE prims ADD "ClickAction" smallint 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" smallint NOT NULL default 3; + +COMMIT; + + +:VERSION 10 + +BEGIN TRANSACTION; + +ALTER TABLE regionsettings ADD "sunvectorx" double precision NOT NULL default 0; +ALTER TABLE regionsettings ADD "sunvectory" double precision NOT NULL default 0; +ALTER TABLE regionsettings ADD "sunvectorz" double precision 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" double precision 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 Tmp_prims + ( + "UUID" uuid NOT NULL, + "RegionUUID" uuid NULL, + "ParentID" int NULL, + "CreationDate" int NULL, + "Name" varchar(255) NULL, + "SceneGroupID" uuid NULL, + "Text" varchar(255) NULL, + "Description" varchar(255) NULL, + "SitName" varchar(255) NULL, + "TouchName" varchar(255) NULL, + "ObjectFlags" int NULL, + "CreatorID" uuid NULL, + "OwnerID" uuid NULL, + "GroupID" uuid NULL, + "LastOwnerID" uuid NULL, + "OwnerMask" int NULL, + "NextOwnerMask" int NULL, + "GroupMask" int NULL, + "EveryoneMask" int NULL, + "BaseMask" int NULL, + "PositionX" double precision NULL, + "PositionY" double precision NULL, + "PositionZ" double precision NULL, + "GroupPositionX" double precision NULL, + "GroupPositionY" double precision NULL, + "GroupPositionZ" double precision NULL, + "VelocityX" double precision NULL, + "VelocityY" double precision NULL, + "VelocityZ" double precision NULL, + "AngularVelocityX" double precision NULL, + "AngularVelocityY" double precision NULL, + "AngularVelocityZ" double precision NULL, + "AccelerationX" double precision NULL, + "AccelerationY" double precision NULL, + "AccelerationZ" double precision NULL, + "RotationX" double precision NULL, + "RotationY" double precision NULL, + "RotationZ" double precision NULL, + "RotationW" double precision NULL, + "SitTargetOffsetX" double precision NULL, + "SitTargetOffsetY" double precision NULL, + "SitTargetOffsetZ" double precision NULL, + "SitTargetOrientW" double precision NULL, + "SitTargetOrientX" double precision NULL, + "SitTargetOrientY" double precision NULL, + "SitTargetOrientZ" double precision 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" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'), + "LoopedSoundGain" double precision NOT NULL DEFAULT ((0.0)), + "TextureAnimation" bytea NULL, + "OmegaX" double precision NOT NULL DEFAULT ((0.0)), + "OmegaY" double precision NOT NULL DEFAULT ((0.0)), + "OmegaZ" double precision NOT NULL DEFAULT ((0.0)), + "CameraEyeOffsetX" double precision NOT NULL DEFAULT ((0.0)), + "CameraEyeOffsetY" double precision NOT NULL DEFAULT ((0.0)), + "CameraEyeOffsetZ" double precision NOT NULL DEFAULT ((0.0)), + "CameraAtOffsetX" double precision NOT NULL DEFAULT ((0.0)), + "CameraAtOffsetY" double precision NOT NULL DEFAULT ((0.0)), + "CameraAtOffsetZ" double precision NOT NULL DEFAULT ((0.0)), + "ForceMouselook" smallint NOT NULL DEFAULT ((0)), + "ScriptAccessPin" int NOT NULL DEFAULT ((0)), + "AllowedDrop" smallint NOT NULL DEFAULT ((0)), + "DieAtEdge" smallint NOT NULL DEFAULT ((0)), + "SalePrice" int NOT NULL DEFAULT ((10)), + "SaleType" smallint 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" bytea NULL, + "ClickAction" smallint NOT NULL DEFAULT ((0)), + "Material" smallint NOT NULL DEFAULT ((3)), + "CollisionSound" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'), + "CollisionSoundVolume" double precision NOT NULL DEFAULT ((0.0)), + "LinkNumber" int NOT NULL DEFAULT ((0)) + ); + +INSERT INTO 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 cast("UUID" as uuid), cast("RegionUUID" as uuid), "ParentID", "CreationDate", "Name", cast("SceneGroupID" as uuid), "Text", "Description", "SitName", "TouchName", "ObjectFlags", cast("CreatorID" as uuid), cast("OwnerID" as uuid), cast("GroupID" as uuid), cast("LastOwnerID" as uuid), "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", cast("LoopedSound" as uuid), "LoopedSoundGain", "TextureAnimation", "OmegaX", "OmegaY", "OmegaZ", "CameraEyeOffsetX", "CameraEyeOffsetY", "CameraEyeOffsetZ", "CameraAtOffsetX", "CameraAtOffsetY", "CameraAtOffsetZ", "ForceMouselook", "ScriptAccessPin", "AllowedDrop", "DieAtEdge", "SalePrice", "SaleType", "ColorR", "ColorG", "ColorB", "ColorA", "ParticleSystem", "ClickAction", "Material", cast("CollisionSound" as uuid), "CollisionSoundVolume", "LinkNumber" + FROM prims ; + +DROP TABLE prims; + +alter table Tmp_prims rename to prims; + +ALTER TABLE prims ADD CONSTRAINT + PK__prims__10566F31 PRIMARY KEY + ( + "UUID" + ); + + +CREATE INDEX prims_regionuuid ON prims + ( + "RegionUUID" + ); + +CREATE INDEX prims_parentid ON prims + ( + "ParentID" + ); + +COMMIT; + + +:VERSION 14 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_primshapes + ( + "UUID" uuid NOT NULL, + "Shape" int NULL, + "ScaleX" double precision NULL, + "ScaleY" double precision NULL, + "ScaleZ" double precision 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" bytea NULL, + "ExtraParams" bytea NULL + ); + +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 cast("UUID" as 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; + +DROP TABLE primshapes; + +alter table Tmp_primshapes rename to primshapes; + +ALTER TABLE primshapes ADD CONSTRAINT + PK__primshapes__0880433F PRIMARY KEY + ( + "UUID" + ); + +COMMIT; + + +:VERSION 15 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_primitems + ( + "itemID" uuid NOT NULL, + "primID" uuid NULL, + "assetID" uuid NULL, + "parentFolderID" uuid NULL, + "invType" int NULL, + "assetType" int NULL, + "name" varchar(255) NULL, + "description" varchar(255) NULL, + "creationDate" varchar(255) NULL, + "creatorID" uuid NULL, + "ownerID" uuid NULL, + "lastOwnerID" uuid NULL, + "groupID" uuid NULL, + "nextPermissions" int NULL, + "currentPermissions" int NULL, + "basePermissions" int NULL, + "everyonePermissions" int NULL, + "groupPermissions" int NULL, + flags int NOT NULL DEFAULT ((0)) + ); + +INSERT INTO Tmp_primitems ("itemID", "primID", "assetID", "parentFolderID", "invType", "assetType", "name", "description", "creationDate", "creatorID", "ownerID", "lastOwnerID", "groupID", "nextPermissions", "currentPermissions", "basePermissions", "everyonePermissions", "groupPermissions", flags) + SELECT cast("itemID" as uuid), cast("primID" as uuid), cast("assetID" as uuid), cast("parentFolderID" as uuid), "invType", "assetType", "name", "description", "creationDate", cast("creatorID" as uuid), cast("ownerID" as uuid), cast("lastOwnerID" as uuid), cast("groupID" as uuid), "nextPermissions", "currentPermissions", "basePermissions", "everyonePermissions", "groupPermissions", flags + FROM primitems ; + +DROP TABLE primitems; + +alter table Tmp_primitems rename to primitems; + +ALTER TABLE primitems ADD CONSTRAINT + PK__primitems__0A688BB1 PRIMARY KEY + ( + "itemID" + ); + +CREATE INDEX primitems_primid ON primitems + ( + "primID" + ) ; + +COMMIT; + + +:VERSION 16 + + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_terrain + ( + "RegionUUID" uuid NULL, + "Revision" int NULL, + "Heightfield" bytea NULL + ); + +INSERT INTO Tmp_terrain ("RegionUUID", "Revision", "Heightfield") + SELECT cast("RegionUUID" as uuid), "Revision", "Heightfield" + FROM terrain ; + +DROP TABLE terrain; + +alter table Tmp_terrain rename to terrain; + +COMMIT; + + +:VERSION 17 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_land + ( + "UUID" uuid NOT NULL, + "RegionUUID" uuid NULL, + "LocalLandID" int NULL, + "Bitmap" bytea NULL, + "Name" varchar(255) NULL, + "Description" varchar(255) NULL, + "OwnerUUID" uuid NULL, + "IsGroupOwned" boolean NULL, + "Area" int NULL, + "AuctionID" int NULL, + "Category" int NULL, + "ClaimDate" int NULL, + "ClaimPrice" int NULL, + "GroupUUID" uuid NULL, + "SalePrice" int NULL, + "LandStatus" int NULL, + "LandFlags" int NULL, + "LandingType" int NULL, + "MediaAutoScale" int NULL, + "MediaTextureUUID" uuid NULL, + "MediaURL" varchar(255) NULL, + "MusicURL" varchar(255) NULL, + "PassHours" double precision NULL, + "PassPrice" int NULL, + "SnapshotUUID" uuid NULL, + "UserLocationX" double precision NULL, + "UserLocationY" double precision NULL, + "UserLocationZ" double precision NULL, + "UserLookAtX" double precision NULL, + "UserLookAtY" double precision NULL, + "UserLookAtZ" double precision NULL, + "AuthbuyerID" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'), + "OtherCleanTime" int NOT NULL DEFAULT ((0)), + "Dwell" int NOT NULL DEFAULT ((0)) + ); + +INSERT INTO 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 cast("UUID" as uuid), cast("RegionUUID" as uuid), "LocalLandID", "Bitmap", "Name", "Description", cast("OwnerUUID" as uuid), "IsGroupOwned", "Area", "AuctionID", "Category", "ClaimDate", "ClaimPrice", cast("GroupUUID" as uuid), "SalePrice", "LandStatus", "LandFlags", "LandingType", "MediaAutoScale", cast("MediaTextureUUID" as uuid), "MediaURL", "MusicURL", "PassHours", "PassPrice", cast("SnapshotUUID" as uuid), "UserLocationX", "UserLocationY", "UserLocationZ", "UserLookAtX", "UserLookAtY", "UserLookAtZ", cast("AuthbuyerID" as uuid), "OtherCleanTime", "Dwell" + FROM land ; + +DROP TABLE land; + +alter table Tmp_land rename to land; + +ALTER TABLE land ADD CONSTRAINT + PK__land__65A475E71BFD2C07 PRIMARY KEY + ( + "UUID" + ); + +Create index on land (lower("Name")); + +COMMIT; + + + +:VERSION 18 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_landaccesslist + ( + "LandUUID" uuid NULL, + "AccessUUID" uuid NULL, + "Flags" int NULL + ); + +INSERT INTO Tmp_landaccesslist ("LandUUID", "AccessUUID", "Flags") + SELECT cast("LandUUID" as uuid), cast("AccessUUID" as uuid), "Flags" + FROM landaccesslist ; + +DROP TABLE landaccesslist; + +alter table Tmp_landaccesslist rename to landaccesslist; + +COMMIT; + + + +:VERSION 19 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_regionban + ( + "regionUUID" uuid NOT NULL, + "bannedUUID" uuid NOT NULL, + "bannedIp" varchar(16) NOT NULL, + "bannedIpHostMask" varchar(16) NOT NULL + ); + +INSERT INTO Tmp_regionban ("regionUUID", "bannedUUID", "bannedIp", "bannedIpHostMask") + SELECT cast("regionUUID" as uuid), cast("bannedUUID" as uuid), "bannedIp", "bannedIpHostMask" + FROM regionban ; + +DROP TABLE regionban; + +alter table Tmp_regionban rename to regionban; + +COMMIT; + + +:VERSION 20 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_regionsettings + ( + "regionUUID" uuid NOT NULL, + "block_terraform" boolean NOT NULL, + "block_fly" boolean NOT NULL, + "allow_damage" boolean NOT NULL, + "restrict_pushing" boolean NOT NULL, + "allow_land_resell" boolean NOT NULL, + "allow_land_join_divide" boolean NOT NULL, + "block_show_in_search" boolean NOT NULL, + "agent_limit" int NOT NULL, + "object_bonus" double precision NOT NULL, + "maturity" int NOT NULL, + "disable_scripts" boolean NOT NULL, + "disable_collisions" boolean NOT NULL, + "disable_physics" boolean NOT NULL, + "terrain_texture_1" uuid NOT NULL, + "terrain_texture_2" uuid NOT NULL, + "terrain_texture_3" uuid NOT NULL, + "terrain_texture_4" uuid NOT NULL, + "elevation_1_nw" double precision NOT NULL, + "elevation_2_nw" double precision NOT NULL, + "elevation_1_ne" double precision NOT NULL, + "elevation_2_ne" double precision NOT NULL, + "elevation_1_se" double precision NOT NULL, + "elevation_2_se" double precision NOT NULL, + "elevation_1_sw" double precision NOT NULL, + "elevation_2_sw" double precision NOT NULL, + "water_height" double precision NOT NULL, + "terrain_raise_limit" double precision NOT NULL, + "terrain_lower_limit" double precision NOT NULL, + "use_estate_sun" boolean NOT NULL, + "fixed_sun" boolean NOT NULL, + "sun_position" double precision NOT NULL, + "covenant" uuid NULL DEFAULT (NULL), + "Sandbox" boolean NOT NULL, + "sunvectorx" double precision NOT NULL DEFAULT ((0)), + "sunvectory" double precision NOT NULL DEFAULT ((0)), + "sunvectorz" double precision NOT NULL DEFAULT ((0)) + ); + +INSERT INTO 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 cast("regionUUID" as uuid), "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", cast("terrain_texture_1" as uuid), cast("terrain_texture_2" as uuid), cast("terrain_texture_3" as uuid), cast("terrain_texture_4" as uuid), "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", cast("covenant" as uuid), "Sandbox", "sunvectorx", "sunvectory", "sunvectorz" + FROM regionsettings ; + +DROP TABLE regionsettings; + +alter table Tmp_regionsettings rename to regionsettings; + +ALTER TABLE regionsettings ADD CONSTRAINT + PK__regionse__5B35159D21B6055D PRIMARY KEY + ( + "regionUUID" + ); + +COMMIT; + + +:VERSION 21 + +BEGIN TRANSACTION; + +ALTER TABLE prims ADD "PassTouches" boolean not null default false; + +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; + +:VERSION 24 + +BEGIN TRANSACTION; + +ALTER TABLE prims ADD "MediaURL" varchar(255); +ALTER TABLE primshapes ADD "Media" TEXT NULL; + +COMMIT; + +:VERSION 25 + +BEGIN TRANSACTION; +CREATE TABLE regionwindlight ( + "region_id" varchar(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000' PRIMARY KEY, + "water_color_r" double precision NOT NULL DEFAULT '4.000000', + water_color_g double precision NOT NULL DEFAULT '38.000000', + water_color_b double precision NOT NULL DEFAULT '64.000000', + water_fog_density_exponent double precision NOT NULL DEFAULT '4.0', + underwater_fog_modifier double precision NOT NULL DEFAULT '0.25', + reflection_wavelet_scale_1 double precision NOT NULL DEFAULT '2.0', + reflection_wavelet_scale_2 double precision NOT NULL DEFAULT '2.0', + reflection_wavelet_scale_3 double precision NOT NULL DEFAULT '2.0', + fresnel_scale double precision NOT NULL DEFAULT '0.40', + fresnel_offset double precision NOT NULL DEFAULT '0.50', + refract_scale_above double precision NOT NULL DEFAULT '0.03', + refract_scale_below double precision NOT NULL DEFAULT '0.20', + blur_multiplier double precision NOT NULL DEFAULT '0.040', + big_wave_direction_x double precision NOT NULL DEFAULT '1.05', + big_wave_direction_y double precision NOT NULL DEFAULT '-0.42', + little_wave_direction_x double precision NOT NULL DEFAULT '1.11', + little_wave_direction_y double precision NOT NULL DEFAULT '-1.16', + normal_map_texture varchar(36) NOT NULL DEFAULT '822ded49-9a6c-f61c-cb89-6df54f42cdf4', + horizon_r double precision NOT NULL DEFAULT '0.25', + horizon_g double precision NOT NULL DEFAULT '0.25', + horizon_b double precision NOT NULL DEFAULT '0.32', + horizon_i double precision NOT NULL DEFAULT '0.32', + haze_horizon double precision NOT NULL DEFAULT '0.19', + blue_density_r double precision NOT NULL DEFAULT '0.12', + blue_density_g double precision NOT NULL DEFAULT '0.22', + blue_density_b double precision NOT NULL DEFAULT '0.38', + blue_density_i double precision NOT NULL DEFAULT '0.38', + haze_density double precision NOT NULL DEFAULT '0.70', + density_multiplier double precision NOT NULL DEFAULT '0.18', + distance_multiplier double precision NOT NULL DEFAULT '0.8', + max_altitude int NOT NULL DEFAULT '1605', + sun_moon_color_r double precision NOT NULL DEFAULT '0.24', + sun_moon_color_g double precision NOT NULL DEFAULT '0.26', + sun_moon_color_b double precision NOT NULL DEFAULT '0.30', + sun_moon_color_i double precision NOT NULL DEFAULT '0.30', + sun_moon_position double precision NOT NULL DEFAULT '0.317', + ambient_r double precision NOT NULL DEFAULT '0.35', + ambient_g double precision NOT NULL DEFAULT '0.35', + ambient_b double precision NOT NULL DEFAULT '0.35', + ambient_i double precision NOT NULL DEFAULT '0.35', + east_angle double precision NOT NULL DEFAULT '0.00', + sun_glow_focus double precision NOT NULL DEFAULT '0.10', + sun_glow_size double precision NOT NULL DEFAULT '1.75', + scene_gamma double precision NOT NULL DEFAULT '1.00', + star_brightness double precision NOT NULL DEFAULT '0.00', + cloud_color_r double precision NOT NULL DEFAULT '0.41', + cloud_color_g double precision NOT NULL DEFAULT '0.41', + cloud_color_b double precision NOT NULL DEFAULT '0.41', + cloud_color_i double precision NOT NULL DEFAULT '0.41', + cloud_x double precision NOT NULL DEFAULT '1.00', + cloud_y double precision NOT NULL DEFAULT '0.53', + cloud_density double precision NOT NULL DEFAULT '1.00', + cloud_coverage double precision NOT NULL DEFAULT '0.27', + cloud_scale double precision NOT NULL DEFAULT '0.42', + cloud_detail_x double precision NOT NULL DEFAULT '1.00', + cloud_detail_y double precision NOT NULL DEFAULT '0.53', + cloud_detail_density double precision NOT NULL DEFAULT '0.12', + cloud_scroll_x double precision NOT NULL DEFAULT '0.20', + cloud_scroll_x_lock smallint NOT NULL DEFAULT '0', + cloud_scroll_y double precision NOT NULL DEFAULT '0.01', + cloud_scroll_y_lock smallint NOT NULL DEFAULT '0', + draw_classic_clouds smallint NOT NULL DEFAULT '1' +); + +COMMIT; + +:VERSION 26 + +BEGIN TRANSACTION; + +ALTER TABLE regionsettings ADD "map_tile_ID" CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'; + +COMMIT; + +:VERSION 27 #--------------------- + +BEGIN TRANSACTION; +ALTER TABLE land ADD "MediaType" VARCHAR(32) NOT NULL DEFAULT 'none/none' ; +ALTER TABLE land ADD "MediaDescription" VARCHAR(255) NOT NULL DEFAULT ''; +ALTER TABLE land ADD "MediaSize" VARCHAR(16) NOT NULL DEFAULT '0,0'; +ALTER TABLE land ADD "MediaLoop" boolean NOT NULL DEFAULT false; +ALTER TABLE land ADD "ObscureMusic" boolean NOT NULL DEFAULT false; +ALTER TABLE land ADD "ObscureMedia" boolean NOT NULL DEFAULT false; +COMMIT; + +:VERSION 28 #--------------------- + +BEGIN TRANSACTION; + +ALTER TABLE prims +alter column "CreatorID" set DEFAULT '00000000-0000-0000-0000-000000000000' ; + +ALTER TABLE prims ALTER COLUMN "CreatorID" set NOT NULL; + +ALTER TABLE primitems +alter column "creatorID" set DEFAULT '00000000-0000-0000-0000-000000000000' ; + +ALTER TABLE primitems ALTER COLUMN "creatorID" set NOT NULL; + +COMMIT; + +:VERSION 29 #----------------- Region Covenant changed time + +BEGIN TRANSACTION; + +ALTER TABLE regionsettings ADD "covenant_datetime" int NOT NULL default 0; + +COMMIT; + +:VERSION 30 #------------------Migrate "creatorID" storage to varchars instead of UUIDs for HG support + +BEGIN TRANSACTION; + +alter table prims rename column "CreatorID" to "CreatorIDOld"; +alter table primitems rename column "creatorID" to "creatorIDOld"; + +COMMIT; + +:VERSION 31 #--------------------- + +BEGIN TRANSACTION; + +ALTER TABLE prims ADD "CreatorID" varchar(255); +ALTER TABLE primitems ADD "creatorID" varchar(255); + +COMMIT; + +:VERSION 32 #--------------------- + +BEGIN TRANSACTION; + +UPDATE prims SET "CreatorID" = cast("CreatorIDOld" as varchar(255)); +UPDATE primitems SET "creatorID" = cast("creatorIDOld" as varchar(255)); + +COMMIT; + +:VERSION 33 #--------------------- + +BEGIN TRANSACTION; + +ALTER TABLE prims alter column "CreatorID" set default '00000000-0000-0000-0000-000000000000' ; + +ALTER TABLE prims ALTER COLUMN "CreatorID" set NOT NULL; + +ALTER TABLE primitems alter column "creatorID" set DEFAULT '00000000-0000-0000-0000-000000000000' ; + +ALTER TABLE primitems ALTER COLUMN "creatorID" set NOT NULL; + +COMMIT; + +:VERSION 34 #--------------- Telehub support + +BEGIN TRANSACTION; + +CREATE TABLE spawn_points( + "RegionUUID" uuid NOT NULL PRIMARY KEY, + "Yaw" double precision NOT NULL, + "Pitch" double precision NOT NULL, + "Distance" double precision NOT NULL +); + +ALTER TABLE regionsettings ADD "TelehubObject" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'; + +COMMIT; + +:VERSION 35 #---------------- Parcels for sale + +BEGIN TRANSACTION; + +ALTER TABLE regionsettings ADD "parcel_tile_ID" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'; + +COMMIT; + +:VERSION 36 #---------------- Timed bans/access + +BEGIN TRANSACTION; + +ALTER TABLE landaccesslist ADD "Expires" integer NOT NULL DEFAULT 0; + +COMMIT; + +:VERSION 37 #---------------- Environment Settings + +BEGIN TRANSACTION; + +CREATE TABLE regionenvironment( + "region_id" uuid NOT NULL primary key, + "llsd_settings" varchar NOT NULL +); + +COMMIT; + +:VERSION 38 #---------------- Dynamic attributes + +BEGIN TRANSACTION; + +ALTER TABLE prims ADD "DynAttrs" TEXT; + +COMMIT; + +:VERSION 39 #---------------- Extra physics params + +BEGIN TRANSACTION; + +ALTER TABLE prims ADD "PhysicsShapeType" smallint NOT NULL default '0'; +ALTER TABLE prims ADD "Density" double precision NOT NULL default '1000'; +ALTER TABLE prims ADD "GravityModifier" double precision NOT NULL default '1'; +ALTER TABLE prims ADD "Friction" double precision NOT NULL default '0.6'; +ALTER TABLE prims ADD "Restitution" double precision NOT NULL default '0.5'; + +COMMIT; diff --git a/OpenSim/Data/PGSQL/Resources/UserAccount.migrations b/OpenSim/Data/PGSQL/Resources/UserAccount.migrations new file mode 100644 index 0000000..c785463 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/UserAccount.migrations @@ -0,0 +1,51 @@ +:VERSION 1 + +CREATE TABLE UserAccounts ( + "PrincipalID" uuid NOT NULL Primary key, + "ScopeID" uuid NOT NULL, + "FirstName" varchar(64) NOT NULL, + "LastName" varchar(64) NOT NULL, + "Email" varchar(64) NULL, + "ServiceURLs" text NULL, + "Created" int default NULL +); + + +: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; + + diff --git a/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations b/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations new file mode 100644 index 0000000..f23c870 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations @@ -0,0 +1,83 @@ +:VERSION 1 # ------------------------------- + +begin; + +CREATE TABLE classifieds ( + "classifieduuid" char(36) NOT NULL, + "creatoruuid" char(36) NOT NULL, + "creationdate" integer NOT NULL, + "expirationdate" integer NOT NULL, + "category" varchar(20) NOT NULL, + "name" varchar(255) NOT NULL, + "description" text NOT NULL, + "parceluuid" char(36) NOT NULL, + "parentestate" integer NOT NULL, + "snapshotuuid" char(36) NOT NULL, + "simname" varchar(255) NOT NULL, + "posglobal" varchar(255) NOT NULL, + "parcelname" varchar(255) NOT NULL, + "classifiedflags" integer NOT NULL, + "priceforlisting" integer NOT NULL, + constraint classifiedspk PRIMARY KEY ("classifieduuid") +); + + +CREATE TABLE usernotes ( + "useruuid" varchar(36) NOT NULL, + "targetuuid" varchar(36) NOT NULL, + "notes" text NOT NULL, + constraint usernoteuk UNIQUE ("useruuid","targetuuid") +); + + +CREATE TABLE userpicks ( + "pickuuid" varchar(36) NOT NULL, + "creatoruuid" varchar(36) NOT NULL, + "toppick" boolean NOT NULL, + "parceluuid" varchar(36) NOT NULL, + "name" varchar(255) NOT NULL, + "description" text NOT NULL, + "snapshotuuid" varchar(36) NOT NULL, + "user" varchar(255) NOT NULL, + "originalname" varchar(255) NOT NULL, + "simname" varchar(255) NOT NULL, + "posglobal" varchar(255) NOT NULL, + "sortorder" integer NOT NULL, + "enabled" boolean NOT NULL, + PRIMARY KEY ("pickuuid") +); + + +CREATE TABLE userprofile ( + "useruuid" varchar(36) NOT NULL, + "profilePartner" varchar(36) NOT NULL, + "profileAllowPublish" bytea NOT NULL, + "profileMaturePublish" bytea NOT NULL, + "profileURL" varchar(255) NOT NULL, + "profileWantToMask" integer NOT NULL, + "profileWantToText" text NOT NULL, + "profileSkillsMask" integer NOT NULL, + "profileSkillsText" text NOT NULL, + "profileLanguages" text NOT NULL, + "profileImage" varchar(36) NOT NULL, + "profileAboutText" text NOT NULL, + "profileFirstImage" varchar(36) NOT NULL, + "profileFirstText" text NOT NULL, + PRIMARY KEY ("useruuid") +); + +commit; + +:VERSION 2 # ------------------------------- + +begin; +CREATE TABLE userdata ( + "UserId" char(36) NOT NULL, + "TagId" varchar(64) NOT NULL, + "DataKey" varchar(255), + "DataVal" varchar(255), + PRIMARY KEY ("UserId","TagId") +); + +commit; + diff --git a/OpenSim/Data/PGSQL/Resources/UserStore.migrations b/OpenSim/Data/PGSQL/Resources/UserStore.migrations new file mode 100644 index 0000000..974d489 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/UserStore.migrations @@ -0,0 +1,404 @@ +:VERSION 1 + +CREATE TABLE users ( + "UUID" varchar(36) NOT NULL default '' Primary Key, + "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" double precision default NULL, + "homeLocationY" double precision default NULL, + "homeLocationZ" double precision default NULL, + "homeLookAtX" double precision default NULL, + "homeLookAtY" double precision default NULL, + "homeLookAtZ" double precision 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" text, + "profileFirstText" text, + "profileImage" varchar(36) default NULL, + "profileFirstImage" varchar(36) default NULL, + "webLoginKey" varchar(36) default NULL +); + +CREATE INDEX "usernames" ON users +( + "username" ASC, + "lastname" ASC +); + + +CREATE TABLE agents ( + "UUID" varchar(36) NOT NULL Primary Key, + "sessionID" varchar(36) NOT NULL, + "secureSessionID" varchar(36) NOT NULL, + "agentIP" varchar(16) NOT NULL, + "agentPort" int NOT NULL, + "agentOnline" smallint NOT NULL, + "loginTime" int NOT NULL, + "logoutTime" int NOT NULL, + "currentRegion" varchar(36) NOT NULL, + "currentHandle" bigint NOT NULL, + "currentPos" varchar(64) NOT NULL +); + +CREATE INDEX session ON agents +( + "sessionID" ASC +); + +CREATE INDEX ssession ON agents +( + "secureSessionID" ASC +); + + +CREATE TABLE userfriends( + "ownerID" varchar(50) NOT NULL, + "friendID" varchar(50) NOT NULL, + "friendPerms" varchar(50) NOT NULL, + "datetimestamp" varchar(50) NOT NULL +); + +CREATE TABLE avatarappearance ( + "Owner" varchar(36) NOT NULL primary key, + "Serial" int NOT NULL, + "Visual_Params" bytea NOT NULL, + "Texture" bytea NOT NULL, + "Avatar_Height" double precision 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 +); + +: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 INDEX IX_avatarattachments ON avatarattachments + ( + "UUID" + ); + +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 + ); + +INSERT INTO Tmp_userfriends ("ownerID", "friendID", "friendPerms", "datetimestamp") + SELECT cast("ownerID" as varchar(36)), cast("friendID" as varchar(36)), cast("friendPerms" as int), cast("datetimestamp" as int) + FROM userfriends; + +DROP TABLE userfriends; + +alter table Tmp_userfriends rename to userfriends; + +CREATE INDEX IX_userfriends_ownerID ON userfriends + ( + "ownerID" + ); + +CREATE INDEX IX_userfriends_friendID ON userfriends + ( + "friendID" + ); + +COMMIT; + + +:VERSION 5 + +BEGIN TRANSACTION; + + ALTER TABLE users add "email" varchar(250); + +COMMIT; + + +:VERSION 6 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_users + ( + "UUID" uuid 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" double precision NULL DEFAULT (NULL), + "homeLocationY" double precision NULL DEFAULT (NULL), + "homeLocationZ" double precision NULL DEFAULT (NULL), + "homeLookAtX" double precision NULL DEFAULT (NULL), + "homeLookAtY" double precision NULL DEFAULT (NULL), + "homeLookAtZ" double precision 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" text NULL, + "profileFirstText" text NULL, + "profileImage" uuid NULL DEFAULT (NULL), + "profileFirstImage" uuid NULL DEFAULT (NULL), + "webLoginKey" uuid NULL DEFAULT (NULL), + "homeRegionID" uuid 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" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'), + email varchar(250) NULL + ); + +INSERT INTO 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 cast("UUID" as uuid), "username", "lastname", "passwordHash", "passwordSalt", "homeRegion", "homeLocationX", "homeLocationY", "homeLocationZ", "homeLookAtX", "homeLookAtY", "homeLookAtZ", "created", "lastLogin", "userInventoryURI", "userAssetURI", "profileCanDoMask", "profileWantDoMask", "profileAboutText", "profileFirstText", cast("profileImage" as uuid), cast("profileFirstImage" as uuid), cast("webLoginKey" as uuid), cast("homeRegionID" as uuid), "userFlags", "godLevel", "customType", cast("partner" as uuid), email + FROM users ; + +DROP TABLE users; + +alter table Tmp_users rename to users; + +ALTER TABLE users ADD CONSTRAINT + PK__users__65A475E737A5467C PRIMARY KEY + ( + "UUID" + ); + +CREATE INDEX "usernames" ON users + ( + "username", + "lastname" + ); + +COMMIT; + + +:VERSION 7 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_agents + ( + "UUID" uuid NOT NULL, + "sessionID" uuid NOT NULL, + "secureSessionID" uuid NOT NULL, + "agentIP" varchar(16) NOT NULL, + "agentPort" int NOT NULL, + "agentOnline" smallint NOT NULL, + "loginTime" int NOT NULL, + "logoutTime" int NOT NULL, + "currentRegion" uuid NOT NULL, + "currentHandle" bigint NOT NULL, + "currentPos" varchar(64) NOT NULL + ); + +INSERT INTO Tmp_agents ("UUID", "sessionID", "secureSessionID", "agentIP", "agentPort", "agentOnline", "loginTime", "logoutTime", "currentRegion", "currentHandle", "currentPos") + SELECT cast("UUID" as uuid), cast("sessionID" as uuid), cast("secureSessionID" as uuid), "agentIP", "agentPort", "agentOnline", "loginTime", "logoutTime", cast("currentRegion" as uuid), "currentHandle", "currentPos" + FROM agents ; + +DROP TABLE agents; + +alter table Tmp_agents rename to agents; + +ALTER TABLE agents ADD CONSTRAINT + PK__agents__65A475E749C3F6B7 PRIMARY KEY + ( + "UUID" + ) ; + +CREATE INDEX session ON agents + ( + "sessionID" + ); + +CREATE INDEX ssession ON agents + ( + "secureSessionID" + ); + +COMMIT; + + +:VERSION 8 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_userfriends + ( + "ownerID" uuid NOT NULL, + "friendID" uuid NOT NULL, + "friendPerms" int NOT NULL, + "datetimestamp" int NOT NULL + ); + +INSERT INTO Tmp_userfriends ("ownerID", "friendID", "friendPerms", "datetimestamp") + SELECT cast("ownerID" as uuid), cast( "friendID" as uuid), "friendPerms", "datetimestamp" + FROM userfriends; + +DROP TABLE userfriends; + +alter table Tmp_userfriends rename to userfriends; + +CREATE INDEX IX_userfriends_ownerID ON userfriends + ( + "ownerID" + ); + +CREATE INDEX IX_userfriends_friendID ON userfriends + ( + "friendID" + ); + +COMMIT; + + +:VERSION 9 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_avatarappearance + ( + "Owner" uuid NOT NULL, + "Serial" int NOT NULL, + "Visual_Params" bytea NOT NULL, + "Texture" bytea NOT NULL, + "Avatar_Height" double precision NOT NULL, + "Body_Item" uuid NOT NULL, + "Body_Asset" uuid NOT NULL, + "Skin_Item" uuid NOT NULL, + "Skin_Asset" uuid NOT NULL, + "Hair_Item" uuid NOT NULL, + "Hair_Asset" uuid NOT NULL, + "Eyes_Item" uuid NOT NULL, + "Eyes_Asset" uuid NOT NULL, + "Shirt_Item" uuid NOT NULL, + "Shirt_Asset" uuid NOT NULL, + "Pants_Item" uuid NOT NULL, + "Pants_Asset" uuid NOT NULL, + "Shoes_Item" uuid NOT NULL, + "Shoes_Asset" uuid NOT NULL, + "Socks_Item" uuid NOT NULL, + "Socks_Asset" uuid NOT NULL, + "Jacket_Item" uuid NOT NULL, + "Jacket_Asset" uuid NOT NULL, + "Gloves_Item" uuid NOT NULL, + "Gloves_Asset" uuid NOT NULL, + "Undershirt_Item" uuid NOT NULL, + "Undershirt_Asset" uuid NOT NULL, + "Underpants_Item" uuid NOT NULL, + "Underpants_Asset" uuid NOT NULL, + "Skirt_Item" uuid NOT NULL, + "Skirt_Asset" uuid NOT NULL + ); + +INSERT INTO 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 cast("Owner" as uuid), "Serial", "Visual_Params", "Texture", "Avatar_Height", cast("Body_Item" as uuid), cast("Body_Asset" as uuid), cast("Skin_Item" as uuid), cast("Skin_Asset" as uuid), cast("Hair_Item" as uuid), cast("Hair_Asset" as uuid), cast("Eyes_Item" as uuid), cast("Eyes_Asset" as uuid), cast("Shirt_Item" as uuid), cast("Shirt_Asset" as uuid), cast("Pants_Item" as uuid), cast("Pants_Asset" as uuid), cast("Shoes_Item" as uuid), cast("Shoes_Asset" as uuid), cast("Socks_Item" as uuid), cast("Socks_Asset" as uuid), cast("Jacket_Item" as uuid), cast("Jacket_Asset" as uuid), cast("Gloves_Item" as uuid), cast("Gloves_Asset" as uuid), cast("Undershirt_Item" as uuid), cast("Undershirt_Asset" as uuid), cast("Underpants_Item" as uuid), cast("Underpants_Asset" as uuid), cast("Skirt_Item" as uuid), cast("Skirt_Asset" as uuid) + FROM avatarappearance ; + +DROP TABLE avatarappearance; + +alter table Tmp_avatarappearance rename to avatarappearance; + +ALTER TABLE avatarappearance ADD CONSTRAINT + PK__avatarap__7DD115CC4E88ABD4 PRIMARY KEY + ( + "Owner" + ); + +COMMIT; + + +:VERSION 10 + +BEGIN TRANSACTION; + +CREATE TABLE Tmp_avatarattachments + ( + "UUID" uuid NOT NULL, + "attachpoint" int NOT NULL, + item uuid NOT NULL, + asset uuid NOT NULL + ); + +INSERT INTO Tmp_avatarattachments ("UUID", "attachpoint", item, asset) + SELECT cast("UUID" as uuid), "attachpoint", cast(item as uuid), cast(asset as uuid) + FROM avatarattachments ; + +DROP TABLE avatarattachments; + +alter table Tmp_avatarattachments rename to avatarattachments; + +CREATE INDEX IX_avatarattachments ON avatarattachments + ( + "UUID" + ); + +COMMIT; + + +:VERSION 11 + +BEGIN TRANSACTION; + +ALTER TABLE users ADD "scopeID" uuid not null default '00000000-0000-0000-0000-000000000000'; + +COMMIT; diff --git a/OpenSim/Data/PGSQL/Resources/XAssetStore.migrations b/OpenSim/Data/PGSQL/Resources/XAssetStore.migrations new file mode 100644 index 0000000..325ed0d --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/XAssetStore.migrations @@ -0,0 +1,27 @@ +# ----------------- +:VERSION 1 + +BEGIN; + +CREATE TABLE XAssetsMeta ( + "ID" char(36) NOT NULL, + "Hash" char(32) NOT NULL, + "Name" varchar(64) NOT NULL, + "Description" varchar(64) NOT NULL, + "AssetType" smallint NOT NULL, + "Local" smallint NOT NULL, + "Temporary" smallint NOT NULL, + "CreateTime" integer NOT NULL, + "AccessTime" integer NOT NULL, + "AssetFlags" integer NOT NULL, + "CreatorID" varchar(128) NOT NULL, + PRIMARY KEY ("ID") +); + +CREATE TABLE XAssetsData ( + "Hash" char(32) NOT NULL, + "Data" bytea NOT NULL, + PRIMARY KEY ("Hash") +); + +COMMIT; diff --git a/OpenSim/Data/PGSQL/Resources/os_groups_Store.migrations b/OpenSim/Data/PGSQL/Resources/os_groups_Store.migrations new file mode 100644 index 0000000..4573f71 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/os_groups_Store.migrations @@ -0,0 +1,94 @@ +:VERSION 1 # -------------------------- + +BEGIN; + +CREATE TABLE os_groups_groups ( + "GroupID" char(36) Primary Key NOT NULL default '', + "Location" varchar(255) NOT NULL default '', + "Name" varchar(255) NOT NULL default '', + "Charter" text NOT NULL, + "InsigniaID" char(36) NOT NULL default '', + "FounderID" char(36) NOT NULL default '', + "MembershipFee" integer NOT NULL default '0', + "OpenEnrollment" varchar(255) NOT NULL default '', + "ShowInList" integer NOT NULL default '0', + "AllowPublish" integer NOT NULL default '0', + "MaturePublish" integer NOT NULL default '0', + "OwnerRoleID" char(36) NOT NULL default '' +); + + +CREATE TABLE os_groups_membership ( + "GroupID"char(36) NOT NULL default '', + "PrincipalID" VARCHAR(255) NOT NULL default '', + "SelectedRoleID" char(36) NOT NULL default '', + "Contribution" integer NOT NULL default '0', + "ListInProfile" integer NOT NULL default '1', + "AcceptNotices" integer NOT NULL default '1', + "AccessToken" char(36) NOT NULL default '', + constraint os_groupmemberpk primary key ("GroupID", "PrincipalID") +); + + + +CREATE TABLE os_groups_roles ( + "GroupID" char(36) NOT NULL default '', + "RoleID" char(36) NOT NULL default '', + "Name" varchar(255) NOT NULL default '', + "Description" varchar(255) NOT NULL default '', + "Title" varchar(255) NOT NULL default '', + "Powers" bigint NOT NULL default 0, + constraint os_grouprolepk PRIMARY KEY ("GroupID","RoleID") +); + + +CREATE TABLE os_groups_rolemembership ( + "GroupID" char(36) NOT NULL default '', + "RoleID" char(36) NOT NULL default '', + "PrincipalID" VARCHAR(255) NOT NULL default '', + constraint os_grouprolememberpk PRIMARY KEY ("GroupID","RoleID","PrincipalID") +); + + +CREATE TABLE os_groups_invites ( + "InviteID" char(36) NOT NULL default '', + "GroupID" char(36) NOT NULL default '', + "RoleID" char(36) NOT NULL default '', + "PrincipalID" VARCHAR(255) NOT NULL default '', + "TMStamp" timestamp NOT NULL default now(), + constraint os_groupinvitespk PRIMARY KEY ("InviteID") +); +-- UNIQUE KEY "PrincipalGroup" ("GroupID","PrincipalID") + + +CREATE TABLE os_groups_notices ( + "GroupID" char(36) NOT NULL default '', + "NoticeID" char(36) NOT NULL default '', + "TMStamp" integer NOT NULL default '0', + "FromName" varchar(255) NOT NULL default '', + "Subject" varchar(255) NOT NULL default '', + "Message" text NOT NULL, + "HasAttachment" integer NOT NULL default '0', + "AttachmentType" integer NOT NULL default '0', + "AttachmentName" varchar(128) NOT NULL default '', + "AttachmentItemID" char(36) NOT NULL default '', + "AttachmentOwnerID" varchar(255) NOT NULL default '', + constraint os_groupsnoticespk PRIMARY KEY ("NoticeID") +); +-- KEY "GroupID" ("GroupID"), +-- KEY "TMStamp" ("TMStamp") + +CREATE TABLE os_groups_principals ( + "PrincipalID" VARCHAR(255) NOT NULL default '', + "ActiveGroupID" char(36) NOT NULL default '', + constraint os_groupprincpk PRIMARY KEY ("PrincipalID") +); + +COMMIT; + +:VERSION 2 # -------------------------- + +BEGIN; + + +COMMIT; -- cgit v1.1