* Changed CreatorIDs consistently to varchar(128)

* Deleted redundant migration for assets in SQLite
* Rewrote XInventory migrations in SQLite in the new style
soprefactor
Diva Canto 2010-06-08 15:47:14 -07:00
parent c8b301a644
commit 9b9804a498
8 changed files with 66 additions and 53 deletions

View File

@ -73,5 +73,5 @@ ALTER TABLE assets ADD COLUMN asset_flags INTEGER NOT NULL DEFAULT 0;
:VERSION 8
ALTER TABLE assets ADD COLUMN CreatorID varchar(36) NOT NULL DEFAULT '';
ALTER TABLE assets ADD COLUMN CreatorID varchar(128) NOT NULL DEFAULT '';

View File

@ -91,3 +91,11 @@ update inventoryitems set creatorID = '00000000-0000-0000-0000-000000000000' whe
alter table inventoryitems modify column creatorID varchar(36) not NULL default '00000000-0000-0000-0000-000000000000';
COMMIT;
:VERSION 5 # ------------
BEGIN;
alter table inventoryitems modify column creatorID varchar(128) not NULL default '00000000-0000-0000-0000-000000000000';
COMMIT;

View File

@ -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;

View File

@ -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;

View File

@ -1,5 +0,0 @@
BEGIN;
ALTER TABLE assets ADD COLUMN asset_flags INTEGER NOT NULL DEFAULT 0;
COMMIT;

View File

@ -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;

View File

@ -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;

View File

@ -95,6 +95,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
try
{
asset1.ID = url + "/" + asset.ID;
UUID temp = UUID.Zero;
// TODO: if the creator is local, stick this grid's URL in front
//if (UUID.TryParse(asset.Metadata.CreatorID, out temp))
// asset1.Metadata.CreatorID = ??? + "/" + asset.Metadata.CreatorID;
}
catch
{