change some mysql tables and columns character sets, this is close to patch at mantis 8707, but that is not correct. This should have no impact on current dbs. Many of those are now too large to do this change automaticl,, but they should. Some columns as utf8 (4 bytes in future) are pure waste of space, in fact some are used as indexes and can violate max index size. Namelly on groups V2, reason why we are forced to use utf8mb3 mostly likely to be dropped by new mysql/maria versions

This commit is contained in:
UbitUmarov
2020-11-14 17:21:10 +00:00
parent 7063013694
commit 9533217d82
5 changed files with 19 additions and 19 deletions

View File

@@ -14,7 +14,7 @@ CREATE TABLE `GridUser` (
`Login` CHAR(16) NOT NULL DEFAULT '0',
`Logout` CHAR(16) NOT NULL DEFAULT '0',
PRIMARY KEY (`UserID`)
) ENGINE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
COMMIT;

View File

@@ -12,7 +12,7 @@ CREATE TABLE `hg_traveling_data` (
`TMStamp` timestamp NOT NULL,
PRIMARY KEY (`SessionID`),
KEY (`UserID`)
) ENGINE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
COMMIT;

View File

@@ -11,6 +11,6 @@ CREATE TABLE `MuteList` (
`Stamp` int(11) NOT NULL,
UNIQUE KEY `AgentID_2` (`AgentID`,`MuteID`,`MuteName`),
KEY `AgentID` (`AgentID`)
);
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
COMMIT;

View File

@@ -12,13 +12,13 @@ CREATE TABLE IF NOT EXISTS `UserAccounts` (
`Created` int(11) DEFAULT NULL,
`UserLevel` int(11) NOT NULL DEFAULT '0',
`UserFlags` int(11) NOT NULL DEFAULT '0',
`UserTitle` varchar(64) NOT NULL DEFAULT '',
`UserTitle` varchar(64) CHARACTER SET utf8 NOT NULL DEFAULT '',
UNIQUE KEY `PrincipalID` (`PrincipalID`),
KEY `Email` (`Email`),
KEY `FirstName` (`FirstName`),
KEY `LastName` (`LastName`),
KEY `Name` (`FirstName`,`LastName`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
COMMIT;

View File

@@ -5,8 +5,8 @@ BEGIN;
CREATE TABLE `os_groups_groups` (
`GroupID` char(36) NOT NULL default '',
`Location` varchar(255) NOT NULL default '',
`Name` varchar(255) NOT NULL default '',
`Charter` text NOT NULL,
`Name` varchar(255) CHARACTER SET utf8 NOT NULL default '',
`Charter` text CHARACTER SET utf8 NOT NULL,
`InsigniaID` char(36) NOT NULL default '',
`FounderID` char(36) NOT NULL default '',
`MembershipFee` int(11) NOT NULL default '0',
@@ -18,7 +18,7 @@ CREATE TABLE `os_groups_groups` (
PRIMARY KEY (`GroupID`),
UNIQUE KEY `Name` (`Name`),
FULLTEXT KEY `Name_2` (`Name`)
) ENGINE=MyISAM;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `os_groups_membership` (
@@ -31,19 +31,19 @@ CREATE TABLE `os_groups_membership` (
`AccessToken` char(36) NOT NULL default '',
PRIMARY KEY (`GroupID`,`PrincipalID`),
KEY `PrincipalID` (`PrincipalID`)
) ENGINE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `os_groups_roles` (
`GroupID` char(36) NOT NULL default '',
`RoleID` char(36) NOT NULL default '',
`Name` varchar(255) NOT NULL default '',
`Description` varchar(255) NOT NULL default '',
`Title` varchar(255) NOT NULL default '',
`Name` varchar(255) CHARACTER SET utf8 NOT NULL default '',
`Description` varchar(255) CHARACTER SET utf8 NOT NULL default '',
`Title` varchar(255) CHARACTER SET utf8 NOT NULL default '',
`Powers` bigint(20) unsigned NOT NULL default '0',
PRIMARY KEY (`GroupID`,`RoleID`),
KEY `GroupID` (`GroupID`)
) ENGINE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `os_groups_rolemembership` (
@@ -52,7 +52,7 @@ CREATE TABLE `os_groups_rolemembership` (
`PrincipalID` VARCHAR(255) NOT NULL default '',
PRIMARY KEY (`GroupID`,`RoleID`,`PrincipalID`),
KEY `PrincipalID` (`PrincipalID`)
) ENGINE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `os_groups_invites` (
@@ -63,7 +63,7 @@ CREATE TABLE `os_groups_invites` (
`TMStamp` timestamp NOT NULL,
PRIMARY KEY (`InviteID`),
UNIQUE KEY `PrincipalGroup` (`GroupID`,`PrincipalID`)
) ENGINE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `os_groups_notices` (
@@ -71,8 +71,8 @@ CREATE TABLE `os_groups_notices` (
`NoticeID` char(36) NOT NULL default '',
`TMStamp` int(10) unsigned NOT NULL default '0',
`FromName` varchar(255) NOT NULL default '',
`Subject` varchar(255) NOT NULL default '',
`Message` text NOT NULL,
`Subject` varchar(255) CHARACTER SET utf8 NOT NULL default '',
`Message` text CHARACTER SET utf8 NOT NULL,
`HasAttachment` int(4) NOT NULL default '0',
`AttachmentType` int(4) NOT NULL default '0',
`AttachmentName` varchar(128) NOT NULL default '',
@@ -81,13 +81,13 @@ CREATE TABLE `os_groups_notices` (
PRIMARY KEY (`NoticeID`),
KEY `GroupID` (`GroupID`),
KEY `TMStamp` (`TMStamp`)
) ENGINE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `os_groups_principals` (
`PrincipalID` VARCHAR(255) NOT NULL default '',
`ActiveGroupID` char(36) NOT NULL default '',
PRIMARY KEY (`PrincipalID`)
) ENGINE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
COMMIT;