I have a table mapping (Entity Framework Core 2.0) in which the Id field needs to be AutoIncrement.
The problem is that PostgreSQL is starting with high value and often jumps to very high sequences, type, increasing by 10 from 10.
What am I doing wrong? I would like it to start with 0 and autoincrement.
(
public class ProfissaoMap : IEntityTypeConfiguration<Profissao>
{
public void Configure(EntityTypeBuilder<Profissao> builder)
{
builder.ToTable("Profissao");
builder.HasKey(p => new {p.Id});
builder.Property(p => p.Id)
.ForNpgsqlUseSequenceHiLo()
.IsRequired();
builder.Property(p => p.Id)
.HasColumnName("ProfissaoId")
.HasColumnType("integer")
.IsRequired();
builder.Property(p => p.Descricao)
.HasColumnName("Descricao")
.HasColumnType("character varying(50)")
.IsRequired();
builder.Property(p => p.PadraoSistema)
.HasColumnName("PadraoSistema")
.HasColumnType("boolean");
}
}