-- Create Table Statement for 'Terminal'
DROP TABLE IF EXISTS `TERMINAL`;
CREATE TABLE `TERMINAL` (
	MERCHANT_ACCOUNT_CODE int(11) NOT NULL,
	CREATE_DATE datetime,
	IS_ACTIVE tinyint(1),
	CODE bigint(20) NOT NULL,
	REF_CODE varchar,
	TERMINAL_MODEL_CODE varchar,
	IP_ADDRESS varchar,
	PROCESSOR_TERMINAL_ID varchar,
	PROCESSOR_CUSTOM_FIELD1 varchar,
	PROCESSOR_CUSTOM_FIELD2 varchar,
	MERCHANT_ACCOUNT_PROFILE_FK bigint(20),
	MERCHANT_ACCOUNT_PROFILE_TERMINALS_IDX int(11),
	STATUS_CL varchar,
	TERMINAL_CL varchar,
	ACTIVATION_DATE datetime,
	ACTIVATION_CODE varchar,
	LAST_CREDENTIALS_GENERATION_DATE datetime,
	LAST_CREDENTIALS_CHANGE_DATE datetime,
	PASSWORD varchar,
	NEW_PASSWORD varchar,
	LAST_UPDATE_DATE datetime,
	NEW_MERCHANT_ACCOUNT_CODE int(11),
	NEW_TERMINAL_CODE bigint(20),
	UPDATE_MODE_CL varchar,
	TERMINAL_LEVEL_CL varchar,
	LAST_TRANSACTION_DATE datetime,
	KEY_ROTATION_REQUEST_DATE_P2PE datetime,
	IS_PROVIDER_CONFIGURATION_REQUIRED tinyint(1),
	LAST_ACTIVITY_DATE datetime,
	LAST_ACTIVITY_NAME varchar,
	LAST_ACTIVITY_DATE datetime,
	LAST_ACTIVITY_NAME varchar,
	ONBOARDING_TERMINAL_FK bigint(20),
	IS_PROCESSOR_ACTIVATED tinyint(1),
	LAST_ACTIVITY_DATE datetime,
	LAST_ACTIVITY_NAME varchar,
	IS_PROCESSOR_ACTIVATED tinyint(1),
	ONBOARDING_TERMINAL_FK bigint(20),
	IS_PROVIDER_CONFIGURATION_REQUIRED tinyint(1),
	IS_PROCESSOR_ACTIVATED tinyint(1),
	ONBOARDING_TERMINAL_FK bigint(20),
	IS_PROVIDER_CONFIGURATION_REQUIRED tinyint(1),
	VERSION int(11) NOT NULL,
	ACTIVATION_ATTEMPT_COUNT int(11),
	AUTHENTICATION_CODE_EXPIRATION_DATE datetime,
	ACTIVATION_ATTEMPT_COUNT int(11),
	AUTHENTICATION_CODE_EXPIRATION_DATE datetime,
	ACTIVATION_ATTEMPT_COUNT int(11),
	AUTHENTICATION_CODE_EXPIRATION_DATE datetime,
	PRIMARY KEY (CODE)
) ENGINE=InnoDB;