Skip to content

IsRequired + HasColumnType + UseCollation ERROR on EFCore #1137

Open
@nes4072gmail

Description

@nes4072gmail

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 '?

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions