dotnet / dotnet/aspnetcore

EntityFramework Migration for ASP.Net Core Identity creates Key without key length

Open
#28,055 6 comments 0 reactions 0 assignees View on GitHub
affected-few area-identity enhancement severity-minor
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

Using ASP.Net Core Identity and EntityFramework, the migration code generated created key (for tables like ApplicationUser, from IdentityUser) with Id and no key length.

Getting an error when running with MySql:

> MySqlConnector.MySqlException (0x80004005): BLOB/TEXT column 'Id' used
> in key specification without a key length

For example:

modelBuilder.Entity("MyProject.ApplicationUser", b =>
{
b.Property("Id")
.HasColumnType("TEXT");

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.