﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
31144	MySQL unique constraints incorrectly limited to 255 char when it should be 1000	Steven Mapes	nobody	"There is a bug within db.backends.mysql.validation.check_field_type where the maximum unique constraints is still being limited to 255 characters even though MySQL supports unique keys of up to 1000 characters by default and InnoDB supports 3072 bytes for InnoDB tables that use DYNAMIC or COMPRESSED row format and 767 bytes for InnoDB tables that use the REDUNDANT or COMPACT row format.

Reference  -
InnoDB - https://dev.mysql.com/doc/refman/8.0/en/innodb-limits.html

MyISAM - https://dev.mysql.com/doc/refman/8.0/en/myisam-storage-engine.html

Example

CREATE DATABASE `test`CHARACTER SET utf8 COLLATE utf8_general_ci; 
USE test;
{{{
CREATE TABLE `example_innodb` (
  `example1` VARCHAR(1024) DEFAULT NULL,
  `example2` VARCHAR(1024) DEFAULT NULL,
  UNIQUE KEY `UQ_example1` (`example1`),
  UNIQUE KEY `UQ_example2` (`example2`)
) ENGINE=INNODB DEFAULT CHARSET=utf8

DROP TABLE example_innodb;
DROP DATABASE test;
}}}

It just needs the max length to be increased on line 38 of db.backends.mysql.validation"	Bug	new	Database layer (models, ORM)	3.0	Normal		MySQL, MAriaDB, Unique		Unreviewed	0	0	0	0	0	0
