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

Allow to share a required column when using table splitting #17820

Closed
AndriySvyryd opened this issue Sep 13, 2019 · 2 comments · Fixed by #17963
Closed

Allow to share a required column when using table splitting #17820

AndriySvyryd opened this issue Sep 13, 2019 · 2 comments · Fixed by #17963
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@AndriySvyryd
Copy link
Member

System.InvalidOperationException: 'DetailedOrder.Status' and 'Order.Status' are both mapped to column 'Status' in 'Orders' but are configured with different nullability.
at Microsoft.EntityFrameworkCore.Infrastructure.RelationalModelValidator.ValidateSharedColumnsCompatibility(IReadOnlyList1 mappedTypes, String tableName, IDiagnosticsLogger1 logger)
at Microsoft.EntityFrameworkCore.SqlServer.Internal.SqlServerModelValidator.ValidateSharedColumnsCompatibility(IReadOnlyList1 mappedTypes, String tableName, IDiagnosticsLogger1 logger)
at Microsoft.EntityFrameworkCore.Infrastructure.RelationalModelValidator.ValidateSharedTableCompatibility(IModel model, IDiagnosticsLogger1 logger) at Microsoft.EntityFrameworkCore.Infrastructure.RelationalModelValidator.Validate(IModel model, IDiagnosticsLogger1 logger)
at Microsoft.EntityFrameworkCore.SqlServer.Internal.SqlServerModelValidator.Validate(IModel model, IDiagnosticsLogger1 logger) at Microsoft.EntityFrameworkCore.Metadata.Conventions.ValidatingConvention.ProcessModelFinalized(IConventionModelBuilder modelBuilder, IConventionContext1 context)
at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.ImmediateConventionScope.OnModelFinalized(IConventionModelBuilder modelBuilder)
at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.OnModelFinalized(IConventionModelBuilder modelBuilder)
at Microsoft.EntityFrameworkCore.Metadata.Internal.Model.FinalizeModel()
at Microsoft.EntityFrameworkCore.ModelBuilder.FinalizeModel()

@divega divega added this to the 3.1.0 milestone Sep 16, 2019
AndriySvyryd added a commit that referenced this issue Sep 20, 2019
…not that the corresponding column would have the same nullability

Fixes #17820
@AndriySvyryd AndriySvyryd added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Sep 20, 2019
@AndriySvyryd AndriySvyryd removed their assignment Sep 20, 2019
AndriySvyryd added a commit that referenced this issue Sep 20, 2019
…not that the corresponding column would have the same nullability

Fixes #17820
AndriySvyryd added a commit that referenced this issue Sep 20, 2019
…not that the corresponding column would have the same nullability

Fixes #17820
@ajcvickers ajcvickers modified the milestones: 3.1.0, 3.1.0-preview1 Oct 15, 2019
@gdlcf88
Copy link

gdlcf88 commented Oct 30, 2019

How can I temporarily solve this problem in EF Core 3.0? >_<

            builder.Entity<AppUser>(b =>
            {
                b.ToTable("AbpUsers"); //Sharing the same table "AbpUsers" with the IdentityUser
                b.ConfigureByConvention();
                b.ConfigureAbpUser();
                b.HasOne<IdentityUser>().WithOne().HasForeignKey<AppUser>(e => e.Id);

                //Moved customization to a method so we can share it with the Abp102MigrationsDbContext class
                b.ConfigureCustomUserProperties();
            });

Unhandled exception. System.InvalidOperationException: 'AppUser.CreationTime' and 'IdentityUser.CreationTime' are both mapped to column 'CreationTime' in 'AbpUsers' but are confi
gured with different nullability.

@AndriySvyryd
Copy link
Member Author

@gdlcf88 You can try making IdentityUser.CreationTime optional

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. type-bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants