FirebirdSQL / NETProvider

Firebird ADO.NET Data Provider
https://www.firebirdsql.org/en/net-provider/
Other
152 stars 62 forks source link

IsRequired + HasColumnType + UseCollation ERROR on EFCore #1137

Open nes4072gmail opened 9 months ago

nes4072gmail commented 9 months ago

Using: Entity Framework Core ver 9.1.1 over NET 6. Server: Firebird 3.

A example Entity:

public class TABLE
{
    public int Id { get; set; }
    public string? Name { get; set; }
}

Modeling property:

modelBuilder.Entity<TABLE>().Property(P => P.Name)
    .IsRequired()
    .HasColumnType("varchar(25) character set UTF8")
    .UseCollation("UNICODE_CI_AI");

SQL behind generated:

"Name" varchar(25) character set UTF8 COLLATE UNICODE_CI_AI NOT NULL,

and throw exception:

FirebirdSql.Data.FirebirdClient.FbException: 'Dynamic SQL Error SQL error code = -104 Token unknown - line 3, column 65 NOT'

Should the word 'not null' go before of ' COLLATE UNICODE_CI_AI '?