ALTER TABLE BLC_PAYMENT_TRANSACTION ADD GATEWAY_MESSAGE VARCHAR2(500 CHAR);
ALTER TABLE BLC_PAYMENT_TRANSACTION ADD GATEWAY_TRANSACTION_ID VARCHAR2(255 CHAR);
CREATE TABLE BLC_SAVED_PAYMENT_METHOD (ID VARCHAR2(36 CHAR) NOT NULL, ATTRIBUTES CLOB, BILLING_ADDRESS CLOB, IS_DEFAULT_FOR_OWNER CHAR(1 CHAR) DEFAULT 'N', DISPLAY_ATTRIBUTES CLOB, GATEWAY_TYPE VARCHAR2(60 CHAR), LAST_TX_DATE_TIME TIMESTAMP(6), LAST_TX_RESULT_CODE VARCHAR2(255 CHAR), NAME VARCHAR2(255 CHAR), ORIGINATING_PAYMENT_ID VARCHAR2(36 CHAR), OWNING_USER_ID VARCHAR2(36 CHAR), OWNING_USER_TYPE VARCHAR2(60 CHAR), PAYMENT_METHOD_PROPERTIES CLOB, TRK_ARCHIVED CHAR(1 CHAR) DEFAULT 'N' NOT NULL, AUDIT_CREATION_TIME TIMESTAMP(6), AUDIT_CREATOR VARCHAR2(60 CHAR), AUDIT_UPDATE_TIME TIMESTAMP(6), AUDIT_UPDATER VARCHAR2(60 CHAR), TRK_CHANGE_DETAILS CLOB, TRK_TENANT_ID VARCHAR2(36 CHAR), TYPE VARCHAR2(60 CHAR), VERSION NUMBER(10, 0) NOT NULL, CONSTRAINT CT_MQZ919ESPKHOYAX511TU PRIMARY KEY (ID));
ALTER TABLE BLC_PAYMENT ADD OWNING_USER_ID VARCHAR2(36 CHAR);
ALTER TABLE BLC_PAYMENT ADD OWNING_USER_TYPE VARCHAR2(60 CHAR);
UPDATE blc_payment SET owning_user_type = CASE WHEN is_customer_registered = 'Y' THEN 'BLC_CUSTOMER' WHEN is_customer_registered = 'N' THEN 'ANONYMOUS' END, owning_user_id = CASE WHEN is_customer_registered = 'Y' THEN customer_id WHEN is_customer_registered = 'N' THEN NULL END;
ALTER TABLE BLC_PAYMENT ADD SHOULD_SAVE_PMT_FOR_FUTURE_USE CHAR(1 CHAR) DEFAULT 'N' NOT NULL;
UPDATE blc_payment SET should_save_pmt_for_future_use = should_save_pmt_to_customer;
ALTER TABLE BLC_PAYMENT_TRANSACTION ADD MANAGEMENT_STATE_REASON VARCHAR2(60 CHAR);
ALTER TABLE BLC_PAYMENT_TRANSACTION ADD PREVIOUS_REQUEST_IDS CLOB;
