Open Closed

BUG: Creating a many-to-many relationship appends schema name to related table #5669


User avatar
0
rwright-ruhealth created
  • ABP Framework version: v7.3.2 using ABP SUITE 7.3.2
  • UI Type: Angular / MVC / Blazor WASM / Blazor Server: MVC
  • Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..) / MongoDB : SQL Server
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes/no Tiered(yes)
  • Exception message and full stack trace: NONE
  • Steps to reproduce the issue:

Create the navigation properties tutorial as seen in article: many-to-many tutorial on ABP Commercial

Code Generated afterspecifiying the related entity name in Property Name : OTHERS at the bottom of ABP Suite page appends the word "dbo" or the specified schema to the entity name. expected behavior: Produce the Typed in Entity Name. Observations: Code created by your wizard adds a "+" sign instead of a comma when using Fluent create table. example:

           /* This line is incorrect and it gets generated everytime 
              and can't be changed. The only option is to set DbSchema const to empty string. 
              I need DBSchema const set. */
                      
            builder.Entity<BookObjCategoryObj>(b =>
            {
                /* BAD!!!! should be a comma not a "+" plus sign.*/
             b.ToTable(Trakv1Consts.DbTablePrefix + "BookObjCategoryObj" + Trakv1Consts.DbSchema); 
            b.ConfigureByConvention();
            b.HasKey(x => new { x.BookObjId, x.CategoryObjId });

            b.HasOne<BookObj>().WithMany(x => x.BookCategory).HasForeignKey(x => x.BookObjId).IsRequired().OnDelete(DeleteBehavior.NoAction);
            b.HasOne<CategoryObj>().WithMany().HasForeignKey(x => x.CategoryObjId).IsRequired().OnDelete(DeleteBehavior.NoAction);
            b.HasIndex(
                x => new { x.BookObjId, x.CategoryObjId }
            );
                });
                


// Can you fix, please? Also, this is a bug, so kindly don't charge against our allotment. 
       /* Every other create table gets it right until you try many-to-many relationships.*/   

Thank you for your time and attention. P.S.: This feature used to work in previous versions.


1 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    We will fix the problem in the next version, your ticket refunded.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38