Adding an extra column to a NopCommerce table

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 anni tempo fa
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.
2 anni tempo fa
Hello julianhhchan,

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

Thanks & Regards,
Narendra Jarad
2 anni tempo fa
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
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.