diff options
Diffstat (limited to 'OpenSim/Data/MySQL/Resources/FriendsStore.migrations')
-rw-r--r-- | OpenSim/Data/MySQL/Resources/FriendsStore.migrations | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/OpenSim/Data/MySQL/Resources/FriendsStore.migrations b/OpenSim/Data/MySQL/Resources/FriendsStore.migrations index 5faf956..8e304de 100644 --- a/OpenSim/Data/MySQL/Resources/FriendsStore.migrations +++ b/OpenSim/Data/MySQL/Resources/FriendsStore.migrations | |||
@@ -1,32 +1,14 @@ | |||
1 | :VERSION 1 # ------------------------- | 1 | :VERSION 4 # ------------------------- |
2 | 2 | ||
3 | BEGIN; | 3 | BEGIN; |
4 | 4 | ||
5 | CREATE TABLE `Friends` ( | 5 | CREATE TABLE IF NOT EXISTS `friends` ( |
6 | `PrincipalID` CHAR(36) NOT NULL, | 6 | `PrincipalID` varchar(255) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000', |
7 | `Friend` VARCHAR(255) NOT NULL, | 7 | `Friend` varchar(255) NOT NULL, |
8 | `Flags` VARCHAR(16) NOT NULL DEFAULT 0, | 8 | `Flags` varchar(16) NOT NULL DEFAULT '0', |
9 | `Offered` VARCHAR(32) NOT NULL DEFAULT 0, | 9 | `Offered` varchar(32) NOT NULL DEFAULT '0', |
10 | PRIMARY KEY(`PrincipalID`, `Friend`), | 10 | PRIMARY KEY (`PrincipalID`(36),`Friend`(36)), |
11 | KEY(`PrincipalID`) | 11 | KEY `PrincipalID` (`PrincipalID`) |
12 | ) ENGINE=InnoDB; | 12 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
13 | |||
14 | COMMIT; | ||
15 | |||
16 | :VERSION 2 # ------------------------- | ||
17 | |||
18 | BEGIN; | ||
19 | |||
20 | INSERT INTO `Friends` SELECT `ownerID`, `friendID`, `friendPerms`, 0 FROM `userfriends`; | ||
21 | |||
22 | COMMIT; | ||
23 | |||
24 | :VERSION 3 # ------------------------- | ||
25 | |||
26 | BEGIN; | ||
27 | |||
28 | ALTER TABLE `Friends` MODIFY COLUMN PrincipalID varchar(255) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'; | ||
29 | ALTER TABLE `Friends` DROP PRIMARY KEY; | ||
30 | ALTER TABLE `Friends` ADD PRIMARY KEY(PrincipalID(36), Friend(36)); | ||
31 | 13 | ||
32 | COMMIT; | 14 | COMMIT; |