npgsql / efcore.pg

Entity Framework Core provider for PostgreSQL
PostgreSQL License
1.53k stars 223 forks source link

.IsFixedLength() creates/alters varchar instead of char #512

Closed phristov closed 6 years ago

phristov commented 6 years ago

Version 2.1.1

The following: builder.Property(x => x.Password); builder.Property(x => x.Salt).IsFixedLength();

will create a migration:

password = table.Column<string>(maxLength: 64, nullable: false), salt = table.Column<string>(fixedLength: true, maxLength: 64, nullable: false),

The migration will create a table with:

password varchar(64) NOT NULL, salt varchar(64) NOT NULL, <- This should be char(64).

roji commented 6 years ago

Thanks for raising, fixed for 2.1.2.