Skip to content

Instantly share code, notes, and snippets.

@pysco68
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pysco68/ad8732fd79f0b2bb874f to your computer and use it in GitHub Desktop.
Save pysco68/ad8732fd79f0b2bb874f to your computer and use it in GitHub Desktop.
Fixing MySQL error 1071 "Specified key was too long; max key length is 767 bytes"
modelBuilder.Entity<IdentityRole>()
.Property(c => c.Name)
.HasMaxLength(128)
.IsRequired();
modelBuilder.Entity<ApplicationUser>()
.ToTable("AspNetUsers")
.Property(c => c.UserName)
.HasMaxLength(128)
.IsRequired();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment