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

Test fixture base class uses SqlServer-specific code #5216

Closed
roji opened this issue Apr 29, 2016 · 5 comments
Closed

Test fixture base class uses SqlServer-specific code #5216

roji opened this issue Apr 29, 2016 · 5 comments
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. good first issue This issue should be relatively straightforward to fix. help wanted This issue involves technologies where we are not experts. Expert help would be appreciated. type-bug
Milestone

Comments

@roji
Copy link
Member

roji commented Apr 29, 2016

InheritanceRelationalFixture sets ColumnType to nvarchar, which is SqlServer-specific and should happen in a provider-independent project.

https://github.com/aspnet/EntityFramework/blob/fb465491355f09f7f0fafdd2013043acb670d87e/src/Microsoft.EntityFrameworkCore.Relational.Specification.Tests/InheritanceRelationalFixture.cs#L22

@rowanmiller rowanmiller added this to the 1.0.0 milestone Apr 29, 2016
@rowanmiller rowanmiller added the help wanted This issue involves technologies where we are not experts. Expert help would be appreciated. label May 13, 2016
@rowanmiller rowanmiller modified the milestones: 1.0.1, 1.0.0 May 13, 2016
@rowanmiller
Copy link
Contributor

@roji feel free to send a PR with some refactoring to allow this to be done in the provider tests

@roji
Copy link
Member Author

roji commented May 13, 2016

OK @rowanmiller, will do

@roji
Copy link
Member Author

roji commented May 14, 2016

@AndriySvyryd I've tried to get around the specification of nvarchar by replacing .HasColumnType("nvarchar(100)") with .HasMaxLength(100); in InheritanceRelationalFixture, and oddly this generates the error "Column 'Animal.Species' is not the same length or scale as referencing column 'Animal.EagleId' in foreign key 'FK_Animal_Animal_EagleId'. Columns participating in a foreign key relationship must be defined with the same length and scale.". The same error happens if I don't configure the properties at all.

I know #2455 is still open and am not sure about things here, but it seems problematic to have to specify the full column type here, any input?

@smitpatel
Copy link
Contributor

@roji - 🐛 filed #5379
The same error happens for no configuration since, one of them is PK and its length will be limited for it and then it becomes same issue as the former.
You can override OnModelCreating method in derived classes like InheritanceSqlServerFixture and set provider-specific types there.

@rowanmiller rowanmiller removed the pri0 label Jul 6, 2016
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Jul 6, 2016
@roji
Copy link
Member Author

roji commented Jul 7, 2016

Thanks!

@bricelam bricelam added the good first issue This issue should be relatively straightforward to fix. label May 31, 2019
@ajcvickers ajcvickers modified the milestones: 1.1.0-preview1, 1.1.0 Oct 15, 2022
@ajcvickers ajcvickers removed their assignment Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. good first issue This issue should be relatively straightforward to fix. help wanted This issue involves technologies where we are not experts. Expert help would be appreciated. type-bug
Projects
None yet
Development

No branches or pull requests

6 participants