DROP TABLE IF EXISTS `EasyIndex_enquiry`;
CREATE TABLE IF NOT EXISTS `EasyIndex_enquiry` (
  `nId` int(5) NOT NULL auto_increment,
  `nProductId` int(11) NOT NULL,
  `vTitle` varchar(255) NOT NULL,
  `vDescription` text NOT NULL,
  `dDate` date NOT NULL,
  `vPostedBy` varchar(255) NOT NULL,
  `vEmail` varchar(255) NOT NULL,
  `nStatus` int(1) NOT NULL default '0',
  PRIMARY KEY  (`nId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
DROP TABLE IF EXISTS `EasyIndex_payments`;
CREATE TABLE IF NOT EXISTS `EasyIndex_payments` (
  `nPaymentId` int(11) NOT NULL auto_increment,
  `nListId` int(11) NOT NULL,
  `vUserFirstName` varchar(255) NOT NULL,
  `vUserLastName` varchar(255) NOT NULL,
  `vAmount` float NOT NULL,
  `vProductName` varchar(255) NOT NULL,
  `dDate` timestamp NOT NULL default CURRENT_TIMESTAMP,
  `vPaymentStatus` enum('P','C') NOT NULL default 'P',
  `vTransactionId` varchar(255) NOT NULL,
  PRIMARY KEY  (`nPaymentId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
DROP TABLE IF EXISTS `EasyIndex_productcomment`;
CREATE TABLE IF NOT EXISTS `EasyIndex_productcomment` (
  `nId` int(5) NOT NULL auto_increment,
  `nProductId` int(4) NOT NULL,
  `vComment` text NOT NULL,
  `vName` varchar(150) NOT NULL,
  `vEmail` varchar(150) NOT NULL,
  `dDate` date NOT NULL,
  `nStatus` int(1) NOT NULL,
  PRIMARY KEY  (`nId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
DROP TABLE IF EXISTS `EasyIndex_productdesc`;
CREATE TABLE IF NOT EXISTS `EasyIndex_productdesc` (
  `id` bigint(20) NOT NULL auto_increment,
  `vFldname` varchar(100) default NULL,
  `vFlddesc` varchar(100) default NULL,
  `vFldType` varchar(100) default NULL,
  `vFldSize` varchar(100) default NULL,
  `vFldSearch` varchar(100) default NULL,
  `vInType` varchar(100) default NULL,
  `vlink` smallint(6) default '0',
  `nMandatory` int(11) NOT NULL default '0',
  `nEditable` int(11) NOT NULL default '0',
  `nStatus` int(11) NOT NULL default '0',
  `nRemovable` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;
DROP TABLE IF EXISTS `EasyIndex_productrating`;
CREATE TABLE IF NOT EXISTS `EasyIndex_productrating` (
  `nId` int(5) NOT NULL auto_increment,
  `nProductId` int(4) NOT NULL,
  `nRate` int(2) NOT NULL,
  `dDate` date NOT NULL,
  `nStatus` int(1) NOT NULL,
  PRIMARY KEY  (`nId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
DROP TABLE IF EXISTS `EasyIndex_settings`;
CREATE TABLE IF NOT EXISTS `EasyIndex_settings` (
  `settingfield` varchar(250) NOT NULL,
  `value` text
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `EasyIndex_statistics`;
CREATE TABLE IF NOT EXISTS `EasyIndex_statistics` (
  `nId` int(11) NOT NULL auto_increment,
  `nCount` text,
  `dTrackingDate` timestamp NULL default NULL,
  PRIMARY KEY  (`nId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
ALTER TABLE `EasyIndex_users` ADD `nSocialUserId` VARCHAR( 250 ) NOT NULL;
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';
