
# This is a fix for InnoDB in MySQL >= 4.1.x
# It "suspends judgement" for fkey relationships until are tables are set.
SET FOREIGN_KEY_CHECKS = 0;

#-----------------------------------------------------------------------------
#-- PMT_COMPANYS_LEGAL_STATUS
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_COMPANYS_LEGAL_STATUS`;


CREATE TABLE `PMT_COMPANYS_LEGAL_STATUS`
(
	`ID` INTEGER(11)  NOT NULL AUTO_INCREMENT,
	`NAME` VARCHAR(32),
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_CUSTOMER_CATEGORY
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_CUSTOMER_CATEGORY`;


CREATE TABLE `PMT_CUSTOMER_CATEGORY`
(
	`ID` INTEGER(11)  NOT NULL AUTO_INCREMENT,
	`NAME` VARCHAR(32),
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_CUSTOMER_TYPE
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_CUSTOMER_TYPE`;


CREATE TABLE `PMT_CUSTOMER_TYPE`
(
	`ID` INTEGER(11)  NOT NULL AUTO_INCREMENT,
	`NAME` VARCHAR(32),
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_DSA_REPORT
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_DSA_REPORT`;


CREATE TABLE `PMT_DSA_REPORT`
(
	`APP_UID` VARCHAR(32)  NOT NULL,
	`APP_NUMBER` INTEGER(11)  NOT NULL,
	`APP_STATUS` VARCHAR(10)  NOT NULL,
	`FRM_MOBILE` VARCHAR(255),
	`FRM_CONTACT_PERSON_NAME` VARCHAR(255),
	`FRM_LOAN_AMOUNT` VARCHAR(15),
	`COMPANY_NAME` VARCHAR(255),
	`FACILITY_AMOUNT_IN_LACS` VARCHAR(15),
	`FRM_RATE_OF_INTEREST` FLOAT(11),
	`CIBILFRM_SCORE` VARCHAR(255),
	`FRMCIBIL_CIBIL_SCORE` VARCHAR(255),
	`FRM_ANCHOR_NAME_LABEL` MEDIUMTEXT,
	`CURRENT_EMPLOYEE` VARCHAR(255),
	`FRM_LOAN_SOURCE_LABEL` VARCHAR(32),
	`FRM_LOAN_SOURCE` VARCHAR(255),
	`APPROVAL` VARCHAR(255),
	`ASSIGNTOCM` VARCHAR(255),
	`FRM_LOAN_PRODUCT` VARCHAR(255),
	`FRM_LOAN_PRODUCT_LABEL` VARCHAR(32),
	`FRM_SANCTION_AMOUNT` FLOAT(11),
	`FACILITY_AMOUNT_IN_LACS_LABEL` VARCHAR(32),
	PRIMARY KEY (`APP_UID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_FIELDS
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_FIELDS`;


CREATE TABLE `PMT_FIELDS`
(
	`FIELD_ID` INTEGER(12)  NOT NULL AUTO_INCREMENT,
	`FIELD_CODE` VARCHAR(100)  NOT NULL,
	`FIELD_NAME` VARCHAR(100)  NOT NULL,
	`GROUP_CODE` VARCHAR(50)  NOT NULL,
	`FIELD_TYPE` VARCHAR(12)  NOT NULL,
	PRIMARY KEY (`FIELD_ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_FINANCIAL_DATA
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_FINANCIAL_DATA`;


CREATE TABLE `PMT_FINANCIAL_DATA`
(
	`ID` INTEGER(12)  NOT NULL AUTO_INCREMENT,
	`FIELD_ID` INTEGER(12)  NOT NULL,
	`FY_INTERVAL_ID` INTEGER(12)  NOT NULL,
	`VALUE` DOUBLE  NOT NULL,
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_FINANCIAL_YEARS_INTERVALS
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_FINANCIAL_YEARS_INTERVALS`;


CREATE TABLE `PMT_FINANCIAL_YEARS_INTERVALS`
(
	`ID` INTEGER(12)  NOT NULL AUTO_INCREMENT,
	`YR_INTERVAL` VARCHAR(50)  NOT NULL,
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_INDUSTRY_SECTOR
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_INDUSTRY_SECTOR`;


CREATE TABLE `PMT_INDUSTRY_SECTOR`
(
	`ID` INTEGER(11)  NOT NULL AUTO_INCREMENT,
	`NAME` VARCHAR(32),
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_LEVEL_OF_EDUCATION
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_LEVEL_OF_EDUCATION`;


CREATE TABLE `PMT_LEVEL_OF_EDUCATION`
(
	`ID` INTEGER(11)  NOT NULL AUTO_INCREMENT,
	`NAME` VARCHAR(32),
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_LOAN_PURPOSE
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_LOAN_PURPOSE`;


CREATE TABLE `PMT_LOAN_PURPOSE`
(
	`ID` INTEGER(11)  NOT NULL AUTO_INCREMENT,
	`NAME` VARCHAR(32),
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_LOAN_SOURCE
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_LOAN_SOURCE`;


CREATE TABLE `PMT_LOAN_SOURCE`
(
	`ID` INTEGER(11)  NOT NULL AUTO_INCREMENT,
	`NAME` VARCHAR(64),
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_MARITAL_STATUS
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_MARITAL_STATUS`;


CREATE TABLE `PMT_MARITAL_STATUS`
(
	`ID` INTEGER(11)  NOT NULL AUTO_INCREMENT,
	`NAME` VARCHAR(32),
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_NATURE_OF_BUSINESS
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_NATURE_OF_BUSINESS`;


CREATE TABLE `PMT_NATURE_OF_BUSINESS`
(
	`ID` INTEGER(11)  NOT NULL AUTO_INCREMENT,
	`NAME` VARCHAR(32),
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_ROI_RANGE
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_ROI_RANGE`;


CREATE TABLE `PMT_ROI_RANGE`
(
	`ID` INTEGER(11)  NOT NULL AUTO_INCREMENT,
	`POINTS` DOUBLE,
	`POINTS_RANGE` DOUBLE,
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_SELLER_PORTAL
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_SELLER_PORTAL`;


CREATE TABLE `PMT_SELLER_PORTAL`
(
	`ID` INTEGER(11)  NOT NULL AUTO_INCREMENT,
	`NAME` VARCHAR(64),
	`IS_PARTNER` INTEGER(11),
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_ADDRESS_PROOF_LIST
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_ADDRESS_PROOF_LIST`;


CREATE TABLE `PMT_ADDRESS_PROOF_LIST`
(
	`ID` INTEGER(11)  NOT NULL AUTO_INCREMENT,
	`NAME` VARCHAR(255)  NOT NULL,
	`STATUS` INTEGER  NOT NULL,
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_NEGATIVE_AREA_LIST
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_NEGATIVE_AREA_LIST`;


CREATE TABLE `PMT_NEGATIVE_AREA_LIST`
(
	`ID` BIGINT  NOT NULL AUTO_INCREMENT,
	`REGION` VARCHAR(500),
	`STATE` VARCHAR(500),
	`CITY` VARCHAR(500),
	`AREA` VARCHAR(999),
	`PINCODE` BIGINT,
	`PRIORITY` VARCHAR(500),
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_PREMISES
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_PREMISES`;


CREATE TABLE `PMT_PREMISES`
(
	`ID` INTEGER(11)  NOT NULL AUTO_INCREMENT,
	`NAME` VARCHAR(32),
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_REASSIGN_REASON
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_REASSIGN_REASON`;


CREATE TABLE `PMT_REASSIGN_REASON`
(
	`ID` BIGINT  NOT NULL AUTO_INCREMENT,
	`REASON` VARCHAR(500),
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_PM_BANK_NAMES
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_PM_BANK_NAMES`;


CREATE TABLE `PMT_PM_BANK_NAMES`
(
	`ID` INTEGER(10)  NOT NULL AUTO_INCREMENT,
	`BANK_NAMES` VARCHAR(50),
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_PRODUCTS_SOLD
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_PRODUCTS_SOLD`;


CREATE TABLE `PMT_PRODUCTS_SOLD`
(
	`ID` INTEGER(11)  NOT NULL AUTO_INCREMENT,
	`NAME` VARCHAR(32),
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_MACHINE_PROVIDER
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_MACHINE_PROVIDER`;


CREATE TABLE `PMT_MACHINE_PROVIDER`
(
	`ID` BIGINT(32)  NOT NULL AUTO_INCREMENT,
	`NAME` VARCHAR(64),
	`IS_ACTIVE` INTEGER  NOT NULL,
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_EXCEPTION_TYPE
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_EXCEPTION_TYPE`;


CREATE TABLE `PMT_EXCEPTION_TYPE`
(
	`ID` BIGINT  NOT NULL AUTO_INCREMENT,
	`DESCRIPTION` CHAR(64)  NOT NULL,
	`STATUS` INTEGER  NOT NULL,
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_CUSTOMER_INFO
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_CUSTOMER_INFO`;


CREATE TABLE `PMT_CUSTOMER_INFO`
(
	`APP_UID` VARCHAR(32)  NOT NULL,
	`APP_NUMBER` INTEGER(11)  NOT NULL,
	`APP_STATUS` VARCHAR(10)  NOT NULL,
	`COMPANY_NAME_LABEL` VARCHAR(32),
	`COMPANY_NAME` VARCHAR(255),
	`FRM_LOAN_PRODUCT` VARCHAR(255),
	`FRM_LOAN_PRODUCT_LABEL` VARCHAR(32),
	`ASSIGNEDUSERNAME` VARCHAR(255),
	`APPROVAL` VARCHAR(255),
	`APPROVALSTATUS` VARCHAR(255),
	`USR_USERNAME` VARCHAR(255),
	PRIMARY KEY (`APP_UID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_REASON
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_REASON`;


CREATE TABLE `PMT_REASON`
(
	`ID` INTEGER(10)  NOT NULL,
	`REASON` VARCHAR(100)  NOT NULL,
	`ISLOANREQUEST` SMALLINT  NOT NULL,
	`ISMSWIPE` SMALLINT  NOT NULL,
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_LOAN_TYPE
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_LOAN_TYPE`;


CREATE TABLE `PMT_LOAN_TYPE`
(
	`ID` INTEGER(11)  NOT NULL AUTO_INCREMENT,
	`NAME` VARCHAR(64),
	`IS_ACTIVE` INTEGER  NOT NULL,
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_IFSC_RECORD
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_IFSC_RECORD`;


CREATE TABLE `PMT_IFSC_RECORD`
(
	`BANK_NAME` CHAR(255)  NOT NULL,
	`IFSC_CODE` CHAR(50)  NOT NULL,
	`MICR` CHAR(50)  NOT NULL,
	`BRANCH_NAME` VARCHAR(256),
	`ADDRESS` VARCHAR(256),
	`CONTACT` CHAR(20),
	`CITY` CHAR(20),
	`DISTRICT` CHAR(20),
	`STATE` CHAR(20),
	`ID` BIGINT(11)  NOT NULL AUTO_INCREMENT,
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_IFSCCODES
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_IFSCCODES`;


CREATE TABLE `PMT_IFSCCODES`
(
	`IFSCCD` CHAR(11)  NOT NULL,
	`BANKNAME` CHAR(80),
	`BRANCHNAME` CHAR(80),
	`BANKRBICD` SMALLINT,
	`BRANCHRBICD` SMALLINT,
	`ADDR1` CHAR(40),
	`CITY` CHAR(20),
	`STATE` CHAR(20),
	PRIMARY KEY (`IFSCCD`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_PROBE_UPDATE_BASEDATA_LOG
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_PROBE_UPDATE_BASEDATA_LOG`;


CREATE TABLE `PMT_PROBE_UPDATE_BASEDATA_LOG`
(
	`CIN` VARCHAR(50)  NOT NULL,
	`LAST_UPDATE_DATE` DATETIME  NOT NULL,
	PRIMARY KEY (`CIN`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_PROBE_COMPREHENSIVE
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_PROBE_COMPREHENSIVE`;


CREATE TABLE `PMT_PROBE_COMPREHENSIVE`
(
	`CIN` CHAR(25)  NOT NULL,
	`DATA` MEDIUMTEXT  NOT NULL,
	PRIMARY KEY (`CIN`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- PMT_PROBE_STATE
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `PMT_PROBE_STATE`;


CREATE TABLE `PMT_PROBE_STATE`
(
	`ID` INTEGER(10)  NOT NULL AUTO_INCREMENT,
	`STATE` VARCHAR(225)  NOT NULL,
	PRIMARY KEY (`ID`)
)ENGINE=InnoDB  DEFAULT CHARSET='utf8';
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;
