0
bhasinp created
- ABP Framework version: v5.1.2
- UI type: Angular
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): no
- Exception message and stack trace:
- Steps to reproduce the issue:"
Added new entity using Abp Suite and mark it as "MultiTenant". This created the entity with IMultiTenant interface implemented. I then go to Tenant list in SaaS Module and select "Apply database migration" it does update the __EFMigrationsHistory table and adds the new migration but it doesn't create the new table in the tenant database.
What am I missing?
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
1 Answer(s)
-
0
Hi @bhasinp,
I have reproduced the issue & fixed it for the next patch. Also, your question credit is refunded.
Problem is that TenantDbContext is not modified during code generation. To fix it manually for now, you have to copy related code from DbContext to TenantDbContext file. Then re-generate migrations.
example codes to copy:
public DbSet<Author> Authors { get; set; }builder.Entity<Author>(b => { b.ToTable(MyProjectConsts.DbTablePrefix + "Authors", MyProjectConsts.DbSchema); b.ConfigureByConvention(); b.Property(x => x.TenantId).HasColumnName(nameof(Author.TenantId)); b.Property(x => x.Name).HasColumnName(nameof(Author.Name)); });Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)