From 3fa54a156a83e498a7d5d0949a5f848fe82fe86f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 1 Jun 2011 20:02:26 -0700 Subject: Changed Friends table to have 165-sized varchars on PrincipalID and FriendID. The reason for this number is the following: there is a combined key of these 2 fields; apparently MySql can't handle keys larger than 1000 bytes; when the table is created with utf8 encoding, this combined key is bigger than 1000 bytes, and the migration fails. WARNING: this is not a new migration! People who have gone through this migration and failed should update the sizes of these fields manually. --- OpenSim/Data/MySQL/Resources/FriendsStore.migrations | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Data/MySQL/Resources/FriendsStore.migrations') diff --git a/OpenSim/Data/MySQL/Resources/FriendsStore.migrations b/OpenSim/Data/MySQL/Resources/FriendsStore.migrations index 35e5e93..5abacf5 100644 --- a/OpenSim/Data/MySQL/Resources/FriendsStore.migrations +++ b/OpenSim/Data/MySQL/Resources/FriendsStore.migrations @@ -25,7 +25,8 @@ COMMIT; BEGIN; -ALTER TABLE `Friends` MODIFY COLUMN PrincipalID varchar(255) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'; +ALTER TABLE `Friends` MODIFY COLUMN PrincipalID varchar(165) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'; +ALTER TABLE `Friends` MODIFY COLUMN Friend varchar(165) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'; COMMIT; -- cgit v1.1 From 43ecc46a224d07661af42379f12f394e1bd873fd Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 1 Jun 2011 20:09:59 -0700 Subject: It looks like there's a better solution for that problem. Revert "Changed Friends table to have 165-sized varchars on PrincipalID and FriendID. The reason for this number is the following: there is a combined key of these 2 fields; apparently MySql can't handle keys larger than 1000 bytes; when the table is created with utf8 encoding, this combined key is bigger than 1000 bytes, and the migration fails. WARNING: this is not a new migration! People who have gone through this migration and failed should update the sizes of these fields manually." This reverts commit 3fa54a156a83e498a7d5d0949a5f848fe82fe86f. --- OpenSim/Data/MySQL/Resources/FriendsStore.migrations | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'OpenSim/Data/MySQL/Resources/FriendsStore.migrations') diff --git a/OpenSim/Data/MySQL/Resources/FriendsStore.migrations b/OpenSim/Data/MySQL/Resources/FriendsStore.migrations index 5abacf5..35e5e93 100644 --- a/OpenSim/Data/MySQL/Resources/FriendsStore.migrations +++ b/OpenSim/Data/MySQL/Resources/FriendsStore.migrations @@ -25,8 +25,7 @@ COMMIT; BEGIN; -ALTER TABLE `Friends` MODIFY COLUMN PrincipalID varchar(165) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'; -ALTER TABLE `Friends` MODIFY COLUMN Friend varchar(165) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'; +ALTER TABLE `Friends` MODIFY COLUMN PrincipalID varchar(255) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'; COMMIT; -- cgit v1.1 From c13acdf5a1a94df9b0ef50b7b2739a9256656582 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 1 Jun 2011 20:19:22 -0700 Subject: This is the better solution: make the combined key be only on the first 36 characters of each field -- that's the UUIDs. Thanks coyled. WARNING: Again, people who have gone through this migration and failed need to run it manually. --- OpenSim/Data/MySQL/Resources/FriendsStore.migrations | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Data/MySQL/Resources/FriendsStore.migrations') diff --git a/OpenSim/Data/MySQL/Resources/FriendsStore.migrations b/OpenSim/Data/MySQL/Resources/FriendsStore.migrations index 35e5e93..7848e49 100644 --- a/OpenSim/Data/MySQL/Resources/FriendsStore.migrations +++ b/OpenSim/Data/MySQL/Resources/FriendsStore.migrations @@ -25,7 +25,8 @@ COMMIT; BEGIN; +ALTER TABLE `Friends` DROP PRIMARY KEY; +ALTER TABLE `Friends` ADD PRIMARY KEY(PrincipalID(36), Friend(36)); ALTER TABLE `Friends` MODIFY COLUMN PrincipalID varchar(255) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'; COMMIT; - -- cgit v1.1