I'm using .NET CORE 2.2 and EF CORE for SQLSERVER and PostgreSQL.
In postgresql doesn't exists varchar(max) or varchar(-1) like on SQLSERVER,in postgresql the data type is TEXT.
On this column, I need it to be varchar(max) for the SQL server and text for Postgres., How can it be done?
That migration needs to be understood by each provider.
I appreciate your help.
builder.Property(x => x.Foo).HasColumnType("varchar(-1)");
sorry, my English is not so good.
The default ColumnType of string will automatically map to the Max length field. so be leaving off the column type you should get what you want.
builder.Property(x => x.Foo)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With