-- Create Table Statement for 'Contract'
DROP TABLE IF EXISTS `CONTRACT`;
CREATE TABLE `CONTRACT` (
ID bigint(20) NOT NULL,
MERCHANT_ACCOUNT_CODE int(11) NOT NULL,
CODE varchar,
CUSTOMER_ACCOUNT_CODE ,
CREATE_DATE datetime,
BARCODE varchar,
FIRST_NAME varchar,
LAST_NAME varchar,
MIDDLE_NAME varchar,
GENDER_CL varchar,
BIRTH_DATE datetime,
SOCIAL_SECURITY varchar,
SOCIAL_SECURITY_ENCODED varchar,
DRIVER_LICENSE_NUMBER varchar,
DRIVER_LICENSE_NUMBER_ENCODED varchar,
STREET1 varchar,
STREET2 varchar,
CITY varchar,
STATE varchar,
ZIP_CODE varchar,
HOME_PHONE varchar,
WORK_PHONE varchar,
CELL_PHONE varchar,
EMAIL varchar,
SKIN_TYPE_CL varchar,
EYE_COLOR_CL varchar,
BUYER_CODE varchar,
BUYER_FIRST_NAME varchar,
BUYER_LAST_NAME varchar,
BUYER_MIDDLE_NAME varchar,
BUYER_GENDER_CL varchar,
BUYER_STREET1 varchar,
BUYER_STREET2 varchar,
BUYER_CITY varchar,
BUYER_STATE varchar,
BUYER_ZIP_CODE varchar,
BUYER_BIRTH_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,
COMMENT varchar,
IS_ALLOW_CHECK_PAYMENT tinyint(1),
IS_ALLOW_CREDIT_CARD_PAYMENT tinyint(1),
IS_EXEMPT_SERVICE_TAX tinyint(1),
IS_EXEMPT_PRODUCT_TAX tinyint(1),
MAY_EARN_BONUS_BUCK tinyint(1),
IS_DISALLOWED_CONTACT tinyint(1),
IS_EXEMPT_BIOMETRICS tinyint(1),
PRIMARY_PAYMENT_OPTION_CODE varchar,
PRIMARY_PAYMENT_OPTION_CL varchar,
PRIMARY_PAYMENT_OPTION_HOLDER_NAME varchar,
PRIMARY_PAYMENT_OPTION_ACCOUNT_NUMBER varchar,
PRIMARY_PAYMENT_OPTION_TOKEN_CODE varchar,
PRIMARY_PAYMENT_OPTION_ACCESSORY varchar,
PRIMARY_PAYMENT_OPTION_ACCOUNT_NUMBER_MASKED varchar,
PRIMARY_PAYMENT_OPTION_ACCESSORY_MASKED varchar,
PRIMARY_PAYMENT_OPTION_STREET1 varchar,
PRIMARY_PAYMENT_OPTION_STREET2 varchar,
PRIMARY_PAYMENT_OPTION_CITY varchar,
PRIMARY_PAYMENT_OPTION_STATE varchar,
PRIMARY_PAYMENT_OPTION_ZIP_CODE varchar,
SECONDARY_PAYMENT_OPTION_CODE varchar,
SECONDARY_PAYMENT_OPTION_CL varchar,
SECONDARY_PAYMENT_OPTION_HOLDER_NAME varchar,
SECONDARY_PAYMENT_OPTION_ACCOUNT_NUMBER varchar,
SECONDARY_PAYMENT_OPTION_TOKEN_CODE varchar,
SECONDARY_PAYMENT_OPTION_ACCESSORY varchar,
SECONDARY_PAYMENT_OPTION_ACCOUNT_NUMBER_MASKED varchar,
SECONDARY_PAYMENT_OPTION_ACCESSORY_MASKED varchar,
SECONDARY_PAYMENT_OPTION_STREET1 varchar,
SECONDARY_PAYMENT_OPTION_STREET2 varchar,
SECONDARY_PAYMENT_OPTION_CITY varchar,
SECONDARY_PAYMENT_OPTION_STATE varchar,
SECONDARY_PAYMENT_OPTION_ZIP_CODE varchar,
USE_PRIMARY_PAYMENT_OPTION tinyint(1),
USE_SECONDARY_PAYMENT_OPTION tinyint(1),
BILLING_DATE datetime,
PAYMENT_COUNT int(11),
DUES_AMOUNT int(11),
RENEWAL_DUES_AMOUNT int(11),
IS_OPEN_END tinyint(1),
IS_COMPLIMENTARY tinyint(1),
PRORATED_FEE int(11),
INITIATION_FEE_PRICE int(11),
INITIATION_FEE_AMOUNT int(11),
CONTRACT_DOCUMENT_CODE bigint(20),
STATUS_CL varchar,
PAYMENT1_TRANSACTION_CODE varchar,
PAYMENT1_AMOUNT int(11),
PAYMENT1_CL varchar,
PAYMENT1_CREDIT_CARD_CL varchar,
PAYMENT1_SEQUENCE_NUMBER varchar,
PAYMENT1_RESPONSE_CODE varchar,
PAYMENT2_TRANSACTION_CODE varchar,
PAYMENT2_AMOUNT int(11),
PAYMENT2_CL varchar,
PAYMENT2_CREDIT_CARD_CL varchar,
PAYMENT2_SEQUENCE_NUMBER varchar,
PAYMENT2_RESPONSE_CODE varchar,
PAYMENT_PROCESSING_DATE datetime,
TAX_RATE float,
DUES_TAX_AMOUNT int(11),
RENEWAL_DUES_TAX_AMOUNT int(11),
INITIATION_FEE_TAX_AMOUNT int(11),
PRORATED_FEE_TAX_AMOUNT int(11),
POSTER_CODE varchar,
SALES_PERSON_CODE1 varchar,
SALES_PERSON_CODE2 varchar,
SALES_PERSON_NUMBER1 varchar,
LAST_UPDATE_DATE datetime,
LEAD_SOURCE_CODE varchar,
EFFECTIVE_DATE datetime,
EXPIRATION_DATE datetime,
STORE_NUMBER varchar,
IS_CANCEL_EXISTED_CONTRACT tinyint(1),
LEVEL int(11),
TERM int(11),
CONTRACT_CL varchar,
DRAWER_ID varchar,
COMMISSION_AMOUNT int(11),
SERVICE_TAX_RATE float,
SERVICE_TAX_AMOUNT int(11),
TAN_TAX_RATE float,
TAN_TAX_AMOUNT int(11),
IS_MARKETING_EMAIL_ALLOWED tinyint(1),
IS_BILLING_EMAIL_ALLOWED tinyint(1),
MEMBERSHIP_FK bigint(20),
REFERRAL1_FIRST_NAME varchar,
REFERRAL1_LAST_NAME varchar,
REFERRAL1_CELL_PHONE varchar,
REFERRAL1_EMAIL varchar,
REFERRAL1_CASE_OBJECTIVE_CODE varchar,
REFERRAL2_FIRST_NAME varchar,
REFERRAL2_LAST_NAME varchar,
REFERRAL2_CELL_PHONE varchar,
REFERRAL2_EMAIL varchar,
REFERRAL2_CASE_OBJECTIVE_CODE varchar,
REFERRAL3_FIRST_NAME varchar,
REFERRAL3_LAST_NAME varchar,
REFERRAL3_CELL_PHONE varchar,
REFERRAL3_EMAIL varchar,
REFERRAL3_CASE_OBJECTIVE_CODE varchar,
LEAD_FK bigint(20),
LEAD_CASE_FK bigint(20),
DISCOUNT_CODE varchar,
PRIMARY KEY ()
) ENGINE=InnoDB;