ALTER TABLE `accesscustom`
MODIFY COLUMN `role`  varchar(255) NOT NULL AFTER `group`;

UPDATE `accessroles` AS r, `accesscustom` AS c
SET c.`role`=r.`role`
WHERE c.`role`=r.`id`;

ALTER TABLE `accessroles`
DROP COLUMN `id`,
MODIFY COLUMN `role`  varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL FIRST ,
DROP PRIMARY KEY,
ADD PRIMARY KEY (`role`);

