Adding an extra column to a NopCommerce table

1 month ago
Hi there,

Just wondering if adding an extra column to an existing NopCommerce tables will cause issues in the future for upgrading Nopcommerce?
I am looking at adding an extra column to the OrderNotes table and maybe a couple more.

My version is currently 4.40.

Thanks in advance.
1 month ago
Hello julianhhchan,

It will not cause any major issues if you take care of your migration code.  

Thanks & Regards,
Narendra Jarad
1 month ago
julianhhchan wrote:
Hi there,

Just wondering if adding an extra column to an existing NopCommerce tables will cause issues in the future for upgrading Nopcommerce?
I am looking at adding an extra column to the OrderNotes table and maybe a couple more.

My version is currently 4.40.

Thanks in advance.


hi,

If your code having migration for add column than it will never create issue in future.

sample code

if (!Schema.Table(NameCompatibilityManager.GetTableName(typeof(-domainname-))).Column(nameof(-columnbane-)).Exists())
            {
                //add new column
                Alter.Table(NameCompatibilityManager.GetTableName(typeof(-domainname-)))
                    .AddColumn(nameof(-columnname-)).AsBoolean().Nullable();
            }



thanks,
smiten