The compare schema with new schema having new index on a longtext type column is generating wrong index statement.
Table:
CREATE TABLE `ROLE_PERMISSION` (
`id` varchar(255) NOT NULL,
`externalId` varchar(255) DEFAULT NULL,
`fdn` longtext,
`version` bigint(20) NOT NULL,
`createAccess` bit(1) DEFAULT NULL,
`cudChildren` bit(1) DEFAULT NULL,
`deleteAccess` bit(1) DEFAULT NULL,
`endPointType` varchar(255) NOT NULL,
`noAccess` bit(1) DEFAULT NULL,
`noAccessChildren` bit(1) DEFAULT NULL,
`readAccess` bit(1) DEFAULT NULL,
`readChildren` bit(1) DEFAULT NULL,
`updateAccess` bit(1) DEFAULT NULL,
`useAccess` bit(1) DEFAULT NULL,
`assocEntityId` varchar(255) DEFAULT NULL,
`assocEntityType` varchar(255) DEFAULT NULL,
`permissionMatchFdn` longtext,
`role_id` varchar(255) NOT NULL,
`role_entry_id` varchar(255) NOT NULL,
`group_id` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `group_id` (`group_id`,`assocEntityType`,`assocEntityId`,`endPointType`),
KEY `single_column_index` (`assocEntityId`),
KEY `FK9C6EC938D6B4EA8D` (`role_id`),
KEY `FK9C6EC9385CEC0D24` (`group_id`),
KEY `FK9C6EC9384EF4929A` (`role_entry_id`),
CONSTRAINT `FK9C6EC9384EF4929A` FOREIGN KEY (`role_entry_id`) REFERENCES `ROLE_ENTRY` (`id`),
CONSTRAINT `FK9C6EC9385CEC0D24` FOREIGN KEY (`group_id`) REFERENCES `ORG_GROUP` (`id`),
CONSTRAINT `FK9C6EC938D6B4EA8D` FOREIGN KEY (`role_id`) REFERENCES `ROLE` (`id`)
)
Index:
create index fdn_column_index on ROLE_PERMISSION (fdn(255));
Schema compare is generating:
CREATE INDEX fdn_column_index ON ROLE_PERMISSION (fdn ASC);
You can see the length attribute is missing in schema compare which is wrong SQL statement.
Any help on how to correct this?