Skip to content

Commit

Permalink
Database indexes for important properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasNSBR committed Jun 18, 2018
1 parent 26c6657 commit 58a5276
Show file tree
Hide file tree
Showing 6 changed files with 1,011 additions and 0 deletions.
2 changes: 2 additions & 0 deletions RCM.Infra.Data/EntityTypeConfig/ChequeEntityTypeConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public void Configure(EntityTypeBuilder<Cheque> builder)

builder.Property(c => c.Valor)
.IsRequired();

builder.HasIndex(c => c.NumeroCheque);
}
}
}
2 changes: 2 additions & 0 deletions RCM.Infra.Data/EntityTypeConfig/DuplicataEntityTypeConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public void Configure(EntityTypeBuilder<Duplicata> builder)
cfg.Property(d => d.DataPagamento).HasColumnName("DataPagamento");
cfg.Property(d => d.ValorPago).HasColumnName("ValorPago");
});

builder.HasIndex(d => d.NumeroDocumento);
}
}
}
4 changes: 4 additions & 0 deletions RCM.Infra.Data/EntityTypeConfig/ProdutoEntityTypeConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ public void Configure(EntityTypeBuilder<Produto> builder)
builder.HasOne(p => p.Marca)
.WithMany(m => m.Produtos)
.HasForeignKey(p => p.MarcaId);

builder.HasIndex(p => p.ReferenciaFabricante);
builder.HasIndex(p => p.ReferenciaOriginal);
builder.HasIndex(p => p.ReferenciaAuxiliar);
}
}
}
Loading

0 comments on commit 58a5276

Please # to comment.