Upgrading plugins with custom tables from 4.2 to 4.3

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 года назад
Im in the progress of upgrading my plugins from 4.2 to 4.3, and im curious on how to handle custom tables. Im able to retrive data from the db, but updating the dbentity does not seem to work. Do i have to uninstall the plugin in order to have the migration to update? If so, i would have to comment out deleting settings etc for old stores..? I see that uninstalling the plugin actually removes the table as well, so how can i prevent that if i need to reinstall in order to update migration?

I have the following class:
public class LogistraShippingInfo: BaseEntity
    {
        public int CarrierId { get; set; }
        public string ShippingInfoId { get; set; }
        public string Text { get; set; }
    }

Ive manually created this:
Should i create this, or is it generated somehow?

[NopMigration("2020/05/29 12:00:00", "Custom.Logistra base schema")]
    public class LogistraMigrationScheme : AutoReversingMigration
    {
        #region Fields

        protected IMigrationManager _migrationManager;

        #endregion

        #region Ctor

        public LogistraMigrationScheme(IMigrationManager migrationManager)
        {
            _migrationManager = migrationManager;
        }

        #endregion

        #region Methods

        /// <summary>
        /// Collect the UP migration expressions
        /// </summary>
        public override void Up()
        {
            _migrationManager.BuildTable<LogistraShippingInfo>(Create);
        }

        #endregion
    }
3 года назад
I've a similar question about upgrading our plugins to NopCommerce 4.30 from NopCommerce 4.20
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.