Sorry, I can't ask a question on Changing table prefix and schema of ABP.IO so I am creating another.
In the documentation for ABP.IO it mentions changing table schemas (https://docs.abp.io/en/abp/latest/Entity-Framework-Core-Migrations), I've also looked at the git issue (https://github.com/abpframework/abp/issues/1429) referring to the addition of the AbpCommonDbProperties and the comment about adding it to the beginning of your program however I have tried several different things in all my projects and cannot seem to get it to work. The git comment indicates that these changes should work for all modules and having looked at the code I can see how the settings should be using it, but there must be something different about the Settings Module (or I think the error originates in the Localization module).
Running my HttpApi.Host project I get 'Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid object name 'Settings'. I managed to set the default prefix during migration so my tables have all had their prefix removed, however I can't seem to get the host program to use the same prefix.
My solution contains a HttpApi.Host and IdentityServer project. Given the high-level of customisation that ABP has I'm a bit at a loss as to why this doesn't work easier (or in my case, at all).
The steps for my test are as follows.
abp new "DbTablePrefixTest" -t app -u mvc --tiered -d ef -csf true
Configure DefaultModelBuilderConfigurationOptions
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
/* Include modules to your migration db context */
builder.ConfigurePermissionManagement(opt=>opt.TablePrefix=DbTablePrefixTestConsts.DbTablePrefix);
builder.ConfigureSettingManagement(opt => opt.TablePrefix = DbTablePrefixTestConsts.DbTablePrefix);
builder.ConfigureBackgroundJobs(opt => opt.TablePrefix = DbTablePrefixTestConsts.DbTablePrefix);
builder.ConfigureAuditLogging(opt => opt.TablePrefix = DbTablePrefixTestConsts.DbTablePrefix);
builder.ConfigureIdentity(opt => opt.TablePrefix = DbTablePrefixTestConsts.DbTablePrefix);
builder.ConfigureIdentityServer(opt => opt.TablePrefix = DbTablePrefixTestConsts.DbTablePrefix);
builder.ConfigureFeatureManagement(opt => opt.TablePrefix = DbTablePrefixTestConsts.DbTablePrefix);
builder.ConfigureTenantManagement(opt => opt.TablePrefix = DbTablePrefixTestConsts.DbTablePrefix);
/* Configure your own tables/entities inside the ConfigureDbTablePrefixTest method */
builder.ConfigureDbTablePrefixTest();
}
DbTablePrefixTest.EntityFrameworkCore.DbMigrations
project.results are as follows:
User contributions licensed under CC BY-SA 3.0