

DROP TABLE IF EXISTS PAT_CONTACT;  



DROP TABLE IF EXISTS PAT_TENANT;  


DROP TABLE IF EXISTS PAT_PARTY_DATA;  


DROP TABLE IF EXISTS PAT_ADDRESS;  


DROP TABLE IF EXISTS PAT_BANKCARD;  

DROP TABLE IF EXISTS PAT_REALNAME;  


DROP TABLE IF EXISTS `PAT_PARTY`;
CREATE TABLE `PAT_PARTY` (
  `UUID` varchar(32) NOT NULL,
  `USERNAME` varchar(64) DEFAULT NULL,
  `SAFEWORD` varchar(32) DEFAULT NULL,
  `CREATE_TIME` datetime DEFAULT NULL,
  `LAST_LOGIN_TIME` datetime DEFAULT NULL,
  `ENABLED` char(1) DEFAULT NULL,
  `WITHDRAWAUTHORITY` char(1) DEFAULT NULL,
  `LOGINAUTHORITY` char(1) DEFAULT NULL,
  `REMARKS` varchar(1024) DEFAULT NULL,
  `ROLENAME` varchar(32) DEFAULT NULL,
  `RECHARGE_AUTHORITY` char(1) DEFAULT 'Y',
  `EMAIL` varchar(64) DEFAULT NULL,
  `PHONE` varchar(64) DEFAULT NULL,
  `ACTIVE` char(1) DEFAULT 'Y',
  `KYC_AUTHORITY` char(1) DEFAULT 'Y',
  `USERCODE` varchar(32) DEFAULT NULL,
  `NAME` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`UUID`),
  KEY `INDEX_PARTY_LAST_LOGIN_TIME` (`LAST_LOGIN_TIME`),
  KEY `INDEX_PARTY_CREATE_TIME` (`CREATE_TIME`),
  KEY `INDEX_PARTY_USERNAME` (`USERNAME`,`CREATE_TIME`),
  KEY `INDEX_PARTY_USER_ROLE` (`CREATE_TIME`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
