Migration doesn't apply from plugin

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 年 前
hi

i'm trying to develop a plugin that create a table into database ,
i've tried
https://docs.nopcommerce.com/en/developer/plugins/plugin-with-data-access.html

but it seems that migration doesn't apply .

can anyone provide me some guidance?

here is my plugin code
https://gofile.io/d/jWVqZs
3 年 前
The database interface has now changed to use Linq2db and Fluent Migrator so it is different to v4.2 which used Entity Framework

See https://docs.nopcommerce.com/en/developer/plugins/plugin-with-data-access-4.30.html
3 年 前
thanks for quick reply
well actually i follow this one to implement my plugin just refrence a wrong link

would you please look at my source and tell me what im missing?

i looked at present plugins such as FixedOrByCountryStateZip
but this has a different approch rathar than link you provided

also i tried to create Table in Database but couldnt add any record through repository i had the "Cannot insert explicit value for identity column in table 'table' when IDENTITY_INSERT is set to OFF
" error loged inside log table
so i guess migration should create the db itself
3 年 前
If you copy a "plugins such as FixedOrByCountryStateZip", then you should not have a problem.
In particular look at \Data\ShippingByWeightByTotalRecordBuilder.cs

    public class ShippingByWeightByTotalRecordBuilder : NopEntityBuilder<ShippingByWeightByTotalRecord>
    {
        public override void MapEntity(CreateTableExpressionBuilder table)
        {...


And, if you copy the \Data\SchemaMigration.cs, then be sure to change the date in the NopMigration attribute.
3 年 前
[quote=i follow this one to implement my plugin just refrence a wrong link[/quote]
yes and so your code is for v4.2 and v4.3 is diffrerent as shown in the correct link
3 年 前
I Took a exact look at Tax.FixedOrByCountryStateZip and compare my code
i found the problem and it was that my schemaMigration wasnt public


thanks for reply and helping out
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.