CREATE TABLE `EasyIndex_plans` ( `nPlanId` BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`vPlanName` VARCHAR( 250 ) NOT NULL ,
`vPlanAmount` FLOAT NOT NULL ,
`vPlantype` ENUM( 'O', 'M' ) NOT NULL COMMENT 'O-One time,M-Monthly',
`vPlanDuration` BIGINT NOT NULL ,
`vPlanStatus` ENUM( 'E', 'D' ) NOT NULL DEFAULT 'E',
`dPlaneDate` DATE NOT NULL ) ENGINE = MYISAM ;

ALTER TABLE `EasyIndex_product` ADD `nPaymentStatus` ENUM( 'P', 'N', 'O' ) NOT NULL DEFAULT 'P' COMMENT 'P-paid,N- not paid,O-one timepayment';

ALTER TABLE `EasyIndex_payments` ADD `vPaymentType` ENUM( 'F', 'L' ) NOT NULL DEFAULT 'F' COMMENT 'F-featured,L-listing';

ALTER TABLE `EasyIndex_product` ADD `nPlanId` BIGINT NOT NULL;

CREATE TABLE `EasyIndex_cms` (
`nContentId` BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`vTitle` VARCHAR( 255 ) NOT NULL ,
`vDescription` TEXT NOT NULL ,
`dCreatedDate` DATE NOT NULL ,
`nStatus` TINYINT NOT NULL
) ENGINE = MYISAM ;

RENAME TABLE `clients_easyindexnew`.`tbl_zipcode` TO `clients_easyindexnew`.`EasyIndex_tbl_zipcode` ;
ALTER TABLE `EasyIndex_product` ADD `nPlanExpiryDate` DATE NOT NULL AFTER `nPaymentStatus`;
CREATE TABLE IF NOT EXISTS `EasyIndex_tbl_zipcode` (
  `zipid` bigint(20) NOT NULL auto_increment,
  `zipcode` varchar(10) NOT NULL default '',
  `statecode` varchar(5) NOT NULL default '',
  `latitude` varchar(50) NOT NULL default '',
  `longitude` varchar(50) NOT NULL default '',
  `city` varchar(50) NOT NULL default '',
  `state` varchar(50) NOT NULL default '',
  PRIMARY KEY  (`zipid`),
  KEY `ZIPCODE` (`zipcode`),
  KEY `STATECODE` (`statecode`),
  KEY `STATE` (`state`),
  KEY `CITY` (`city`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
ALTER TABLE `EasyIndex_product` ADD `nParentCatId` BIGINT( 11 ) NOT NULL COMMENT 'Parent category Id' AFTER `nUserId`;
ALTER TABLE `EasyIndex_payments` CHANGE `vPaymentType` `vPaymentType` ENUM( 'F', 'L', 'R' ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'F' COMMENT 'F-featured,L-listing,R-Renewal';