-- Create Table Statement for 'Customer Account'
DROP TABLE IF EXISTS `CUSTOMER_ACCOUNT`;
CREATE TABLE `CUSTOMER_ACCOUNT` (
	ID bigint(20) NOT NULL,
	REF_CODE varchar,
	CREATE_DATE datetime,
	IMPORT_DATE datetime,
	IS_ACTIVE tinyint(1),
	BALANCE int(11),
	STATUS varchar,
	BENEFICIARY_INFO varchar,
	MERCHANT_ACCOUNT_CODE int(11) NOT NULL,
	COLLECTOR_ACCOUNT_CODE int(11),
	FIRST_BILLING_DATE datetime,
	NOTES varchar,
	LAST_UPDATE_DATE datetime,
	LAST_PAYMENT_DATE datetime,
	LAST_RETURN_REASON varchar,
	COLLECTOR_CODE varchar,
	SENT_COLLECTIONS_BALANCE int(11),
	STATUS_CHANGE_DATE datetime,
	SENT_COLLECTIONS_DATE datetime,
	LAST_ACTION_DATE datetime,
	COLLECTIONS_PRIORITY_CL varchar,
	EXTERNAL_IDENTIFIER varchar,
	LAST_SEQUENCE_NUMBER int(11),
	WRITE_OFF_BALANCE int(11),
	CUSTOM_FIELDS varchar,
	NEEDS_BALANCING tinyint(1),
	LATE_FEE_BALANCE int(11),
	RETURN_FEE_BALANCE int(11),
	SYNCHRONIZATION_CODE varchar,
	NEXT_BALANCING_DATE datetime,
	IS_DELINQUENT tinyint(1),
	PAYMENT_PLAN_VALUE int(11),
	LAST_DECLINE_DATE datetime,
	OLDEST_INVOICE_DUE_DATE datetime,
	IS_REINSTATED tinyint(1),
	IS_COLLECTIONS_FEE_APPLIED tinyint(1),
	BUYER_CODE varchar,
	BUYER_FIRST_NAME varchar,
	BUYER_LAST_NAME varchar,
	BUYER_MIDDLE_NAME varchar,
	BUYER_STREET1 varchar,
	BUYER_STREET2 varchar,
	BUYER_CITY varchar,
	BUYER_STATE varchar,
	BUYER_ZIP_CODE varchar,
	BUYER_BITH_DATE datetime,
	BUYER_SOCIAL_SECURITY varchar,
	BUYER_SOCIAL_SECURITY_ENCODED varchar,
	BUYER_DRIVER_LICENSE_NUMBER varchar,
	BUYER_DRIVER_LICENSE_NUMBER_ENCODED varchar,
	BUYER_PHONE varchar,
	LAST_REINSTATE_DATE datetime,
	ORIGINAL_DELINQUENCY_DATE datetime,
	LAST_CREDIT_REPORTING_DATE datetime,
	CREDIT_AGENCY_STATUS_CL varchar,
	SCHEDULED_PAYMENT_VALUE int(11),
	LAST_SCHEDULED_PAYMENT_CREATE_DATE datetime,
	CUSTOM_DATE1 datetime,
	IS_TAX1_EXEMPT tinyint(1),
	IS_TAX2_EXEMPT tinyint(1),
	IS_TAX3_EXEMPT tinyint(1),
	IS_TAX4_EXEMPT tinyint(1),
	IS_TAX5_EXEMPT tinyint(1),
	ACCOUNT_GROUP_CODE_FK bigint(20),
	LAST_ACTION_FK bigint(20),
	DEFAULT_PAYMENT_OPTION_FK bigint(20),
	DEFAULT_PAYMENT_PLAN_FK bigint(20),
	DEFAULT_BILLING_CYCLE_FK bigint(20),
	CUSTOMER_FK bigint(20),
	DEFAULT_CONTRACT_FK bigint(20),
	REF_CODE_REVERSED varchar,
	IMPORT_LOG_CODE bigint(20),
	CREDIT_AGENCY_DISPUTE_CL varchar,
	PREV_CREDIT_AGENCY_DISPUTE_CL varchar,
	BASE_OBJECT_CODE bigint(20),
	PAYMENT_OPTIONS bigint(20),
	CONTRACT_DOCUMENT_FK bigint(20),
	LAST_CREDIT_AGENCY_TRANSACTION_FK bigint(20),
	SCAN_ID_FK bigint(20),
	LAST_SEQUENCE_NUMBER int(11),
	LAST_SEQUENCE_NUMBER int(11),
	IMPORT_LOG_CODE bigint(20),
	IMPORT_LOG_CODE bigint(20),
	IMPORT_LOG_CODE bigint(20),
	IS_ACTIVE tinyint(1),
	BALANCE int(11),
	STATUS varchar,
	CUSTOMER_FK bigint(20),
	PRIMARY KEY (ID)
) ENGINE=InnoDB;