添加数据库迁移

This commit is contained in:
2021-02-24 10:00:37 +08:00
parent cd23716d1b
commit 12ecdf3159
13 changed files with 578 additions and 13 deletions

View File

@@ -14,9 +14,11 @@ namespace Infrastructure.EntityConfigurations
public void Configure(EntityTypeBuilder<Link> builder)
{
builder.ToTable("Link");
builder.HasKey(l => l.ShortCode);
builder.HasKey(l => l.Id);
builder.HasIndex(l => l.ShortCode).IsUnique();
builder.Ignore(l => l.DomainEvents);
builder.Property(l => l.AppId).IsRequired();
builder.Property(l => l.ShortCode).HasMaxLength(11);
}
}
}