Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IsRequired + HasColumnType + UseCollation ERROR on EFCore #1137

Open
nes4072gmail opened this issue Sep 16, 2023 · 0 comments
Open

IsRequired + HasColumnType + UseCollation ERROR on EFCore #1137

nes4072gmail opened this issue Sep 16, 2023 · 0 comments

Comments

@nes4072gmail
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants