打开 关闭

Error on migrating database with an entity which has a navigation property to tenants #1003


User avatar
0
yilmaz.atalar 创建
  • ABP Framework version: v4.0
  • DB provider: EF Core

Hi,

I've added an entity to my context which has a navigation property to tenants table. Migration file's been created with success. But when I try to run DbMigrator app, it throws an exception like this:

And my entity's config is like this:

gl.HasOne(g => g.Tenant).WithMany().HasForeignKey(g => g.TenantId);

How can I solve this problem?

Thanks.

PS: Related with this post


5 答案
  • User Avatar
    0
    maliming 创建
    支持团队 Fullstack Developer

    hi

    Can you share the full code to reproduce this problem?

  • User Avatar
    0
    yilmaz.atalar 创建

    Hi,

    I think the problem is clear and easy to reproduce. Also I've linked a related problem. I cannot share the source code. It's a corporate project and contains sensitive information.

    Thanks.

  • User Avatar
    0
    alper 创建
    支持团队 Director

    hi, this maybe a issue. someone else also reported the same situation. I'll check it

  • User Avatar
    0
    berkansasmaz 创建
    支持团队 .NET Developer

    I created an issue: https://github.com/abpframework/abp/issues/8019

  • User Avatar
    0
    berkansasmaz 创建
    支持团队 .NET Developer

    You can find why the problem occurs and the solution here.

    So I am closing this ticket. You can re-open and add comment if you want.

Made with ❤️ on ABP v8.2.0-preview Updated on 三月 25, 2024, 15:11