When generating my Tables using Entity Framework Core for MySQL all of the string properties are being created as text columns in MySQL
I am using:
<PackageReference Include="MySql.Data" Version="8.0.8-*" /> <PackageReference Include="MySql.Data.EntityFrameworkCore" Version="8.0.8-*" />
I am trying to use the built in Identity authentication in .net and when I generate the tables I get the error:
BLOB/TEXT column 'NormalizedEmail' used in key specification without a key length
I can work around this by adding:
builder.Entity<IdentityRole>().Property(i => i.NormalizedName) .HasColumnType("varchar(256)");
But I don't want to do this for every column in the Identity Model nor do I really want columns I add like FirstName being stored as a text column.
Is this a bug in EF Core for MySQL or do I have some configuration wrong?
Thanks to @Tseng for the recommendation of using Pomelo. It was a simple switch and it solved all of my problems.