6.1 Broadleaf Framework Schema Changes
The schema changes are broken up into what was added via merging the 5.3 line into the 6.x line and what was added specifically in 6.1.
5.3 Schema Changes
Liquibase
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-3.8.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
<changeSet author="broadleaf 5.3" id="1">
<createTable tableName="blc_offer_price_data">
<column name="OFFER_PRICE_DATA_ID" type="BIGINT">
<constraints primaryKey="true"/>
</column>
<column defaultValueComputed="NULL" name="END_DATE" type="datetime"/>
<column defaultValueComputed="NULL" name="START_DATE" type="datetime"/>
<column name="AMOUNT" type="DECIMAL(19, 5)">
<constraints nullable="false"/>
</column>
<column name="ARCHIVED" type="CHAR(1)"/>
<column defaultValueComputed="NULL" name="CREATED_BY" type="BIGINT"/>
<column defaultValueComputed="NULL" name="DATE_CREATED" type="datetime"/>
<column defaultValueComputed="NULL" name="DATE_UPDATED" type="datetime"/>
<column defaultValueComputed="NULL" name="UPDATED_BY" type="BIGINT"/>
<column name="DISCOUNT_TYPE" type="VARCHAR(255)"/>
<column name="ADMIN_ADDITION_STATUS" type="VARCHAR(255)"/>
<column defaultValueComputed="NULL" name="CATALOG_DISC" type="BIGINT"/>
<column defaultValueComputed="NULL" name="SNDBX_CATALOG_FLAG" type="BIGINT"/>
<column defaultValueComputed="NULL" name="SNDBX_ORIG_ITEM_ID" type="BIGINT"/>
<column defaultValueComputed="NULL" name="SNDBX_ORIG_RECORD_ID" type="BIGINT"/>
<column defaultValueComputed="NULL" name="SNDBX_ID" type="BIGINT"/>
<column name="SNDBX_ARCHIVED_FLAG" type="CHAR(1)"/>
<column name="SNDBX_DELETED_FLAG" type="CHAR(1)"/>
<column defaultValueComputed="NULL" name="SNDBX_TMPLT_RECORD_ID" type="BIGINT"/>
<column defaultValueComputed="NULL" name="SNDBX_TIER" type="BIGINT"/>
<column name="IDENTIFIER_TYPE" type="VARCHAR(255)"/>
<column name="IDENTIFIER_VALUE" type="VARCHAR(255)"/>
<column name="QUANTITY" type="INT">
<constraints nullable="false"/>
</column>
<column name="OFFER_ID" type="BIGINT">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
<changeSet author="broadleaf 5.3" id="2">
<addColumn tableName="blc_offer_audit">
<column defaultValueComputed="NULL" name="ACCOUNT_ID" type="BIGINT"/>
</addColumn>
</changeSet>
<changeSet author="broadleaf 5.3" id="3">
<addColumn tableName="blc_fg_adjustment">
<column defaultValueBoolean="false" name="IS_FUTURE_CREDIT" type="BIT"/>
</addColumn>
</changeSet>
<changeSet author="broadleaf 5.3" id="4">
<addColumn tableName="blc_order_adjustment">
<column defaultValueBoolean="false" name="IS_FUTURE_CREDIT" type="BIT"/>
</addColumn>
</changeSet>
<changeSet author="broadleaf 5.3" id="5">
<addColumn tableName="blc_offer">
<column name="OFFER_ADJUSTMENT_TYPE" type="VARCHAR(255 BYTE)"/>
</addColumn>
</changeSet>
<changeSet author="broadleaf 5.3" id="6">
<addColumn tableName="blc_order_item_dtl_adj">
<column defaultValueBoolean="false" name="IS_FUTURE_CREDIT" type="BIT"/>
</addColumn>
</changeSet>
<changeSet author="broadleaf 5.3" id="7">
<addColumn tableName="blc_admin_section">
<column defaultValueBoolean="false" name="FOLDERABLE" type="BIT"/>
</addColumn>
</changeSet>
<changeSet author="broadleaf 5.3" id="8">
<addColumn tableName="blc_admin_section">
<column defaultValueBoolean="false" name="FOLDERED_BY_DEFAULT" type="BIT"/>
</addColumn>
</changeSet>
<changeSet author="broadleaf 5.3" id="9">
<addColumn tableName="blc_offer">
<column name="MAX_USES_STRATEGY" type="VARCHAR(255 BYTE)"/>
</addColumn>
</changeSet>
<changeSet author="broadleaf 5.3" id="26">
<addColumn tableName="blc_offer">
<column defaultValueComputed="NULL" name="MINIMUM_DAYS_PER_USAGE" type="BIGINT"/>
</addColumn>
</changeSet>
<changeSet author="broadleaf 5.3" id="10">
<addColumn tableName="blc_offer">
<column defaultValueBoolean="false" name="USE_LIST_FOR_DISCOUNTS" type="BIT"/>
</addColumn>
</changeSet>
<changeSet author="broadleaf 5.3" id="11">
<createIndex indexName="OFFERAUDIT_ACCOUNT_INDEX" tableName="blc_offer_audit">
<column defaultValueComputed="NULL" name="ACCOUNT_ID"/>
</createIndex>
</changeSet>
<changeSet author="broadleaf 5.3" id="41">
<createIndex indexName="OFFER_PRICE_DATA_OFFER_INDEX" tableName="blc_offer_price_data">
<column name="OFFER_ID"/>
</createIndex>
</changeSet>
<changeSet author="broadleaf 5.3" id="12">
<createIndex indexName="idx_BLOFPRDA_SNDBX_CATALO" tableName="blc_offer_price_data">
<column defaultValueComputed="NULL" name="SNDBX_CATALOG_FLAG"/>
</createIndex>
</changeSet>
<changeSet author="broadleaf 5.3" id="13">
<createIndex indexName="idx_BLOFPRDA_SNDBX_ID" tableName="blc_offer_price_data">
<column defaultValueComputed="NULL" name="SNDBX_ID"/>
</createIndex>
</changeSet>
<changeSet author="broadleaf 5.3" id="14">
<createIndex indexName="idx_BLOFPRDA_SNDBX_ORIG_I" tableName="blc_offer_price_data">
<column defaultValueComputed="NULL" name="SNDBX_ORIG_ITEM_ID"/>
</createIndex>
</changeSet>
<changeSet author="broadleaf 5.3" id="15">
<createIndex indexName="idx_BLOFPRDA_SNDBX_ORIG_R" tableName="blc_offer_price_data">
<column defaultValueComputed="NULL" name="SNDBX_ORIG_RECORD_ID"/>
</createIndex>
</changeSet>
<changeSet author="broadleaf 5.3" id="16">
<createIndex indexName="idx_BLOFPRDA_SNDBX_TMPLT_" tableName="blc_offer_price_data">
<column defaultValueComputed="NULL" name="SNDBX_TMPLT_RECORD_ID"/>
</createIndex>
</changeSet>
<changeSet author="broadleaf 5.3" id="17">
<addForeignKeyConstraint baseColumnNames="OFFER_ID" baseTableName="blc_offer_price_data" constraintName="FKkprkllbin16hh5ay89t8we431" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="OFFER_ID" referencedTableName="blc_offer" validate="true"/>
</changeSet>
</databaseChangeLog>
MySQL
CREATE TABLE blc_offer_price_data (OFFER_PRICE_DATA_ID BIGINT NOT NULL, END_DATE datetime DEFAULT NULL NULL, START_DATE datetime DEFAULT NULL NULL, AMOUNT DECIMAL(19, 5) NOT NULL, ARCHIVED CHAR(1) NULL, CREATED_BY BIGINT DEFAULT NULL NULL, DATE_CREATED datetime DEFAULT NULL NULL, DATE_UPDATED datetime DEFAULT NULL NULL, UPDATED_BY BIGINT DEFAULT NULL NULL, DISCOUNT_TYPE VARCHAR(255) NULL, ADMIN_ADDITION_STATUS VARCHAR(255) NULL, CATALOG_DISC BIGINT DEFAULT NULL NULL, SNDBX_CATALOG_FLAG BIGINT DEFAULT NULL NULL, SNDBX_ORIG_ITEM_ID BIGINT DEFAULT NULL NULL, SNDBX_ORIG_RECORD_ID BIGINT DEFAULT NULL NULL, SNDBX_ID BIGINT DEFAULT NULL NULL, SNDBX_ARCHIVED_FLAG CHAR(1) NULL, SNDBX_DELETED_FLAG CHAR(1) NULL, SNDBX_TMPLT_RECORD_ID BIGINT DEFAULT NULL NULL, SNDBX_TIER BIGINT DEFAULT NULL NULL, IDENTIFIER_TYPE VARCHAR(255) NULL, IDENTIFIER_VALUE VARCHAR(255) NULL, QUANTITY INT NOT NULL, OFFER_ID BIGINT NOT NULL, CONSTRAINT PK_BLC_OFFER_PRICE_DATA PRIMARY KEY (OFFER_PRICE_DATA_ID));
ALTER TABLE blc_offer_audit ADD ACCOUNT_ID BIGINT DEFAULT null NULL;
ALTER TABLE blc_fg_adjustment ADD IS_FUTURE_CREDIT BIT DEFAULT 0 NULL;
ALTER TABLE blc_order_adjustment ADD IS_FUTURE_CREDIT BIT DEFAULT 0 NULL;
ALTER TABLE blc_offer ADD OFFER_ADJUSTMENT_TYPE VARCHAR(255) NULL;
ALTER TABLE blc_order_item_dtl_adj ADD IS_FUTURE_CREDIT BIT DEFAULT 0 NULL;
ALTER TABLE blc_admin_section ADD FOLDERABLE BIT DEFAULT 0 NULL;
ALTER TABLE blc_admin_section ADD FOLDERED_BY_DEFAULT BIT DEFAULT 0 NULL;
ALTER TABLE blc_offer ADD MAX_USES_STRATEGY VARCHAR(255) NULL;
ALTER TABLE blc_offer ADD MINIMUM_DAYS_PER_USAGE BIGINT DEFAULT null NULL;
ALTER TABLE blc_offer ADD USE_LIST_FOR_DISCOUNTS BIT DEFAULT 0 NULL;
CREATE INDEX OFFERAUDIT_ACCOUNT_INDEX ON blc_offer_audit(ACCOUNT_ID);
CREATE INDEX OFFER_PRICE_DATA_OFFER_INDEX ON blc_offer_price_data(OFFER_ID);
CREATE INDEX idx_BLOFPRDA_SNDBX_CATALO ON blc_offer_price_data(SNDBX_CATALOG_FLAG);
CREATE INDEX idx_BLOFPRDA_SNDBX_ID ON blc_offer_price_data(SNDBX_ID);
CREATE INDEX idx_BLOFPRDA_SNDBX_ORIG_I ON blc_offer_price_data(SNDBX_ORIG_ITEM_ID);
CREATE INDEX idx_BLOFPRDA_SNDBX_ORIG_R ON blc_offer_price_data(SNDBX_ORIG_RECORD_ID);
CREATE INDEX idx_BLOFPRDA_SNDBX_TMPLT_ ON blc_offer_price_data(SNDBX_TMPLT_RECORD_ID);
ALTER TABLE blc_offer_price_data ADD CONSTRAINT FKkprkllbin16hh5ay89t8we431 FOREIGN KEY (OFFER_ID) REFERENCES blc_offer (OFFER_ID) ON UPDATE RESTRICT ON DELETE RESTRICT;
6.1 Schema Changes
Liquibase
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-3.8.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
<changeSet author="broadleaf 6.1" id="1">
<dropIndex indexName="OFFER_MARKETING_MESSAGE_INDEX" tableName="blc_offer" />
</changeSet>
<changeSet author="broadleaf 6.1" id="2">
<renameColumn oldColumnName="MARKETING_MESSASGE" newColumnName="MARKETING_MESSAGE" tableName="blc_offer" columnDataType="VARCHAR(255)"/>
</changeSet>
<changeSet author="broadleaf 6.1" id="3">
<createIndex indexName="OFFER_MARKETING_MESSAGE_INDEX" tableName="blc_offer" unique="false">
<column name="MARKETING_MESSAGE"/>
</createIndex>
</changeSet>
</databaseChangeLog>
MySQL
DROP INDEX OFFER_MARKETING_MESSAGE_INDEX ON blc_offer;
ALTER TABLE blc_offer CHANGE MARKETING_MESSASGE MARKETING_MESSAGE VARCHAR(255);
CREATE INDEX OFFER_MARKETING_MESSAGE_INDEX ON blc_offer(MARKETING_MESSAGE);