specify UseMySqlIdentityColumn() explicitly

since upgrading to EF 2.1, EF wants to create a migration dropping this unless it is explicitly defined.
This commit is contained in:
Collin M. Barrett 2018-06-11 15:10:22 -05:00
parent 8f983fcbaf
commit c8a0ad94b9

View file

@ -9,6 +9,7 @@ public class BaseEntityTypeConfiguration<TEntity> : IEntityTypeConfiguration<TEn
public virtual void Configure(EntityTypeBuilder<TEntity> entityTypeBuilder)
{
entityTypeBuilder.Property(x => x.Id)
.UseMySqlIdentityColumn()
.HasColumnType("SMALLINT UNSIGNED");
entityTypeBuilder.Property(x => x.CreatedDateUtc)
.HasColumnType("TIMESTAMP")