aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite/Resources/XInventoryStore.migrations
blob: de44982710b147429799104b0376eb907351771a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
: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

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;