Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Adding a feature DOESN'T automatically seed the database? #7073


User avatar
0
OriAssurant created

Hello,

We are using a Multitenancy form of ABP.

We have added new features to ABPFeatures.cs:

public const string JobFeature = "App.Jobs"; public const string OfferFeature = "App.Jobs.Offer";

And we added this block to ABPFeatureProvider.cs

var JobFeature = context.Create( AppFeatures.JobFeature, scope: FeatureScopes.Tenant, defaultValue: "false", displayName: L("JobFeature"), inputType: new CheckboxInputType() );

JobFeature.CreateChildFeature( AppFeatures.OfferFeature, scope: FeatureScopes.Tenant, defaultValue: "false", displayName: L("OfferFeature"), inputType: new CheckboxInputType() );

After running the App locally, I do not see the Features in AbpFeatures table.

Also, how do we associate a Feature with an Edition via C#?

Thanks.


3 Answer(s)
  • User Avatar
    0
    ryancyq created
    Support Team

    Hi, if you create the feature after you have signed up for an edition, it will only be added to new edition when you changing from the current edition.

  • User Avatar
    0
    OriAssurant created

    Please explain the flow. We have a site thats already in Prod. We are introducing new Features daily and what them seeded into the db and drive functionality based on Feature value.

  • User Avatar
    0
    ryancyq created
    Support Team

    Features for an edition is only set when creating a new edition, therefore, newly added features will not be added to old editions.

    You proceed with either of the following:

    1. Run migration to backfill feature values for certain old editions
    2. Upgrade subscribed tenants from the old edition to the new edition which contains the new features