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

Collations aren't scaffolded correctly #23386

Closed
yori-s opened this issue Nov 18, 2020 · 6 comments · Fixed by #23388 or #23414
Closed

Collations aren't scaffolded correctly #23386

yori-s opened this issue Nov 18, 2020 · 6 comments · Fixed by #23388 or #23414
Assignees
Labels
area-scaffolding closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported Servicing-approved type-bug
Milestone

Comments

@yori-s
Copy link

yori-s commented Nov 18, 2020

Scaffolding a fluent db context (using Npgsql.EntityFrameworkCore.PostgreSQL), column collations appear as HasComment rather than UseCollation.

Indexes appear to be generated with the expected collation.

RelationalScaffoldingModelFactory.VisitColumns line 500 looks a bit suspicious:

Shouldn't

            if (column.Collation != null)
            {
                property.HasComment(column.Collation);
            }

be

            if (column.Collation != null)
            {
                property.UseCollation(column.Collation);
            }

Include provider and version information

EF Core version: 5.0.0
Database provider: Npgsql.EntityFrameworkCore.PostgreSQL
Target framework: .NET 5.0
Operating system: windows 10 (docker from wsl2)
IDE: command line

@smitpatel
Copy link
Member

cc: @roji

roji added a commit that referenced this issue Nov 19, 2020
@roji roji changed the title Scaffolding - Column collation appears as comment Collations aren't scaffolded correctly Nov 19, 2020
@roji roji self-assigned this Nov 19, 2020
@roji roji added area-scaffolding closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug labels Nov 19, 2020
@roji
Copy link
Member

roji commented Nov 19, 2020

Collations are actually a form of comment on the column on how to do text processing.

(JK, submitted #23388. Database collation scaffolding also doesn't work.)

@roji roji linked a pull request Nov 19, 2020 that will close this issue
@yori-s
Copy link
Author

yori-s commented Nov 19, 2020

wow - y'all are fast 😂

@ajcvickers
Copy link
Member

@roji Please prepare a 5.0.1 patch PR for this.

@yori-s
Copy link
Author

yori-s commented Nov 20, 2020

Looks good using the dotnet6 feed - thanks again for the quick turnaround!

roji added a commit that referenced this issue Nov 20, 2020
@roji
Copy link
Member

roji commented Nov 20, 2020

5.0.1 patch: #23414

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-scaffolding closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported Servicing-approved type-bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants