2.0 to 2.3 Migration
Database Changes
You can find the history of changes to the database in the [[Database-Model]].
You can run the following script AT YOUR OWN RISK to update your tables.
alter table BLC_ADDRESS add column PHONE_FAX_ID bigint;
alter table BLC_ADDRESS add column PHONE_PRIMARY_ID bigint;
alter table BLC_ADDRESS add column PHONE_SECONDARY_ID bigint;
create table BLC_ADMIN_MODULE (ADMIN_MODULE_ID bigint not null, DISPLAY_ORDER integer, ICON varchar(255), MODULE_KEY varchar(255) not null, NAME varchar(255) not null, primary key (ADMIN_MODULE_ID));
create table BLC_ADMIN_SECTION (ADMIN_SECTION_ID bigint not null, DISPLAY_CONTROLLER varchar(255), NAME varchar(255) not null, SECTION_KEY varchar(255) not null, URL varchar(255), USE_DEFAULT_HANDLER bit not null, ADMIN_MODULE_ID bigint not null, primary key (ADMIN_SECTION_ID), unique (SECTION_KEY));
create table BLC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID bigint not null, ADMIN_PERMISSION_ID bigint not null);
alter table BLC_CATEGORY add column FULFILLMENT_TYPE varchar(255);
alter table BLC_CATEGORY add column INVENTORY_TYPE varchar(255);
create table BLC_CURRENCY (CURRENCY_CODE varchar(255) not null, DEFAULT_FLAG bit, FRIENDLY_NAME varchar(255), primary key (CURRENCY_CODE));
create table BLC_CUSTOMER_PAYMENT (CUSTOMER_PAYMENT_ID bigint not null, IS_DEFAULT bit, PAYMENT_TOKEN varchar(255), ADDRESS_ID bigint not null, CUSTOMER_ID bigint not null, primary key (CUSTOMER_PAYMENT_ID), unique (CUSTOMER_ID, PAYMENT_TOKEN));
create table BLC_CUSTOMER_PAYMENT_FIELDS (CUSTOMER_PAYMENT_ID bigint not null, FIELD_VALUE varchar(255), FIELD_NAME varchar(255) not null, primary key (CUSTOMER_PAYMENT_ID, FIELD_NAME));
alter table BLC_FIELD add column TRANSLATABLE bit;
alter table BLC_FULFILLMENT_GROUP add column FULFILLMENT_GROUP_SEQUNCE integer;
alter table BLC_FULFILLMENT_GROUP_ITEM add column PRORATED_ORDER_ADJ numeric(19,2);
alter table BLC_FULFILLMENT_GROUP_ITEM add column TAXABLE_PRORATED_ORDER_ADJ numeric(19,2);
alter table BLC_FULFILLMENT_GROUP_ITEM add column TOTAL_ITEM_AMOUNT numeric(19,5);
alter table BLC_FULFILLMENT_GROUP_ITEM add column TOTAL_ITEM_TAXABLE_AMOUNT numeric(19,5);
alter table BLC_FULFILLMENT_OPTION_FIXED add column CURRENCY_CODE varchar(255);
create table BLC_ITEM_OFFER_QUALIFIER (ITEM_OFFER_QUALIFIER_ID bigint not null, QUANTITY bigint, OFFER_ID bigint not null, ORDER_ITEM_ID bigint, primary key (ITEM_OFFER_QUALIFIER_ID));
alter table BLC_LOCALE add column CURRENCY_CODE varchar(255);
alter table BLC_OFFER add column MARKETING_MESSASGE varchar(255);
alter table BLC_ORDER add column CURRENCY_CODE varchar(255);
alter table BLC_ORDER add column LOCALE_CODE varchar(255);
alter table BLC_ORDER_ITEM add column DISCOUNTS_ALLOWED bit;
alter table BLC_ORDER_ITEM add column RETAIL_PRICE_OVERRIDE bit;
alter table BLC_ORDER_ITEM add column SALE_PRICE_OVERRIDE bit;
alter table BLC_ORDER_ITEM add column TOTAL_TAX numeric(19,2);
create table BLC_ORDER_ITEM_DTL_ADJ (ORDER_ITEM_DTL_ADJ_ID bigint not null, APPLIED_TO_SALE_PRICE bit, OFFER_NAME varchar(255), ADJUSTMENT_REASON varchar(255) not null, ADJUSTMENT_VALUE numeric(19,5) not null, OFFER_ID bigint not null, ORDER_ITEM_PRICE_DTL_ID bigint, primary key (ORDER_ITEM_DTL_ADJ_ID));
create table BLC_ORDER_ITEM_PRICE_DTL (ORDER_ITEM_PRICE_DTL_ID bigint not null, QUANTITY integer not null, USE_SALE_PRICE bit, ORDER_ITEM_ID bigint, primary key (ORDER_ITEM_PRICE_DTL_ID));
alter table BLC_ORDER_PAYMENT add column CUSTOMER_PAYMENT_ID bigint;
create table BLC_ORDER_PAYMENT_DETAILS (PAYMENT_DETAIL_ID bigint not null, PAYMENT_AMOUNT numeric(19,2), DATE_RECORDED timestamp, PAYMENT_INFO_DETAIL_TYPE integer, CURRENCY_CODE varchar(255), PAYMENT_INFO bigint not null, primary key (PAYMENT_DETAIL_ID));
alter table BLC_PAYMENT_LOG add column CURRENCY_CODE varchar(255);
alter table BLC_PAYMENT_RESPONSE_ITEM add column TRANSACTION_AMOUNT numeric(19,5);
alter table BLC_PAYMENT_RESPONSE_ITEM add column CURRENCY_CODE varchar(255);
alter table BLC_SEARCH_FACET add column REQUIRES_ALL_DEPENDENT bit;
create table BLC_SEARCH_FACET_XREF (ID bigint not null, REQUIRED_FACET_ID bigint not null, SEARCH_FACET_ID bigint, primary key (ID));
alter table BLC_SKU add column FULFILLMENT_TYPE varchar(255);
alter table BLC_SKU add column INVENTORY_TYPE varchar(255);
alter table BLC_SKU_FEE add column CURRENCY_CODE varchar(255);
alter table BLC_TAX_DETAIL add column CURRENCY_CODE varchar(255);
create table BLC_UserConnection (providerId varchar(255) not null, providerUserId varchar(255) not null, userId varchar(255) not null, accessToken varchar(255) not null, displayName varchar(255), expireTime bigint, imageUrl varchar(255), profileUrl varchar(255), rank integer not null, refreshToken varchar(255), secret varchar(255), primary key (providerId, providerUserId, userId));
alter table BLC_ADDRESS add constraint FK299F86CEF1A6533F foreign key (PHONE_FAX_ID) references BLC_PHONE;
alter table BLC_ADDRESS add constraint FK299F86CEBF4449BA foreign key (PHONE_PRIMARY_ID) references BLC_PHONE;
alter table BLC_ADDRESS add constraint FK299F86CEE12DC0C8 foreign key (PHONE_SECONDARY_ID) references BLC_PHONE;
create index ADDRESS_PHONE_PRI_IDX on BLC_ADDRESS (PHONE_PRIMARY_ID);
create index ADDRESS_PHONE_SEC_IDX on BLC_ADDRESS (PHONE_SECONDARY_ID);
create index ADDRESS_PHONE_FAX_IDX on BLC_ADDRESS (PHONE_FAX_ID);
create index ADMINMODULE_NAME_INDEX on BLC_ADMIN_MODULE (NAME);
alter table BLC_ADMIN_SECTION add constraint FK7EA7D92FB1A18498 foreign key (ADMIN_MODULE_ID) references BLC_ADMIN_MODULE;
create index ADMINSECTION_MODULE_INDEX on BLC_ADMIN_SECTION (ADMIN_MODULE_ID);
create index ADMINSECTION_NAME_INDEX on BLC_ADMIN_SECTION (NAME);
alter table BLC_ADMIN_SEC_PERM_XREF add constraint FK5E832966E88B7D38 foreign key (ADMIN_PERMISSION_ID) references BLC_ADMIN_PERMISSION;
alter table BLC_ADMIN_SEC_PERM_XREF add constraint FK5E8329663AF7F0FC foreign key (ADMIN_SECTION_ID) references BLC_ADMIN_SECTION;
alter table BLC_CUSTOMER_PAYMENT add constraint FK8B3DF0CBC13085DD foreign key (ADDRESS_ID) references BLC_ADDRESS;
alter table BLC_CUSTOMER_PAYMENT add constraint FK8B3DF0CB7470F437 foreign key (CUSTOMER_ID) references BLC_CUSTOMER;
create index CUSTOMERPAYMENT_ADDRESS_INDEX on BLC_CUSTOMER_PAYMENT (ADDRESS_ID);
alter table BLC_CUSTOMER_PAYMENT_FIELDS add constraint FK5CCB14ADCA0B98E0 foreign key (CUSTOMER_PAYMENT_ID) references BLC_CUSTOMER_PAYMENT;
alter table BLC_FULFILLMENT_OPTION_FIXED add constraint FK408360313E2FC4F9 foreign key (CURRENCY_CODE) references BLC_CURRENCY;
alter table BLC_ITEM_OFFER_QUALIFIER add constraint FKD9C50C619AF166DF foreign key (ORDER_ITEM_ID) references BLC_ORDER_ITEM;
alter table BLC_ITEM_OFFER_QUALIFIER add constraint FKD9C50C61D5F3FAF4 foreign key (OFFER_ID) references BLC_OFFER;
alter table BLC_LOCALE add constraint FK56C7DC203E2FC4F9 foreign key (CURRENCY_CODE) references BLC_CURRENCY;
create index OFFER_MARKETING_MESSAGE_INDEX on BLC_OFFER (MARKETING_MESSASGE);
alter table BLC_ORDER add constraint FK8F5B64A8A1E1C128 foreign key (LOCALE_CODE) references BLC_LOCALE;
alter table BLC_ORDER add constraint FK8F5B64A83E2FC4F9 foreign key (CURRENCY_CODE) references BLC_CURRENCY;
alter table BLC_ORDER_ITEM_DTL_ADJ add constraint FK85F0248FD5F3FAF4 foreign key (OFFER_ID) references BLC_OFFER;
alter table BLC_ORDER_ITEM_DTL_ADJ add constraint FK85F0248FD4AEA2C0 foreign key (ORDER_ITEM_PRICE_DTL_ID) references BLC_ORDER_ITEM_PRICE_DTL;
alter table BLC_ORDER_ITEM_PRICE_DTL add constraint FK1FB64BF19AF166DF foreign key (ORDER_ITEM_ID) references BLC_ORDER_ITEM;
alter table BLC_ORDER_PAYMENT add constraint FK9517A14FCA0B98E0 foreign key (CUSTOMER_PAYMENT_ID) references BLC_CUSTOMER_PAYMENT;
create index CUSTOMER_PAYMENT on BLC_ORDER_PAYMENT (CUSTOMER_PAYMENT_ID);
alter table BLC_ORDER_PAYMENT_DETAILS add constraint FK6D390732CE00A2EB foreign key (PAYMENT_INFO) references BLC_ORDER_PAYMENT;
alter table BLC_ORDER_PAYMENT_DETAILS add constraint FK6D3907323E2FC4F9 foreign key (CURRENCY_CODE) references BLC_CURRENCY;
alter table BLC_PAYMENT_LOG add constraint FKA43703453E2FC4F9 foreign key (CURRENCY_CODE) references BLC_CURRENCY;
alter table BLC_PAYMENT_RESPONSE_ITEM add constraint FK807B8F323E2FC4F9 foreign key (CURRENCY_CODE) references BLC_CURRENCY;
alter table BLC_SEARCH_FACET_XREF add constraint FK35A63034B96B1C93 foreign key (SEARCH_FACET_ID) references BLC_SEARCH_FACET;
alter table BLC_SEARCH_FACET_XREF add constraint FK35A63034DA7E1C7C foreign key (REQUIRED_FACET_ID) references BLC_SEARCH_FACET;
create index BLC_SITE_ID_VAL_INDEX on BLC_SITE (SITE_IDENTIFIER_VALUE);
alter table BLC_SKU_FEE add constraint FKEEB7181E3E2FC4F9 foreign key (CURRENCY_CODE) references BLC_CURRENCY;
alter table BLC_TAX_DETAIL add constraint FKEABE4A4B3E2FC4F9 foreign key (CURRENCY_CODE) references BLC_CURRENCY;