From 9b9804a498a3d48e7356c0a2cd12bf98887f5a53 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 8 Jun 2010 15:47:14 -0700 Subject: * Changed CreatorIDs consistently to varchar(128) * Deleted redundant migration for assets in SQLite * Rewrote XInventory migrations in SQLite in the new style --- .../Data/SQLite/Resources/001_XInventoryStore.sql | 38 ---------------- .../Data/SQLite/Resources/002_XInventoryStore.sql | 8 ---- OpenSim/Data/SQLite/Resources/005_AssetStore.sql | 5 --- .../Data/SQLite/Resources/AssetStore.migrations | 3 +- .../SQLite/Resources/XInventoryStore.migrations | 51 ++++++++++++++++++++++ 5 files changed, 53 insertions(+), 52 deletions(-) delete mode 100644 OpenSim/Data/SQLite/Resources/001_XInventoryStore.sql delete mode 100644 OpenSim/Data/SQLite/Resources/002_XInventoryStore.sql delete mode 100644 OpenSim/Data/SQLite/Resources/005_AssetStore.sql create mode 100644 OpenSim/Data/SQLite/Resources/XInventoryStore.migrations (limited to 'OpenSim/Data/SQLite/Resources') diff --git a/OpenSim/Data/SQLite/Resources/001_XInventoryStore.sql b/OpenSim/Data/SQLite/Resources/001_XInventoryStore.sql deleted file mode 100644 index 7e21996..0000000 --- a/OpenSim/Data/SQLite/Resources/001_XInventoryStore.sql +++ /dev/null @@ -1,38 +0,0 @@ -BEGIN TRANSACTION; - -CREATE TABLE inventoryfolders( - folderName varchar(255), - type integer, - version integer, - folderID varchar(255) primary key, - agentID varchar(255) not null default '00000000-0000-0000-0000-000000000000', - parentFolderID varchar(255) not null default '00000000-0000-0000-0000-000000000000'); - -CREATE TABLE inventoryitems( - assetID varchar(255), - assetType integer, - inventoryName varchar(255), - inventoryDescription varchar(255), - inventoryNextPermissions integer, - inventoryCurrentPermissions integer, - invType integer, - creatorID varchar(255), - inventoryBasePermissions integer, - inventoryEveryOnePermissions integer, - salePrice integer default 99, - saleType integer default 0, - creationDate integer default 2000, - groupID varchar(255) default '00000000-0000-0000-0000-000000000000', - groupOwned integer default 0, - flags integer default 0, - inventoryID varchar(255) primary key, - parentFolderID varchar(255) not null default '00000000-0000-0000-0000-000000000000', - avatarID varchar(255) not null default '00000000-0000-0000-0000-000000000000', - inventoryGroupPermissions integer not null default 0); - -create index inventoryfolders_agentid on inventoryfolders(agentID); -create index inventoryfolders_parentid on inventoryfolders(parentFolderID); -create index inventoryitems_parentfolderid on inventoryitems(parentFolderID); -create index inventoryitems_avatarid on inventoryitems(avatarID); - -COMMIT; diff --git a/OpenSim/Data/SQLite/Resources/002_XInventoryStore.sql b/OpenSim/Data/SQLite/Resources/002_XInventoryStore.sql deleted file mode 100644 index d38e2b7..0000000 --- a/OpenSim/Data/SQLite/Resources/002_XInventoryStore.sql +++ /dev/null @@ -1,8 +0,0 @@ -ATTACH 'inventoryStore.db' AS old; - -BEGIN TRANSACTION; - -INSERT INTO inventoryfolders (folderName, type, version, folderID, agentID, parentFolderID) SELECT `name` AS folderName, `type` AS type, `version` AS version, `UUID` AS folderID, `agentID` AS agentID, `parentID` AS parentFolderID from old.inventoryfolders; -INSERT INTO inventoryitems (assetID, assetType, inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType, creatorID, inventoryBasePermissions, inventoryEveryOnePermissions, salePrice, saleType, creationDate, groupID, groupOwned, flags, inventoryID, parentFolderID, avatarID, inventoryGroupPermissions) SELECT `assetID`, `assetType` AS assetType, `inventoryName` AS inventoryName, `inventoryDescription` AS inventoryDescription, `inventoryNextPermissions` AS inventoryNextPermissions, `inventoryCurrentPermissions` AS inventoryCurrentPermissions, `invType` AS invType, `creatorsID` AS creatorID, `inventoryBasePermissions` AS inventoryBasePermissions, `inventoryEveryOnePermissions` AS inventoryEveryOnePermissions, `salePrice` AS salePrice, `saleType` AS saleType, `creationDate` AS creationDate, `groupID` AS groupID, `groupOwned` AS groupOwned, `flags` AS flags, `UUID` AS inventoryID, `parentFolderID` AS parentFolderID, `avatarID` AS avatarID, `inventoryGroupPermissions` AS inventoryGroupPermissions FROM old.inventoryitems; - -COMMIT; diff --git a/OpenSim/Data/SQLite/Resources/005_AssetStore.sql b/OpenSim/Data/SQLite/Resources/005_AssetStore.sql deleted file mode 100644 index f06121a..0000000 --- a/OpenSim/Data/SQLite/Resources/005_AssetStore.sql +++ /dev/null @@ -1,5 +0,0 @@ -BEGIN; - -ALTER TABLE assets ADD COLUMN asset_flags INTEGER NOT NULL DEFAULT 0; - -COMMIT; diff --git a/OpenSim/Data/SQLite/Resources/AssetStore.migrations b/OpenSim/Data/SQLite/Resources/AssetStore.migrations index bc11e13..f20631c 100644 --- a/OpenSim/Data/SQLite/Resources/AssetStore.migrations +++ b/OpenSim/Data/SQLite/Resources/AssetStore.migrations @@ -55,7 +55,7 @@ CREATE TABLE assets( Local, Temporary, asset_flags INTEGER NOT NULL DEFAULT 0, - CreatorID varchar(36) default '', + CreatorID varchar(128) default '', Data); INSERT INTO assets(UUID,Name,Description,Type,Local,Temporary,Data) @@ -64,3 +64,4 @@ DROP TABLE assets_backup; COMMIT; + diff --git a/OpenSim/Data/SQLite/Resources/XInventoryStore.migrations b/OpenSim/Data/SQLite/Resources/XInventoryStore.migrations new file mode 100644 index 0000000..d5b3019 --- /dev/null +++ b/OpenSim/Data/SQLite/Resources/XInventoryStore.migrations @@ -0,0 +1,51 @@ +:VERSION 1 + +BEGIN TRANSACTION; + +CREATE TABLE inventoryfolders( + folderName varchar(64), + type integer, + version integer, + folderID varchar(36) primary key, + agentID varchar(36) not null default '00000000-0000-0000-0000-000000000000', + parentFolderID varchar(36) not null default '00000000-0000-0000-0000-000000000000'); + +CREATE TABLE inventoryitems( + assetID varchar(36), + assetType integer, + inventoryName varchar(64), + inventoryDescription varchar(128), + inventoryNextPermissions integer, + inventoryCurrentPermissions integer, + invType integer, + creatorID varchar(128), + inventoryBasePermissions integer, + inventoryEveryOnePermissions integer, + salePrice integer default 99, + saleType integer default 0, + creationDate integer default 2000, + groupID varchar(36) default '00000000-0000-0000-0000-000000000000', + groupOwned integer default 0, + flags integer default 0, + inventoryID varchar(36) primary key, + parentFolderID varchar(36) not null default '00000000-0000-0000-0000-000000000000', + avatarID varchar(36) not null default '00000000-0000-0000-0000-000000000000', + inventoryGroupPermissions integer not null default 0); + +create index inventoryfolders_agentid on inventoryfolders(agentID); +create index inventoryfolders_parentid on inventoryfolders(parentFolderID); +create index inventoryitems_parentfolderid on inventoryitems(parentFolderID); +create index inventoryitems_avatarid on inventoryitems(avatarID); + +COMMIT; + +:VERSION 2 + +ATTACH 'inventoryStore.db' AS old; + +BEGIN TRANSACTION; + +INSERT INTO inventoryfolders (folderName, type, version, folderID, agentID, parentFolderID) SELECT `name` AS folderName, `type` AS type, `version` AS version, `UUID` AS folderID, `agentID` AS agentID, `parentID` AS parentFolderID from old.inventoryfolders; +INSERT INTO inventoryitems (assetID, assetType, inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType, creatorID, inventoryBasePermissions, inventoryEveryOnePermissions, salePrice, saleType, creationDate, groupID, groupOwned, flags, inventoryID, parentFolderID, avatarID, inventoryGroupPermissions) SELECT `assetID`, `assetType` AS assetType, `inventoryName` AS inventoryName, `inventoryDescription` AS inventoryDescription, `inventoryNextPermissions` AS inventoryNextPermissions, `inventoryCurrentPermissions` AS inventoryCurrentPermissions, `invType` AS invType, `creatorsID` AS creatorID, `inventoryBasePermissions` AS inventoryBasePermissions, `inventoryEveryOnePermissions` AS inventoryEveryOnePermissions, `salePrice` AS salePrice, `saleType` AS saleType, `creationDate` AS creationDate, `groupID` AS groupID, `groupOwned` AS groupOwned, `flags` AS flags, `UUID` AS inventoryID, `parentFolderID` AS parentFolderID, `avatarID` AS avatarID, `inventoryGroupPermissions` AS inventoryGroupPermissions FROM old.inventoryitems; + +COMMIT; \ No newline at end of file -- cgit v1.1