aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/Resources/InventoryStore.migrations
diff options
context:
space:
mode:
authorAlexRa2010-05-01 17:43:10 +0300
committerAlexRa2010-05-18 22:16:06 +0300
commite4419c34c30e1cf6529ced125f0c05aed24644a4 (patch)
treeb54d5aff69c63fefc27dea2b938c1838974d77ac /OpenSim/Data/MySQL/Resources/InventoryStore.migrations
parentAdded MySqlMigrations.cs (supports stored proc/funcs) (diff)
downloadopensim-SC-e4419c34c30e1cf6529ced125f0c05aed24644a4.zip
opensim-SC-e4419c34c30e1cf6529ced125f0c05aed24644a4.tar.gz
opensim-SC-e4419c34c30e1cf6529ced125f0c05aed24644a4.tar.bz2
opensim-SC-e4419c34c30e1cf6529ced125f0c05aed24644a4.tar.xz
Converted MySQL migration history to the new format
Replaced all NNN_StoreName.sql migration resources with a more readable, single-file-per-store
Diffstat (limited to 'OpenSim/Data/MySQL/Resources/InventoryStore.migrations')
-rw-r--r--OpenSim/Data/MySQL/Resources/InventoryStore.migrations93
1 files changed, 93 insertions, 0 deletions
diff --git a/OpenSim/Data/MySQL/Resources/InventoryStore.migrations b/OpenSim/Data/MySQL/Resources/InventoryStore.migrations
new file mode 100644
index 0000000..8c5864e
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/InventoryStore.migrations
@@ -0,0 +1,93 @@
1:VERSION 1 # ------------
2BEGIN;
3
4CREATE TABLE `inventoryfolders` (
5 `folderID` varchar(36) NOT NULL default '',
6 `agentID` varchar(36) default NULL,
7 `parentFolderID` varchar(36) default NULL,
8 `folderName` varchar(64) default NULL,
9 `type` smallint NOT NULL default 0,
10 `version` int NOT NULL default 0,
11 PRIMARY KEY (`folderID`),
12 KEY `owner` (`agentID`),
13 KEY `parent` (`parentFolderID`)
14) ENGINE=InnoDB DEFAULT CHARSET=utf8;
15
16CREATE TABLE `inventoryitems` (
17 `inventoryID` varchar(36) NOT NULL default '',
18 `assetID` varchar(36) default NULL,
19 `assetType` int(11) default NULL,
20 `parentFolderID` varchar(36) default NULL,
21 `avatarID` varchar(36) default NULL,
22 `inventoryName` varchar(64) default NULL,
23 `inventoryDescription` varchar(128) default NULL,
24 `inventoryNextPermissions` int(10) unsigned default NULL,
25 `inventoryCurrentPermissions` int(10) unsigned default NULL,
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
41COMMIT;
42
43:VERSION 2 # ------------
44
45BEGIN;
46
47ALTER TABLE inventoryfolders change folderID folderIDold varchar(36);
48ALTER TABLE inventoryfolders change agentID agentIDold varchar(36);
49ALTER TABLE inventoryfolders change parentFolderID parentFolderIDold varchar(36);
50ALTER TABLE inventoryfolders add folderID char(36) not null default '00000000-0000-0000-0000-000000000000';
51ALTER TABLE inventoryfolders add agentID char(36) default NULL;
52ALTER TABLE inventoryfolders add parentFolderID char(36) default NULL;
53UPDATE inventoryfolders set folderID = folderIDold, agentID = agentIDold, parentFolderID = parentFolderIDold;
54ALTER TABLE inventoryfolders drop folderIDold;
55ALTER TABLE inventoryfolders drop agentIDold;
56ALTER TABLE inventoryfolders drop parentFolderIDold;
57ALTER TABLE inventoryfolders add constraint primary key(folderID);
58ALTER TABLE inventoryfolders add index inventoryfolders_agentid(agentID);
59ALTER TABLE inventoryfolders add index inventoryfolders_parentFolderid(parentFolderID);
60
61ALTER TABLE inventoryitems change inventoryID inventoryIDold varchar(36);
62ALTER TABLE inventoryitems change avatarID avatarIDold varchar(36);
63ALTER TABLE inventoryitems change parentFolderID parentFolderIDold varchar(36);
64ALTER TABLE inventoryitems add inventoryID char(36) not null default '00000000-0000-0000-0000-000000000000';
65ALTER TABLE inventoryitems add avatarID char(36) default NULL;
66ALTER TABLE inventoryitems add parentFolderID char(36) default NULL;
67UPDATE inventoryitems set inventoryID = inventoryIDold, avatarID = avatarIDold, parentFolderID = parentFolderIDold;
68ALTER TABLE inventoryitems drop inventoryIDold;
69ALTER TABLE inventoryitems drop avatarIDold;
70ALTER TABLE inventoryitems drop parentFolderIDold;
71ALTER TABLE inventoryitems add constraint primary key(inventoryID);
72ALTER TABLE inventoryitems add index inventoryitems_avatarid(avatarID);
73ALTER TABLE inventoryitems add index inventoryitems_parentFolderid(parentFolderID);
74
75COMMIT;
76
77:VERSION 3 # ------------
78
79BEGIN;
80
81alter table inventoryitems add column inventoryGroupPermissions integer unsigned not null default 0;
82
83COMMIT;
84
85:VERSION 4 # ------------
86
87BEGIN;
88
89update inventoryitems set creatorID = '00000000-0000-0000-0000-000000000000' where creatorID is NULL;
90update inventoryitems set creatorID = '00000000-0000-0000-0000-000000000000' where creatorID = '';
91alter table inventoryitems modify column creatorID varchar(36) not NULL default '00000000-0000-0000-0000-000000000000';
92
93COMMIT;