aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite/Resources/InventoryStore.migrations
blob: 585ac498e65ccaf68b6cf4778e49074ad35cb620 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
:VERSION 1

BEGIN TRANSACTION;

CREATE TABLE inventoryfolders(
       UUID varchar(255) primary key,
       name varchar(255),
       agentID varchar(255),
       parentID varchar(255),
       type integer,
       version integer);

CREATE TABLE inventoryitems(
       UUID varchar(255) primary key,
       assetID varchar(255),
       assetType integer,
       invType integer,
       parentFolderID varchar(255),
       avatarID varchar(255),
       creatorsID varchar(255),
       inventoryName varchar(255),
       inventoryDescription varchar(255),
       inventoryNextPermissions integer,
       inventoryCurrentPermissions integer,
       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);

COMMIT;

:VERSION 2

BEGIN TRANSACTION;

create index inventoryfolders_agentid on inventoryfolders(agentid);
create index inventoryfolders_parentid on inventoryfolders(parentid);
create index inventoryitems_parentfolderid on inventoryitems(parentfolderid);
create index inventoryitems_avatarid on inventoryitems(avatarid);

COMMIT;

:VERSION 3

BEGIN;

alter table inventoryitems add column inventoryGroupPermissions integer unsigned not null default 0;

COMMIT;

:VERSION 4

BEGIN;

update inventoryitems 
  set UUID = substr(UUID, 1, 8) || "-" || substr(UUID, 9, 4) || "-" || substr(UUID, 13, 4) || "-" || substr(UUID, 17, 4) || "-" || substr(UUID, 21, 12)
  where UUID not like '%-%';

update inventoryitems
  set assetID = substr(assetID, 1, 8) || "-" || substr(assetID, 9, 4) || "-" || substr(assetID, 13, 4) || "-" || substr(assetID, 17, 4) || "-" || substr(assetID, 21, 12) 
  where assetID not like '%-%';

update inventoryitems
  set parentFolderID = substr(parentFolderID, 1, 8) || "-" || substr(parentFolderID, 9, 4) || "-" || substr(parentFolderID, 13, 4) || "-" || substr(parentFolderID, 17, 4) || "-" || substr(parentFolderID, 21, 12) 
  where parentFolderID not like '%-%';

update inventoryitems
  set avatarID = substr(avatarID, 1, 8) || "-" || substr(avatarID, 9, 4) || "-" || substr(avatarID, 13, 4) || "-" || substr(avatarID, 17, 4) || "-" || substr(avatarID, 21, 12) 
  where avatarID not like '%-%';

update inventoryitems
  set creatorsID = substr(creatorsID, 1, 8) || "-" || substr(creatorsID, 9, 4) || "-" || substr(creatorsID, 13, 4) || "-" || substr(creatorsID, 17, 4) || "-" || substr(creatorsID, 21, 12)
  where creatorsID not like '%-%';


update inventoryfolders
  set UUID = substr(UUID, 1, 8) || "-" || substr(UUID, 9, 4) || "-" || substr(UUID, 13, 4) || "-" || substr(UUID, 17, 4) || "-" || substr(UUID, 21, 12)
  where UUID not like '%-%';

update inventoryfolders
  set agentID = substr(agentID, 1, 8) || "-" || substr(agentID, 9, 4) || "-" || substr(agentID, 13, 4) || "-" || substr(agentID, 17, 4) || "-" || substr(agentID, 21, 12)
  where agentID not like '%-%';

update inventoryfolders
  set parentID = substr(parentID, 1, 8) || "-" || substr(parentID, 9, 4) || "-" || substr(parentID, 13, 4) || "-" || substr(parentID, 17, 4) || "-" || substr(parentID, 21, 12)
  where parentID not like '%-%';

COMMIT;