db optimizations around names and case-sensitivity (#2749)
* generate (case-insensitive) unique names for fields that should be unique * move name case-insensitivity down to schema level * update changelog
This commit is contained in:
@@ -10,6 +10,10 @@ public class BlockConfiguration : IEntityTypeConfiguration<Block>
|
||||
{
|
||||
builder.ToTable("Block");
|
||||
|
||||
builder.Property(b => b.Name)
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
builder.HasIndex(b => new { b.BlockGroupId, b.Name })
|
||||
.IsUnique();
|
||||
|
||||
|
||||
@@ -10,6 +10,10 @@ public class BlockGroupConfiguration : IEntityTypeConfiguration<BlockGroup>
|
||||
{
|
||||
builder.ToTable("BlockGroup");
|
||||
|
||||
builder.Property(b => b.Name)
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
builder.HasIndex(b => b.Name)
|
||||
.IsUnique();
|
||||
|
||||
|
||||
@@ -11,6 +11,10 @@ public class DecoConfiguration : IEntityTypeConfiguration<Deco>
|
||||
{
|
||||
builder.ToTable("Deco");
|
||||
|
||||
builder.Property(d => d.Name)
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
builder.HasIndex(d => new { d.DecoGroupId, d.Name })
|
||||
.IsUnique();
|
||||
|
||||
|
||||
@@ -10,6 +10,10 @@ public class DecoGroupConfiguration : IEntityTypeConfiguration<DecoGroup>
|
||||
{
|
||||
builder.ToTable("DecoGroup");
|
||||
|
||||
builder.Property(dg => dg.Name)
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
builder.HasIndex(dg => dg.Name)
|
||||
.IsUnique();
|
||||
|
||||
|
||||
@@ -10,6 +10,10 @@ public class DecoTemplateConfiguration : IEntityTypeConfiguration<DecoTemplate>
|
||||
{
|
||||
builder.ToTable("DecoTemplate");
|
||||
|
||||
builder.Property(d => d.Name)
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
builder.HasIndex(d => new { d.DecoTemplateGroupId, d.Name })
|
||||
.IsUnique();
|
||||
|
||||
|
||||
+4
@@ -10,6 +10,10 @@ public class DecoTemplateGroupConfiguration : IEntityTypeConfiguration<DecoTempl
|
||||
{
|
||||
builder.ToTable("DecoTemplateGroup");
|
||||
|
||||
builder.Property(d => d.Name)
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
builder.HasIndex(b => b.Name)
|
||||
.IsUnique();
|
||||
|
||||
|
||||
@@ -10,6 +10,10 @@ public class TemplateConfiguration : IEntityTypeConfiguration<Template>
|
||||
{
|
||||
builder.ToTable("Template");
|
||||
|
||||
builder.Property(t => t.Name)
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
builder.HasIndex(d => new { d.TemplateGroupId, d.Name })
|
||||
.IsUnique();
|
||||
|
||||
|
||||
@@ -10,6 +10,10 @@ public class TemplateGroupConfiguration : IEntityTypeConfiguration<TemplateGroup
|
||||
{
|
||||
builder.ToTable("TemplateGroup");
|
||||
|
||||
builder.Property(t => t.Name)
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
builder.HasIndex(b => b.Name)
|
||||
.IsUnique();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user