I know this question has been asked many times before, however I'm really struggling applying those answers to this problem.
I'm migrating a database from Postgres to MariaDB using MySQL Workbench.
Here is the table I'm having trouble with
CREATE TABLE IF NOT EXISTS `postgres`.`oldimage` (
`oi_name` LONGTEXT NOT NULL,
`oi_archive_name` LONGTEXT NOT NULL,
`oi_size` INT NOT NULL,
`oi_width` INT NOT NULL,
`oi_height` INT NOT NULL,
`oi_bits` SMALLINT NULL,
`oi_description` LONGTEXT NULL,
`oi_user` INT NULL,
`oi_user_text` LONGTEXT NOT NULL,
`oi_timestamp` DATETIME NULL,
`oi_metadata` LONGBLOB NOT NULL,
`oi_media_type` LONGTEXT NULL,
`oi_major_mime` LONGTEXT NULL,
`oi_minor_mime` LONGTEXT NULL,
`oi_deleted` SMALLINT NOT NULL DEFAULT 0,
`oi_sha1` LONGTEXT NOT NULL DEFAULT '',
INDEX `oi_name_archive_name` (`oi_name`(255) ASC, `oi_archive_name`(255) ASC),
INDEX `oi_name_timestamp` (`oi_name`(255) ASC, `oi_timestamp` ASC),
INDEX `oi_sha1` (`oi_sha1`(255) ASC),
CONSTRAINT `oldimage_oi_name_fkey_cascaded`
FOREIGN KEY (`oi_name`)
REFERENCES `postgres`.`image` (`img_name`)
ON DELETE CASCADE
ON UPDATE CASCADE,
CONSTRAINT `oldimage_oi_user_fkey`
FOREIGN KEY (`oi_user`)
REFERENCES `postgres`.`mwuser` (`user_id`)
ON DELETE SET NULL
ON UPDATE NO ACTION)
The error I'm getting is
BLOB/TEXT column 'oi_name' used in key specification without a key length
SQL Error: 1170
I've tried making oi_name the PRIMARY KEY, as well I've tried changing it to VARCHAR(255), no luck with either.
Any help is greatly appreciated.