I have a table with a primary key that is a varchar(255). Some cases have arisen where 255 characters isn\'t enough. I tried changing the field to a text, but I get the foll
I know it's quite late, but removing the Unique Key
Constraint solved the problem. I didn't use the TEXT
or LONGTEXT
column as PK , but I was trying to make it unique. I got the 1170 error
, but when I removed UK
, the error was removed too.
I don't fully understand why.
You can specify the key length in the alter table request, something like:
alter table authors ADD UNIQUE(name_first(20), name_second(20));
Go to mysql edit table
-> change column type to varchar(45)
.
Use like this
@Id
@Column(name = "userEmailId", length=100)
private String userEmailId;