diff options
author | AlexRa | 2010-05-01 17:43:10 +0300 |
---|---|---|
committer | AlexRa | 2010-05-18 22:16:06 +0300 |
commit | e4419c34c30e1cf6529ced125f0c05aed24644a4 (patch) | |
tree | b54d5aff69c63fefc27dea2b938c1838974d77ac /OpenSim/Data/MySQL/Resources/InventoryStore.migrations | |
parent | Added MySqlMigrations.cs (supports stored proc/funcs) (diff) | |
download | opensim-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.migrations | 93 |
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 # ------------ | ||
2 | BEGIN; | ||
3 | |||
4 | CREATE 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 | |||
16 | CREATE 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 | |||
41 | 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; | ||