diff options
Diffstat (limited to 'OpenSim/Data/MySQL/Resources/InventoryStore.migrations')
-rw-r--r-- | OpenSim/Data/MySQL/Resources/InventoryStore.migrations | 137 |
1 files changed, 35 insertions, 102 deletions
diff --git a/OpenSim/Data/MySQL/Resources/InventoryStore.migrations b/OpenSim/Data/MySQL/Resources/InventoryStore.migrations index 993a5a0..2d4384c 100644 --- a/OpenSim/Data/MySQL/Resources/InventoryStore.migrations +++ b/OpenSim/Data/MySQL/Resources/InventoryStore.migrations | |||
@@ -1,109 +1,42 @@ | |||
1 | :VERSION 1 # ------------ | 1 | :VERSION 7 # ------------ |
2 | BEGIN; | 2 | BEGIN; |
3 | 3 | ||
4 | CREATE TABLE `inventoryfolders` ( | 4 | CREATE TABLE IF NOT EXISTS `inventoryitems` ( |
5 | `folderID` varchar(36) NOT NULL default '', | 5 | `assetID` varchar(36) DEFAULT NULL, |
6 | `agentID` varchar(36) default NULL, | 6 | `assetType` int(11) DEFAULT NULL, |
7 | `parentFolderID` varchar(36) default NULL, | 7 | `inventoryName` varchar(64) DEFAULT NULL, |
8 | `folderName` varchar(64) default NULL, | 8 | `inventoryDescription` varchar(128) DEFAULT NULL, |
9 | `type` smallint NOT NULL default 0, | 9 | `inventoryNextPermissions` int(10) unsigned DEFAULT NULL, |
10 | `version` int NOT NULL default 0, | 10 | `inventoryCurrentPermissions` int(10) unsigned DEFAULT NULL, |
11 | PRIMARY KEY (`folderID`), | 11 | `invType` int(11) DEFAULT NULL, |
12 | KEY `owner` (`agentID`), | 12 | `creatorID` varchar(255) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000', |
13 | KEY `parent` (`parentFolderID`) | 13 | `inventoryBasePermissions` int(10) unsigned NOT NULL DEFAULT '0', |
14 | `inventoryEveryOnePermissions` int(10) unsigned NOT NULL DEFAULT '0', | ||
15 | `salePrice` int(11) NOT NULL DEFAULT '0', | ||
16 | `saleType` tinyint(4) NOT NULL DEFAULT '0', | ||
17 | `creationDate` int(11) NOT NULL DEFAULT '0', | ||
18 | `groupID` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000', | ||
19 | `groupOwned` tinyint(4) NOT NULL DEFAULT '0', | ||
20 | `flags` int(11) unsigned NOT NULL DEFAULT '0', | ||
21 | `inventoryID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000', | ||
22 | `avatarID` char(36) DEFAULT NULL, | ||
23 | `parentFolderID` char(36) DEFAULT NULL, | ||
24 | `inventoryGroupPermissions` int(10) unsigned NOT NULL DEFAULT '0', | ||
25 | PRIMARY KEY (`inventoryID`), | ||
26 | KEY `inventoryitems_avatarid` (`avatarID`), | ||
27 | KEY `inventoryitems_parentFolderid` (`parentFolderID`) | ||
14 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | 28 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
15 | 29 | ||
16 | CREATE TABLE `inventoryitems` ( | 30 | CREATE TABLE IF NOT EXISTS `inventoryfolders` ( |
17 | `inventoryID` varchar(36) NOT NULL default '', | 31 | `folderName` varchar(64) DEFAULT NULL, |
18 | `assetID` varchar(36) default NULL, | 32 | `type` smallint(6) NOT NULL DEFAULT '0', |
19 | `assetType` int(11) default NULL, | 33 | `version` int(11) NOT NULL DEFAULT '0', |
20 | `parentFolderID` varchar(36) default NULL, | 34 | `folderID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000', |
21 | `avatarID` varchar(36) default NULL, | 35 | `agentID` char(36) DEFAULT NULL, |
22 | `inventoryName` varchar(64) default NULL, | 36 | `parentFolderID` char(36) DEFAULT NULL, |
23 | `inventoryDescription` varchar(128) default NULL, | 37 | PRIMARY KEY (`folderID`), |
24 | `inventoryNextPermissions` int(10) unsigned default NULL, | 38 | KEY `inventoryfolders_agentid` (`agentID`), |
25 | `inventoryCurrentPermissions` int(10) unsigned default NULL, | 39 | KEY `inventoryfolders_parentFolderid` (`parentFolderID`) |
26 | `invType` int(11) default NULL, | ||
27 | `creatorID` varchar(36) default NULL, | ||
28 | `inventoryBasePermissions` int(10) unsigned NOT NULL default 0, | ||
29 | `inventoryEveryOnePermissions` int(10) unsigned NOT NULL default 0, | ||
30 | `salePrice` int(11) NOT NULL default 0, | ||
31 | `saleType` tinyint(4) NOT NULL default 0, | ||
32 | `creationDate` int(11) NOT NULL default 0, | ||
33 | `groupID` varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000', | ||
34 | `groupOwned` tinyint(4) NOT NULL default 0, | ||
35 | `flags` int(11) unsigned NOT NULL default 0, | ||
36 | PRIMARY KEY (`inventoryID`), | ||
37 | KEY `owner` (`avatarID`), | ||
38 | KEY `folder` (`parentFolderID`) | ||
39 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | 40 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
40 | 41 | ||
41 | COMMIT; | 42 | COMMIT; |
42 | |||
43 | :VERSION 2 # ------------ | ||
44 | |||
45 | BEGIN; | ||
46 | |||
47 | ALTER TABLE inventoryfolders change folderID folderIDold varchar(36); | ||
48 | ALTER TABLE inventoryfolders change agentID agentIDold varchar(36); | ||
49 | ALTER TABLE inventoryfolders change parentFolderID parentFolderIDold varchar(36); | ||
50 | ALTER TABLE inventoryfolders add folderID char(36) not null default '00000000-0000-0000-0000-000000000000'; | ||
51 | ALTER TABLE inventoryfolders add agentID char(36) default NULL; | ||
52 | ALTER TABLE inventoryfolders add parentFolderID char(36) default NULL; | ||
53 | UPDATE inventoryfolders set folderID = folderIDold, agentID = agentIDold, parentFolderID = parentFolderIDold; | ||
54 | ALTER TABLE inventoryfolders drop folderIDold; | ||
55 | ALTER TABLE inventoryfolders drop agentIDold; | ||
56 | ALTER TABLE inventoryfolders drop parentFolderIDold; | ||
57 | ALTER TABLE inventoryfolders add constraint primary key(folderID); | ||
58 | ALTER TABLE inventoryfolders add index inventoryfolders_agentid(agentID); | ||
59 | ALTER TABLE inventoryfolders add index inventoryfolders_parentFolderid(parentFolderID); | ||
60 | |||
61 | ALTER TABLE inventoryitems change inventoryID inventoryIDold varchar(36); | ||
62 | ALTER TABLE inventoryitems change avatarID avatarIDold varchar(36); | ||
63 | ALTER TABLE inventoryitems change parentFolderID parentFolderIDold varchar(36); | ||
64 | ALTER TABLE inventoryitems add inventoryID char(36) not null default '00000000-0000-0000-0000-000000000000'; | ||
65 | ALTER TABLE inventoryitems add avatarID char(36) default NULL; | ||
66 | ALTER TABLE inventoryitems add parentFolderID char(36) default NULL; | ||
67 | UPDATE inventoryitems set inventoryID = inventoryIDold, avatarID = avatarIDold, parentFolderID = parentFolderIDold; | ||
68 | ALTER TABLE inventoryitems drop inventoryIDold; | ||
69 | ALTER TABLE inventoryitems drop avatarIDold; | ||
70 | ALTER TABLE inventoryitems drop parentFolderIDold; | ||
71 | ALTER TABLE inventoryitems add constraint primary key(inventoryID); | ||
72 | ALTER TABLE inventoryitems add index inventoryitems_avatarid(avatarID); | ||
73 | ALTER TABLE inventoryitems add index inventoryitems_parentFolderid(parentFolderID); | ||
74 | |||
75 | COMMIT; | ||
76 | |||
77 | :VERSION 3 # ------------ | ||
78 | |||
79 | BEGIN; | ||
80 | |||
81 | alter table inventoryitems add column inventoryGroupPermissions integer unsigned not null default 0; | ||
82 | |||
83 | COMMIT; | ||
84 | |||
85 | :VERSION 4 # ------------ | ||
86 | |||
87 | BEGIN; | ||
88 | |||
89 | update inventoryitems set creatorID = '00000000-0000-0000-0000-000000000000' where creatorID is NULL; | ||
90 | update inventoryitems set creatorID = '00000000-0000-0000-0000-000000000000' where creatorID = ''; | ||
91 | alter table inventoryitems modify column creatorID varchar(36) not NULL default '00000000-0000-0000-0000-000000000000'; | ||
92 | |||
93 | COMMIT; | ||
94 | |||
95 | :VERSION 5 # ------------ | ||
96 | |||
97 | BEGIN; | ||
98 | |||
99 | alter table inventoryitems modify column creatorID varchar(128) not NULL default '00000000-0000-0000-0000-000000000000'; | ||
100 | |||
101 | COMMIT; | ||
102 | |||
103 | :VERSION 6 # ------------ | ||
104 | |||
105 | BEGIN; | ||
106 | |||
107 | alter table inventoryitems modify column creatorID varchar(255) not NULL default '00000000-0000-0000-0000-000000000000'; | ||
108 | |||
109 | COMMIT; | ||