CREATE TABLE `u_yf_squoteenquiries_invfield` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `columnname` varchar(30) NOT NULL,
  `label` varchar(50) NOT NULL,
  `invtype` varchar(30) NOT NULL,
  `presence` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `defaultvalue` varchar(255) DEFAULT NULL,
  `sequence` int(10) unsigned NOT NULL,
  `block` tinyint(1) unsigned NOT NULL,
  `displaytype` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `params` text,
  `colspan` tinyint(1) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_squoteenquiries_invmap` (
  `module` varchar(50) NOT NULL,
  `field` varchar(50) NOT NULL,
  `tofield` varchar(50) NOT NULL,
  PRIMARY KEY (`module`,`field`,`tofield`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_squoteenquiriescf` (
  `squoteenquiriesid` int(10) NOT NULL,
  PRIMARY KEY (`squoteenquiriesid`),
  CONSTRAINT `fk_1_u_yf_squoteenquiriescf` FOREIGN KEY (`squoteenquiriesid`) REFERENCES `u_yf_squoteenquiries` (`squoteenquiriesid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_squotes` (
  `squotesid` int(10) NOT NULL DEFAULT '0',
  `squotes_no` varchar(255) DEFAULT '',
  `subject` varchar(255) DEFAULT NULL,
  `salesprocessid` int(10) DEFAULT NULL,
  `scalculationsid` int(10) DEFAULT NULL,
  `category` varchar(255) DEFAULT NULL,
  `squotes_status` varchar(255) DEFAULT NULL,
  `accountid` int(10) DEFAULT NULL,
  `response_time` decimal(10,2) DEFAULT '0.00',
  `company` varchar(255) DEFAULT NULL,
  `sum_time` decimal(10,2) DEFAULT '0.00',
  `sum_total` decimal(28,8) DEFAULT NULL,
  `sum_marginp` decimal(10,2) DEFAULT NULL,
  `sum_margin` decimal(28,8) DEFAULT NULL,
  `sum_gross` decimal(28,8) DEFAULT NULL,
  `sum_discount` decimal(28,8) DEFAULT NULL,
  `valid_until` date DEFAULT NULL,
  PRIMARY KEY (`squotesid`),
  KEY `salesprocessid` (`salesprocessid`),
  KEY `scalculationsid` (`scalculationsid`),
  KEY `accountid` (`accountid`),
  CONSTRAINT `fk_1_u_yf_squotes` FOREIGN KEY (`squotesid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_squotes_address` (
  `squotesaddressid` int(10) NOT NULL,
  `addresslevel1a` varchar(255) DEFAULT NULL,
  `addresslevel2a` varchar(255) DEFAULT NULL,
  `addresslevel3a` varchar(255) DEFAULT NULL,
  `addresslevel4a` varchar(255) DEFAULT NULL,
  `addresslevel5a` varchar(255) DEFAULT NULL,
  `addresslevel6a` varchar(255) DEFAULT NULL,
  `addresslevel7a` varchar(255) DEFAULT NULL,
  `addresslevel8a` varchar(255) DEFAULT NULL,
  `buildingnumbera` varchar(100) DEFAULT NULL,
  `localnumbera` varchar(100) DEFAULT NULL,
  `poboxa` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`squotesaddressid`),
  CONSTRAINT `u_yf_squotes_address_ibfk_1` FOREIGN KEY (`squotesaddressid`) REFERENCES `u_yf_squotes` (`squotesid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_squotes_inventory` (
  `id` int(10) DEFAULT NULL,
  `seq` int(10) DEFAULT NULL,
  `name` int(10) NOT NULL DEFAULT '0',
  `qty` decimal(25,3) NOT NULL DEFAULT '0.000',
  `discount` decimal(28,8) DEFAULT '0.00000000',
  `discountparam` varchar(255) DEFAULT NULL,
  `marginp` decimal(28,8) DEFAULT '0.00000000',
  `margin` decimal(28,8) DEFAULT '0.00000000',
  `comment1` text,
  `price` decimal(28,8) NOT NULL DEFAULT '0.00000000',
  `total` decimal(28,8) NOT NULL DEFAULT '0.00000000',
  `purchase` decimal(28,8) NOT NULL DEFAULT '0.00000000',
  `tax` decimal(28,8) NOT NULL DEFAULT '0.00000000',
  `taxparam` varchar(255) NOT NULL,
  `gross` decimal(28,8) NOT NULL DEFAULT '0.00000000',
  `discountmode` tinyint(1) NOT NULL DEFAULT '0',
  `taxmode` tinyint(1) NOT NULL DEFAULT '0',
  `currency` int(10) DEFAULT NULL,
  `currencyparam` varchar(1024) DEFAULT NULL,
  `net` decimal(28,8) NOT NULL DEFAULT '0.00000000',
  `qtyparam` tinyint(1) DEFAULT '0',
  `unit` varchar(255) DEFAULT NULL,
  `subunit` varchar(255) DEFAULT NULL,
  KEY `id` (`id`),
  CONSTRAINT `fk_1_u_yf_squotes_inventory` FOREIGN KEY (`id`) REFERENCES `u_yf_squotes` (`squotesid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_squotes_invfield` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `columnname` varchar(30) NOT NULL,
  `label` varchar(50) NOT NULL,
  `invtype` varchar(30) NOT NULL,
  `presence` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `defaultvalue` varchar(255) DEFAULT NULL,
  `sequence` int(10) unsigned NOT NULL,
  `block` tinyint(1) unsigned NOT NULL,
  `displaytype` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `params` text,
  `colspan` tinyint(1) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_squotes_invmap` (
  `module` varchar(50) NOT NULL,
  `field` varchar(50) NOT NULL,
  `tofield` varchar(50) NOT NULL,
  PRIMARY KEY (`module`,`field`,`tofield`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_squotescf` (
  `squotesid` int(10) NOT NULL,
  PRIMARY KEY (`squotesid`),
  CONSTRAINT `fk_1_u_yf_squotescf` FOREIGN KEY (`squotesid`) REFERENCES `u_yf_squotes` (`squotesid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_srecurringorders` (
  `srecurringordersid` int(10) NOT NULL DEFAULT '0',
  `srecurringorders_no` varchar(255) DEFAULT '',
  `subject` varchar(255) DEFAULT NULL,
  `salesprocessid` int(10) DEFAULT NULL,
  `squotesid` int(10) DEFAULT NULL,
  `category` varchar(255) DEFAULT NULL,
  `srecurringorders_status` varchar(255) DEFAULT NULL,
  `accountid` int(10) DEFAULT NULL,
  `date_start` date DEFAULT NULL,
  `date_end` date DEFAULT NULL,
  `duedate` date DEFAULT NULL,
  `response_time` decimal(10,2) DEFAULT '0.00',
  `company` varchar(255) DEFAULT NULL,
  `sum_time` decimal(10,2) DEFAULT '0.00',
  PRIMARY KEY (`srecurringordersid`),
  KEY `salesprocessid` (`salesprocessid`),
  KEY `squotesid` (`squotesid`),
  KEY `accountid` (`accountid`),
  CONSTRAINT `fk_1_u_yf_srecurringorders` FOREIGN KEY (`srecurringordersid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_srecurringorders_address` (
  `srecurringordersaddressid` int(10) NOT NULL,
  `addresslevel1a` varchar(255) DEFAULT NULL,
  `addresslevel2a` varchar(255) DEFAULT NULL,
  `addresslevel3a` varchar(255) DEFAULT NULL,
  `addresslevel4a` varchar(255) DEFAULT NULL,
  `addresslevel5a` varchar(255) DEFAULT NULL,
  `addresslevel6a` varchar(255) DEFAULT NULL,
  `addresslevel7a` varchar(255) DEFAULT NULL,
  `addresslevel8a` varchar(255) DEFAULT NULL,
  `buildingnumbera` varchar(100) DEFAULT NULL,
  `localnumbera` varchar(100) DEFAULT NULL,
  `poboxa` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`srecurringordersaddressid`),
  CONSTRAINT `u_yf_srecurringorders_address_ibfk_1` FOREIGN KEY (`srecurringordersaddressid`) REFERENCES `u_yf_srecurringorders` (`srecurringordersid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_srecurringorders_inventory` (
  `id` int(10) DEFAULT NULL,
  `seq` int(10) DEFAULT NULL,
  `name` int(10) NOT NULL DEFAULT '0',
  `qty` decimal(25,3) NOT NULL DEFAULT '0.000',
  `discount` decimal(28,8) DEFAULT '0.00000000',
  `discountparam` varchar(255) DEFAULT NULL,
  `marginp` decimal(28,8) DEFAULT '0.00000000',
  `margin` decimal(28,8) DEFAULT '0.00000000',
  `tax` decimal(28,8) NOT NULL DEFAULT '0.00000000',
  `taxparam` varchar(255) NOT NULL,
  `comment1` text,
  `qtyparam` tinyint(1) DEFAULT '0',
  `unit` varchar(255) DEFAULT NULL,
  `subunit` varchar(255) DEFAULT NULL,
  KEY `id` (`id`),
  CONSTRAINT `fk_1_u_yf_srecurringorders_inventory` FOREIGN KEY (`id`) REFERENCES `u_yf_srecurringorders` (`srecurringordersid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_srecurringorders_invfield` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `columnname` varchar(30) NOT NULL,
  `label` varchar(50) NOT NULL,
  `invtype` varchar(30) NOT NULL,
  `presence` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `defaultvalue` varchar(255) DEFAULT NULL,
  `sequence` int(10) unsigned NOT NULL,
  `block` tinyint(1) unsigned NOT NULL,
  `displaytype` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `params` text,
  `colspan` tinyint(1) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_srecurringorders_invmap` (
  `module` varchar(50) NOT NULL,
  `field` varchar(50) NOT NULL,
  `tofield` varchar(50) NOT NULL,
  PRIMARY KEY (`module`,`field`,`tofield`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_srecurringorderscf` (
  `srecurringordersid` int(10) NOT NULL,
  PRIMARY KEY (`srecurringordersid`),
  CONSTRAINT `fk_1_u_yf_srecurringorderscf` FOREIGN KEY (`srecurringordersid`) REFERENCES `u_yf_srecurringorders` (`srecurringordersid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_srequirementscards` (
  `srequirementscardsid` int(10) NOT NULL DEFAULT '0',
  `srequirementscards_no` varchar(255) DEFAULT '',
  `subject` varchar(255) DEFAULT NULL,
  `salesprocessid` int(10) DEFAULT NULL,
  `quoteenquiryid` int(10) DEFAULT NULL,
  `category` varchar(255) DEFAULT NULL,
  `srequirementscards_status` varchar(255) DEFAULT NULL,
  `accountid` int(10) DEFAULT NULL,
  `response_time` decimal(10,2) DEFAULT '0.00',
  `sum_time` decimal(10,2) DEFAULT '0.00',
  PRIMARY KEY (`srequirementscardsid`),
  KEY `salesprocessid` (`salesprocessid`),
  KEY `accountid` (`accountid`),
  KEY `quoteenquiryid` (`quoteenquiryid`),
  CONSTRAINT `fk_1_u_yf_srequirementscards` FOREIGN KEY (`srequirementscardsid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_srequirementscards_inventory` (
  `id` int(10) DEFAULT NULL,
  `seq` int(10) DEFAULT NULL,
  `name` int(10) NOT NULL DEFAULT '0',
  `qty` decimal(25,3) NOT NULL DEFAULT '0.000',
  `comment1` text,
  `qtyparam` tinyint(1) DEFAULT '0',
  `unit` varchar(255) DEFAULT NULL,
  `subunit` varchar(255) DEFAULT NULL,
  KEY `id` (`id`),
  CONSTRAINT `fk_1_u_yf_srequirementscards_inventory` FOREIGN KEY (`id`) REFERENCES `u_yf_srequirementscards` (`srequirementscardsid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_srequirementscards_invfield` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `columnname` varchar(30) NOT NULL,
  `label` varchar(50) NOT NULL,
  `invtype` varchar(30) NOT NULL,
  `presence` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `defaultvalue` varchar(255) DEFAULT NULL,
  `sequence` int(10) unsigned NOT NULL,
  `block` tinyint(1) unsigned NOT NULL,
  `displaytype` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `params` text,
  `colspan` tinyint(1) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_srequirementscards_invmap` (
  `module` varchar(50) NOT NULL,
  `field` varchar(50) NOT NULL,
  `tofield` varchar(50) NOT NULL,
  PRIMARY KEY (`module`,`field`,`tofield`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_srequirementscardscf` (
  `srequirementscardsid` int(10) NOT NULL,
  PRIMARY KEY (`srequirementscardsid`),
  CONSTRAINT `fk_1_u_yf_srequirementscardscf` FOREIGN KEY (`srequirementscardsid`) REFERENCES `u_yf_srequirementscards` (`srequirementscardsid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_ssalesprocesses` (
  `ssalesprocessesid` int(10) NOT NULL DEFAULT '0',
  `ssalesprocesses_no` varchar(255) DEFAULT '',
  `subject` varchar(255) DEFAULT NULL,
  `category` varchar(255) DEFAULT NULL,
  `related_to` int(10) DEFAULT NULL,
  `sum_time` decimal(10,2) DEFAULT '0.00',
  `estimated` decimal(25,8) DEFAULT NULL,
  `actual_sale` decimal(25,8) DEFAULT NULL,
  `estimated_date` date DEFAULT NULL,
  `actual_date` date DEFAULT NULL,
  `probability` decimal(5,2) DEFAULT NULL,
  `ssalesprocesses_source` varchar(255) DEFAULT NULL,
  `ssalesprocesses_type` varchar(255) DEFAULT NULL,
  `ssalesprocesses_status` varchar(255) DEFAULT NULL,
  `campaignid` int(10) DEFAULT NULL,
  `parentid` int(10) DEFAULT '0',
  `startdate` date DEFAULT NULL,
  PRIMARY KEY (`ssalesprocessesid`),
  KEY `related_to` (`related_to`),
  KEY `campaignid` (`campaignid`),
  KEY `parentid` (`parentid`),
  KEY `ssalesprocesses_no` (`ssalesprocesses_no`),
  CONSTRAINT `fk_1_u_yf_ssalesprocesses` FOREIGN KEY (`ssalesprocessesid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_ssalesprocessescf` (
  `ssalesprocessesid` int(10) NOT NULL,
  PRIMARY KEY (`ssalesprocessesid`),
  CONSTRAINT `fk_1_u_yf_ssalesprocessescf` FOREIGN KEY (`ssalesprocessesid`) REFERENCES `u_yf_ssalesprocesses` (`ssalesprocessesid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_ssingleorders` (
  `ssingleordersid` int(10) NOT NULL DEFAULT '0',
  `ssingleorders_no` varchar(255) DEFAULT '',
  `subject` varchar(255) DEFAULT NULL,
  `salesprocessid` int(10) DEFAULT NULL,
  `squotesid` int(10) DEFAULT NULL,
  `category` varchar(255) DEFAULT NULL,
  `ssingleorders_status` varchar(255) DEFAULT NULL,
  `accountid` int(10) DEFAULT NULL,
  `date_start` date DEFAULT NULL,
  `date_end` date DEFAULT NULL,
  `duedate` date DEFAULT NULL,
  `response_time` decimal(10,2) DEFAULT '0.00',
  `company` varchar(255) DEFAULT NULL,
  `sum_time` decimal(10,2) DEFAULT '0.00',
  `sum_total` decimal(28,8) DEFAULT NULL,
  `sum_marginp` decimal(10,2) DEFAULT NULL,
  `sum_margin` decimal(28,8) DEFAULT NULL,
  `sum_gross` decimal(28,8) DEFAULT NULL,
  `sum_discount` decimal(28,8) DEFAULT NULL,
  `ssingleorders_source` varchar(255) DEFAULT '',
  PRIMARY KEY (`ssingleordersid`),
  KEY `salesprocessid` (`salesprocessid`),
  KEY `squotesid` (`squotesid`),
  KEY `accountid` (`accountid`),
  CONSTRAINT `fk_1_u_yf_ssingleorders` FOREIGN KEY (`ssingleordersid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_ssingleorders_address` (
  `ssingleordersaddressid` int(10) NOT NULL,
  `addresslevel1a` varchar(255) DEFAULT NULL,
  `addresslevel2a` varchar(255) DEFAULT NULL,
  `addresslevel3a` varchar(255) DEFAULT NULL,
  `addresslevel4a` varchar(255) DEFAULT NULL,
  `addresslevel5a` varchar(255) DEFAULT NULL,
  `addresslevel6a` varchar(255) DEFAULT NULL,
  `addresslevel7a` varchar(255) DEFAULT NULL,
  `addresslevel8a` varchar(255) DEFAULT NULL,
  `buildingnumbera` varchar(100) DEFAULT NULL,
  `localnumbera` varchar(100) DEFAULT NULL,
  `poboxa` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`ssingleordersaddressid`),
  CONSTRAINT `u_yf_ssingleorders_address_ibfk_1` FOREIGN KEY (`ssingleordersaddressid`) REFERENCES `u_yf_ssingleorders` (`ssingleordersid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_ssingleorders_inventory` (
  `id` int(10) DEFAULT NULL,
  `seq` int(10) DEFAULT NULL,
  `name` int(10) NOT NULL DEFAULT '0',
  `qty` decimal(25,3) NOT NULL DEFAULT '0.000',
  `discount` decimal(28,8) DEFAULT '0.00000000',
  `discountparam` varchar(255) DEFAULT NULL,
  `marginp` decimal(28,8) DEFAULT '0.00000000',
  `margin` decimal(28,8) DEFAULT '0.00000000',
  `tax` decimal(28,8) NOT NULL DEFAULT '0.00000000',
  `taxparam` varchar(255) NOT NULL,
  `comment1` text,
  `price` decimal(28,8) NOT NULL DEFAULT '0.00000000',
  `total` decimal(28,8) NOT NULL DEFAULT '0.00000000',
  `net` decimal(28,8) NOT NULL DEFAULT '0.00000000',
  `purchase` decimal(28,8) NOT NULL DEFAULT '0.00000000',
  `gross` decimal(28,8) NOT NULL DEFAULT '0.00000000',
  `discountmode` tinyint(1) NOT NULL DEFAULT '0',
  `taxmode` tinyint(1) NOT NULL DEFAULT '0',
  `currency` int(10) DEFAULT NULL,
  `currencyparam` varchar(1024) DEFAULT NULL,
  `qtyparam` tinyint(1) DEFAULT '0',
  `unit` varchar(255) DEFAULT NULL,
  `subunit` varchar(255) DEFAULT NULL,
  KEY `id` (`id`),
  CONSTRAINT `fk_1_u_yf_ssingleorders_inventory` FOREIGN KEY (`id`) REFERENCES `u_yf_ssingleorders` (`ssingleordersid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_ssingleorders_invfield` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `columnname` varchar(30) NOT NULL,
  `label` varchar(50) NOT NULL,
  `invtype` varchar(30) NOT NULL,
  `presence` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `defaultvalue` varchar(255) DEFAULT NULL,
  `sequence` int(10) unsigned NOT NULL,
  `block` tinyint(1) unsigned NOT NULL,
  `displaytype` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `params` text,
  `colspan` tinyint(1) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_ssingleorders_invmap` (
  `module` varchar(50) NOT NULL,
  `field` varchar(50) NOT NULL,
  `tofield` varchar(50) NOT NULL,
  PRIMARY KEY (`module`,`field`,`tofield`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_ssingleorderscf` (
  `ssingleordersid` int(10) NOT NULL,
  PRIMARY KEY (`ssingleordersid`),
  CONSTRAINT `fk_1_u_yf_ssingleorderscf` FOREIGN KEY (`ssingleordersid`) REFERENCES `u_yf_ssingleorders` (`ssingleordersid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_svendorenquiries` (
  `svendorenquiriesid` int(10) NOT NULL DEFAULT '0',
  `svendorenquiries_no` varchar(50) DEFAULT '',
  `subject` varchar(255) DEFAULT NULL,
  `salesprocessid` int(10) DEFAULT NULL,
  `category` varchar(30) DEFAULT NULL,
  `svendorenquiries_status` varchar(255) DEFAULT NULL,
  `accountid` int(10) DEFAULT NULL,
  `response_time` decimal(10,2) DEFAULT '0.00',
  `sum_time` decimal(10,2) DEFAULT '0.00',
  `sum_total` decimal(28,8) DEFAULT NULL,
  `sum_marginp` decimal(10,2) DEFAULT NULL,
  `sum_margin` decimal(28,8) DEFAULT NULL,
  `vendorid` int(10) DEFAULT NULL,
  `scalculationsid` int(10) DEFAULT NULL,
  PRIMARY KEY (`svendorenquiriesid`),
  KEY `svendorenquiries_salesprocessid_idx` (`salesprocessid`),
  KEY `svendorenquiries_accountid_idx` (`accountid`),
  KEY `svendorenquiries_vendorid_idx` (`vendorid`),
  KEY `svendorenquiries_scalculationsid_idx` (`scalculationsid`),
  CONSTRAINT `fk_1_u_yf_svendorenquiries` FOREIGN KEY (`svendorenquiriesid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_svendorenquiries_inventory` (
  `id` int(10) DEFAULT NULL,
  `seq` int(10) DEFAULT NULL,
  `name` int(10) DEFAULT '0',
  `qty` decimal(25,3) DEFAULT '0.000',
  `qtyparam` smallint(1) DEFAULT '0',
  `comment1` text,
  `price` decimal(28,8) DEFAULT '0.00000000',
  `total` decimal(28,8) DEFAULT '0.00000000',
  `purchase` decimal(28,8) DEFAULT '0.00000000',
  `marginp` decimal(28,8) DEFAULT '0.00000000',
  `margin` decimal(28,8) DEFAULT '0.00000000',
  `unit` varchar(255) DEFAULT NULL,
  `subunit` varchar(255) DEFAULT NULL,
  KEY `svendorenquiries_inventory_idx` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_svendorenquiries_invfield` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `columnname` varchar(30) NOT NULL,
  `label` varchar(50) NOT NULL,
  `invtype` varchar(30) NOT NULL,
  `presence` smallint(1) unsigned NOT NULL DEFAULT '0',
  `defaultvalue` varchar(255) DEFAULT NULL,
  `sequence` int(10) unsigned NOT NULL,
  `block` smallint(1) unsigned NOT NULL,
  `displaytype` smallint(1) unsigned NOT NULL DEFAULT '1',
  `params` text,
  `colspan` smallint(1) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_svendorenquiries_invmap` (
  `module` varchar(50) NOT NULL,
  `field` varchar(50) NOT NULL,
  `tofield` varchar(50) NOT NULL,
  PRIMARY KEY (`module`,`field`,`tofield`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_svendorenquiriescf` (
  `svendorenquiriesid` int(10) NOT NULL,
  PRIMARY KEY (`svendorenquiriesid`),
  CONSTRAINT `fk_1_u_yf_svendorenquiriescf` FOREIGN KEY (`svendorenquiriesid`) REFERENCES `u_yf_svendorenquiries` (`svendorenquiriesid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_timeline` (
  `crmid` int(10) NOT NULL,
  `type` varchar(50) DEFAULT NULL,
  `userid` int(10) NOT NULL,
  KEY `timeline_crmid_idx` (`crmid`),
  CONSTRAINT `fk_1_u_yf_timeline` FOREIGN KEY (`crmid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_watchdog_module` (
  `member` varchar(50) NOT NULL,
  `module` int(10) unsigned NOT NULL,
  `lock` tinyint(1) DEFAULT '0',
  `exceptions` text,
  PRIMARY KEY (`member`,`module`),
  KEY `userid` (`member`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_watchdog_record` (
  `userid` int(10) unsigned NOT NULL,
  `record` int(10) NOT NULL,
  `state` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`userid`,`record`),
  KEY `userid` (`userid`),
  KEY `record` (`record`),
  KEY `userid_2` (`userid`,`record`,`state`),
  CONSTRAINT `u_yf_watchdog_record_ibfk_1` FOREIGN KEY (`record`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `u_yf_watchdog_schedule` (
  `userid` int(10) NOT NULL,
  `frequency` smallint(5) NOT NULL,
  `last_execution` datetime DEFAULT NULL,
  `modules` text,
  PRIMARY KEY (`userid`),
  CONSTRAINT `u_yf_watchdog_schedule_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `update_sini` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sini` varchar(20) NOT NULL,
  `rut` varchar(15) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=479 DEFAULT CHARSET=utf8;
/*!50001 CREATE VIEW `visitas_programas` AS SELECT 
 1 AS `activityid`,
 1 AS `subject`,
 1 AS `activitytype`,
 1 AS `date_start`,
 1 AS `due_date`,
 1 AS `status`,
 1 AS `siniestro`,
 1 AS `comunacaso`,
 1 AS `direccionsiniestro`,
 1 AS `latitud_sini`,
 1 AS `longitud_sini`,
 1 AS `nombrecliente`,
 1 AS `nrocaso`,
 1 AS `cliente`,
 1 AS `nombre`,
 1 AS `apellido`,
 1 AS `smcreatorid`,
 1 AS `smownerid`,
 1 AS `modifiedby`,
 1 AS `createdtime`,
 1 AS `modifiedtime`,
 1 AS `Creado_por`,
 1 AS `Asignado_a`,
 1 AS `Ultima_mod_por`,
 1 AS `time_start`,
 1 AS `time_end`,
 1 AS `Estado_caso`,
 1 AS `movil`,
 1 AS `email`,
 1 AS `captador`*/;
/*!50001 CREATE VIEW `vista_casos_clientes` AS SELECT 
 1 AS `siniestroid`,
 1 AS `siniestro`,
 1 AS `Nombre_Cliente`,
 1 AS `estado_`,
 1 AS `cliente`,
 1 AS `comunacaso`,
 1 AS `fecha_creacion`,
 1 AS `Celular`,
 1 AS `Email`,
 1 AS `Entidad_Liquidadora`,
 1 AS `Tipo_Siniestro`*/;
/*!50001 CREATE VIEW `vista_casos_clientes_detalle` AS SELECT 
 1 AS `siniestroid`,
 1 AS `siniestro`,
 1 AS `Nombre_Cliente`,
 1 AS `estado_`,
 1 AS `cliente`,
 1 AS `comunacaso`,
 1 AS `Celular`,
 1 AS `Email`,
 1 AS `Entidad_Liquidadora`,
 1 AS `Tipo_Siniestro`,
 1 AS `Rango_Horario_PREINSPECCION`,
 1 AS `Dias_Disponibles_Preinspeccion`,
 1 AS `Bloquefecha1`,
 1 AS `Bloquefecha2`,
 1 AS `Lunes`,
 1 AS `Martes`,
 1 AS `Miercoles`,
 1 AS `Jueves`,
 1 AS `Viernes`,
 1 AS `Coordenada_completa`,
 1 AS `ejecutivo`,
 1 AS `region_caso`,
 1 AS `comuna_caso`,
 1 AS `tipo_propiedad`*/;
/*!50001 CREATE VIEW `vista_gestionvendedor` AS SELECT 
 1 AS `campanasmktdigitalid`,
 1 AS `id`,
 1 AS `number`,
 1 AS `tienescrehip`,
 1 AS `comuna`,
 1 AS `nombrecompleto`,
 1 AS `telefono`,
 1 AS `correo`,
 1 AS `campana`,
 1 AS `conjuntodeanuncios`,
 1 AS `anuncio`,
 1 AS `mediodigital`,
 1 AS `motivorechazo`,
 1 AS `fechaultimallamada`,
 1 AS `fechaproximallamada`,
 1 AS `estadolead`,
 1 AS `estadollamada`,
 1 AS `codigocampana`,
 1 AS `mescampana`,
 1 AS `anocampana`,
 1 AS `last_update`,
 1 AS `idfacebook`,
 1 AS `gestionadopor`,
 1 AS `obsrechazo`,
 1 AS `obslead`,
 1 AS `fecha_asignado`,
 1 AS `fecha_leads`,
 1 AS `leadan`,
 1 AS `Gestion_leads`,
 1 AS `user_name`*/;
/*!50001 CREATE VIEW `vista_sus_all_graf` AS SELECT 
 1 AS `Clinete`,
 1 AS `Rut`,
 1 AS `telefono`,
 1 AS `email`,
 1 AS `Captador`,
 1 AS `Suscripcion_sini_VGTE`,
 1 AS `Clinete_id`,
 1 AS `Fecha_Factura`,
 1 AS `status_sus`,
 1 AS `Captador_asignado`*/;
/*!50001 CREATE VIEW `vistacaulculodeudas` AS SELECT 
 1 AS `id_cliente`,
 1 AS `Fecha_factura`,
 1 AS `Valor_plan`,
 1 AS `Abono`,
 1 AS `Nro_factura`,
 1 AS `Primera_cuota`,
 1 AS `Segunda_cuota`,
 1 AS `Nro_cuotas`,
 1 AS `Abono_pagado`,
 1 AS `Pra_cuota_pagada`,
 1 AS `Sda_cuota_pagada`,
 1 AS `siniestro`,
 1 AS `cliente`,
 1 AS `estado_`,
 1 AS `nombre`,
 1 AS `apellido`*/;
CREATE TABLE `vtiger_DemandaPagoRetenido` (
  `DemandaPagoRetenidoid` int(11) NOT NULL DEFAULT '0',
  `id` int(11) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `inf_dda_presentada` tinyint(1) DEFAULT '0',
  `fecha_inf_dda_presentada` date DEFAULT NULL,
  `cert_pjudenv` tinyint(1) DEFAULT '0',
  `fech_envcertpjud` date DEFAULT NULL,
  `rol` varchar(15) DEFAULT '',
  `caratula` varchar(150) DEFAULT '',
  `dda_presentada` tinyint(1) DEFAULT '0',
  `fech_dda_presentada` varchar(50) DEFAULT NULL,
  `rut` varchar(15) DEFAULT '',
  `tribunalcompetente` varchar(255) DEFAULT '',
  `tribunalradicado` varchar(255) DEFAULT '',
  `estadodda` varchar(255) DEFAULT '',
  `bienesembargados` varchar(255) DEFAULT '',
  `cortecompetente` varchar(255) DEFAULT '',
  `rolrecursoqueja` varchar(30) DEFAULT '',
  `clasedeapelacion` varchar(255) DEFAULT '',
  `rolapelacion` varchar(30) DEFAULT '',
  `clasecasacion` varchar(255) DEFAULT '',
  `rolrecursocasacion` varchar(20) DEFAULT '',
  `rolrecursohecho` varchar(30) DEFAULT '',
  `generardda` tinyint(1) DEFAULT '0',
  `generarcumpleord` tinyint(1) DEFAULT '0',
  `genart44` tinyint(1) DEFAULT '0',
  `generarformato` tinyint(1) DEFAULT '0',
  `generarautoprueba` tinyint(1) DEFAULT '0',
  `generaroirsentencia` tinyint(1) DEFAULT '0',
  `generarreposicion` tinyint(1) DEFAULT '0',
  `generarrepoyapela` tinyint(1) DEFAULT '0',
  `generarapela` tinyint(1) DEFAULT '0',
  `formatoica` tinyint(1) DEFAULT '0',
  `nombrereceptor` varchar(255) DEFAULT '',
  `busquedanegativa` bigint(30) DEFAULT '0',
  `estadobusqueda` varchar(255) DEFAULT '',
  `not44` bigint(30) DEFAULT '0',
  `estadonot44` varchar(255) DEFAULT '',
  `notporcedula` bigint(30) DEFAULT '0',
  `estadonotcedula` varchar(255) DEFAULT '',
  `notpersonal` bigint(30) DEFAULT '0',
  `estadonotpersonal` varchar(255) DEFAULT '',
  `embargo` bigint(30) DEFAULT '0',
  `estadoembargo` varchar(255) DEFAULT '',
  `preciobusqueda` bigint(30) DEFAULT '0',
  `precionotcedula` bigint(30) DEFAULT '0',
  `precionot44` bigint(30) DEFAULT '0',
  `precioembargo` bigint(30) DEFAULT '0',
  `precionotpersonal` bigint(30) DEFAULT '0',
  `totalapagar` bigint(30) DEFAULT '0',
  `pagar` tinyint(1) DEFAULT '0',
  `pagohistorico` bigint(30) DEFAULT '0',
  `comunacliente` varchar(255) DEFAULT '',
  `comuna` varchar(255) DEFAULT '',
  `correo` varchar(100) DEFAULT '',
  `movil` varchar(50) DEFAULT '',
  `rutcomp` varchar(255) DEFAULT '',
  `siniestro` int(11) unsigned DEFAULT '0',
  `demandadoid` int(11) unsigned DEFAULT '0',
  `relacionventaddas` int(11) unsigned DEFAULT '0',
  `relgestcom` int(11) unsigned DEFAULT '0',
  `tiposervicio` varchar(255) DEFAULT '',
  PRIMARY KEY (`DemandaPagoRetenidoid`),
  KEY `vtiger_DemandaPagoRetenido_siniestro_idx` (`siniestro`),
  KEY `vtiger_DemandaPagoRetenido_demandadoid_idx` (`demandadoid`),
  KEY `vtiger_DemandaPagoRetenido_relacionventaddas_idx` (`relacionventaddas`),
  KEY `vtiger_DemandaPagoRetenido_relgestcom_idx` (`relgestcom`),
  CONSTRAINT `fk_1_vtiger_DemandaPagoRetenidoDemandaPagoRetenidoid` FOREIGN KEY (`DemandaPagoRetenidoid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_DemandaPagoRetenidocf` (
  `DemandaPagoRetenidoid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`DemandaPagoRetenidoid`),
  CONSTRAINT `fk_1_vtiger_DemandaPagoRetenidocfDemandaPagoRetenidoid` FOREIGN KEY (`DemandaPagoRetenidoid`) REFERENCES `vtiger_DemandaPagoRetenido` (`DemandaPagoRetenidoid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_abogadoasignado` (
  `abogadoasignadoid` int(11) NOT NULL AUTO_INCREMENT,
  `abogadoasignado` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`abogadoasignadoid`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_account` (
  `accountid` int(10) NOT NULL DEFAULT '0',
  `account_no` varchar(100) NOT NULL,
  `accountname` varchar(100) NOT NULL,
  `parentid` int(10) DEFAULT '0',
  `account_type` varchar(200) DEFAULT NULL,
  `industry` varchar(200) DEFAULT NULL,
  `annualrevenue` decimal(25,8) DEFAULT NULL,
  `ownership` varchar(50) DEFAULT NULL,
  `siccode` varchar(50) DEFAULT NULL,
  `phone` varchar(30) DEFAULT NULL,
  `otherphone` varchar(30) DEFAULT NULL,
  `email1` varchar(100) DEFAULT NULL,
  `email2` varchar(100) DEFAULT NULL,
  `website` varchar(100) DEFAULT NULL,
  `fax` varchar(30) DEFAULT NULL,
  `employees` int(10) DEFAULT '0',
  `emailoptout` smallint(1) DEFAULT '0',
  `isconvertedfromlead` smallint(3) DEFAULT '0',
  `vat_id` varchar(30) DEFAULT NULL,
  `registration_number_1` varchar(30) DEFAULT NULL,
  `registration_number_2` varchar(30) DEFAULT NULL,
  `verification` text,
  `no_approval` smallint(1) DEFAULT '0',
  `balance` decimal(25,8) DEFAULT NULL,
  `payment_balance` decimal(25,8) DEFAULT NULL,
  `legal_form` varchar(255) DEFAULT NULL,
  `sum_time` decimal(10,2) DEFAULT NULL,
  `inventorybalance` decimal(25,8) DEFAULT '0.00000000',
  `discount` decimal(5,2) DEFAULT '0.00',
  `creditlimit` int(10) DEFAULT NULL,
  `products` text,
  `services` text,
  `last_invoice_date` date DEFAULT NULL,
  `active` tinyint(1) DEFAULT '0',
  `accounts_status` varchar(255) DEFAULT NULL,
  `phone_extra` varchar(100) DEFAULT NULL,
  `fax_extra` varchar(100) DEFAULT NULL,
  `otherphone_extra` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`accountid`),
  KEY `account_account_type_idx` (`account_type`),
  KEY `email_idx` (`email1`,`email2`),
  KEY `accountname` (`accountname`),
  KEY `parentid` (`parentid`),
  CONSTRAINT `fk_1_vtiger_account` FOREIGN KEY (`accountid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_accountaddress` (
  `accountaddressid` int(10) NOT NULL,
  `addresslevel1a` varchar(255) DEFAULT NULL,
  `addresslevel1b` varchar(255) DEFAULT NULL,
  `addresslevel1c` varchar(255) DEFAULT NULL,
  `addresslevel2a` varchar(255) DEFAULT NULL,
  `addresslevel2b` varchar(255) DEFAULT NULL,
  `addresslevel2c` varchar(255) DEFAULT NULL,
  `addresslevel3a` varchar(255) DEFAULT NULL,
  `addresslevel3b` varchar(255) DEFAULT NULL,
  `addresslevel3c` varchar(255) DEFAULT NULL,
  `addresslevel4a` varchar(255) DEFAULT NULL,
  `addresslevel4b` varchar(255) DEFAULT NULL,
  `addresslevel4c` varchar(255) DEFAULT NULL,
  `addresslevel5a` varchar(255) DEFAULT NULL,
  `addresslevel5b` varchar(255) DEFAULT NULL,
  `addresslevel5c` varchar(255) DEFAULT NULL,
  `addresslevel6a` varchar(255) DEFAULT NULL,
  `addresslevel6b` varchar(255) DEFAULT NULL,
  `addresslevel6c` varchar(255) DEFAULT NULL,
  `addresslevel7a` varchar(255) DEFAULT NULL,
  `addresslevel7b` varchar(255) DEFAULT NULL,
  `addresslevel7c` varchar(255) DEFAULT NULL,
  `addresslevel8a` varchar(255) DEFAULT NULL,
  `addresslevel8b` varchar(255) DEFAULT NULL,
  `addresslevel8c` varchar(255) DEFAULT NULL,
  `buildingnumbera` varchar(100) DEFAULT NULL,
  `localnumbera` varchar(100) DEFAULT NULL,
  `buildingnumberb` varchar(100) DEFAULT NULL,
  `localnumberb` varchar(100) DEFAULT NULL,
  `buildingnumberc` varchar(100) DEFAULT NULL,
  `localnumberc` varchar(100) DEFAULT NULL,
  `poboxa` varchar(50) DEFAULT NULL,
  `poboxb` varchar(50) DEFAULT NULL,
  `poboxc` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`accountaddressid`),
  CONSTRAINT `vtiger_accountaddress_ibfk_1` FOREIGN KEY (`accountaddressid`) REFERENCES `vtiger_account` (`accountid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_accounts_status` (
  `accounts_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `accounts_status` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT '0',
  PRIMARY KEY (`accounts_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_accountscf` (
  `accountid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`accountid`),
  CONSTRAINT `fk_1_vtiger_accountscf` FOREIGN KEY (`accountid`) REFERENCES `vtiger_account` (`accountid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_accounttype` (
  `accounttypeid` int(10) NOT NULL AUTO_INCREMENT,
  `accounttype` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT NULL,
  PRIMARY KEY (`accounttypeid`),
  UNIQUE KEY `accounttype_accounttype_idx` (`accounttype`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_accounttype_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_acreditacionpie` (
  `acreditacionpieid` int(11) NOT NULL AUTO_INCREMENT,
  `acreditacionpie` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`acreditacionpieid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_actionmapping` (
  `actionid` int(10) NOT NULL,
  `actionname` varchar(200) NOT NULL,
  `securitycheck` int(10) DEFAULT NULL,
  PRIMARY KEY (`actionid`,`actionname`),
  KEY `actionname` (`actionname`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_actividadasegurado` (
  `actividadaseguradoid` int(11) NOT NULL AUTO_INCREMENT,
  `actividadasegurado` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`actividadaseguradoid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_actividadcia` (
  `actividadciaid` int(11) NOT NULL AUTO_INCREMENT,
  `actividadcia` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`actividadciaid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_actividadcmf` (
  `actividadcmfid` int(11) NOT NULL AUTO_INCREMENT,
  `actividadcmf` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`actividadcmfid`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_actividadcorredor` (
  `actividadcorredorid` int(11) NOT NULL AUTO_INCREMENT,
  `actividadcorredor` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`actividadcorredorid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_actividadliquidador` (
  `actividadliquidadorid` int(11) NOT NULL AUTO_INCREMENT,
  `actividadliquidador` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`actividadliquidadorid`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_activity` (
  `activityid` int(10) NOT NULL DEFAULT '0',
  `subject` varchar(100) NOT NULL,
  `activitytype` varchar(200) NOT NULL,
  `date_start` date NOT NULL,
  `due_date` date DEFAULT NULL,
  `time_start` time DEFAULT NULL,
  `time_end` time DEFAULT NULL,
  `sendnotification` smallint(1) NOT NULL DEFAULT '0',
  `duration_hours` smallint(5) DEFAULT NULL,
  `duration_minutes` smallint(3) DEFAULT NULL,
  `status` varchar(200) DEFAULT NULL,
  `priority` varchar(200) DEFAULT NULL,
  `location` varchar(150) DEFAULT NULL,
  `notime` smallint(1) NOT NULL DEFAULT '0',
  `visibility` varchar(50) NOT NULL DEFAULT 'all',
  `deleted` tinyint(1) DEFAULT '0',
  `smownerid` smallint(5) unsigned DEFAULT NULL,
  `allday` tinyint(1) DEFAULT NULL,
  `dav_status` tinyint(1) DEFAULT '1',
  `state` varchar(255) DEFAULT NULL,
  `link` int(10) DEFAULT NULL,
  `process` int(10) DEFAULT NULL,
  `subprocess` int(10) DEFAULT NULL,
  `followup` int(10) DEFAULT NULL,
  `reapeat` smallint(1) DEFAULT NULL,
  `recurrence` text,
  `linkextend` int(10) DEFAULT NULL,
  `nrocaso` int(11) unsigned DEFAULT '0',
  `nrocaso2` int(11) unsigned DEFAULT '0',
  `detactividad` varchar(255) DEFAULT '',
  PRIMARY KEY (`activityid`),
  KEY `activity_activityid_subject_idx` (`activityid`,`subject`),
  KEY `activity_activitytype_date_start_idx` (`activitytype`,`date_start`),
  KEY `activity_date_start_due_date_idx` (`date_start`,`due_date`),
  KEY `activity_date_start_time_start_idx` (`date_start`,`time_start`),
  KEY `activity_status_idx` (`status`),
  KEY `activitytype_2` (`activitytype`,`date_start`,`due_date`,`time_start`,`time_end`,`deleted`,`smownerid`),
  KEY `link` (`link`),
  KEY `process` (`process`),
  KEY `followup` (`followup`),
  KEY `subprocess` (`subprocess`),
  KEY `activitytype_3` (`activitytype`,`status`),
  KEY `smownerid` (`smownerid`),
  KEY `linkextend` (`linkextend`),
  KEY `vtiger_activity_nrocaso_idx` (`nrocaso`),
  KEY `vtiger_activity_nrocaso2_idx` (`nrocaso2`),
  CONSTRAINT `fk_1_vtiger_activity` FOREIGN KEY (`activityid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_activity_inventory` (
  `id` int(11) DEFAULT NULL,
  `seq` int(10) DEFAULT NULL,
  KEY `calendar_inventory_idx` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_activity_invfield` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `columnname` varchar(30) NOT NULL,
  `label` varchar(50) NOT NULL,
  `invtype` varchar(30) NOT NULL,
  `presence` smallint(1) unsigned NOT NULL DEFAULT '0',
  `defaultvalue` varchar(255) DEFAULT NULL,
  `sequence` int(10) unsigned NOT NULL,
  `block` smallint(1) unsigned NOT NULL,
  `displaytype` smallint(1) unsigned NOT NULL DEFAULT '1',
  `params` text,
  `colspan` smallint(1) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_activity_invmap` (
  `module` varchar(50) NOT NULL,
  `field` varchar(50) NOT NULL,
  `tofield` varchar(50) NOT NULL,
  PRIMARY KEY (`module`,`field`,`tofield`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_activity_reminder` (
  `activity_id` int(10) NOT NULL,
  `reminder_time` int(10) NOT NULL,
  `reminder_sent` int(2) NOT NULL,
  PRIMARY KEY (`activity_id`),
  CONSTRAINT `vtiger_activity_reminder_ibfk_1` FOREIGN KEY (`activity_id`) REFERENCES `vtiger_activity` (`activityid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_activity_reminder_popup` (
  `reminderid` int(10) NOT NULL AUTO_INCREMENT,
  `recordid` int(10) NOT NULL,
  `datetime` datetime NOT NULL,
  `status` int(2) NOT NULL,
  PRIMARY KEY (`reminderid`),
  KEY `recordid` (`recordid`),
  CONSTRAINT `vtiger_activity_reminder_popup_ibfk_1` FOREIGN KEY (`recordid`) REFERENCES `vtiger_activity` (`activityid`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=20460 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_activity_update_dates` (
  `activityid` int(10) NOT NULL,
  `parent` int(10) NOT NULL,
  `task_id` int(10) NOT NULL,
  PRIMARY KEY (`activityid`),
  KEY `parent` (`parent`),
  KEY `vtiger_activity_update_dates_ibfk_1` (`task_id`),
  CONSTRAINT `vtiger_activity_update_dates_ibfk_1` FOREIGN KEY (`task_id`) REFERENCES `com_vtiger_workflowtasks` (`task_id`) ON DELETE CASCADE,
  CONSTRAINT `vtiger_activity_update_dates_ibfk_2` FOREIGN KEY (`parent`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE,
  CONSTRAINT `vtiger_activity_update_dates_ibfk_3` FOREIGN KEY (`activityid`) REFERENCES `vtiger_activity` (`activityid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_activity_view` (
  `activity_viewid` int(10) NOT NULL AUTO_INCREMENT,
  `activity_view` varchar(200) NOT NULL,
  `sortorderid` int(10) NOT NULL DEFAULT '0',
  `presence` int(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`activity_viewid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_activity_view_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_activitycf` (
  `activityid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`activityid`),
  CONSTRAINT `vtiger_activitycf_ibfk_1` FOREIGN KEY (`activityid`) REFERENCES `vtiger_activity` (`activityid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_activityproductrel` (
  `activityid` int(10) NOT NULL DEFAULT '0',
  `productid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`activityid`,`productid`),
  KEY `activityproductrel_activityid_idx` (`activityid`),
  KEY `activityproductrel_productid_idx` (`productid`),
  CONSTRAINT `fk_2_vtiger_activityproductrel` FOREIGN KEY (`productid`) REFERENCES `vtiger_products` (`productid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_activitystatus` (
  `activitystatusid` int(10) NOT NULL AUTO_INCREMENT,
  `activitystatus` varchar(200) DEFAULT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT NULL,
  PRIMARY KEY (`activitystatusid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_activitystatus_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_activitytype` (
  `activitytypeid` int(10) NOT NULL AUTO_INCREMENT,
  `activitytype` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT NULL,
  `color` varchar(25) DEFAULT NULL,
  PRIMARY KEY (`activitytypeid`),
  UNIQUE KEY `activitytype_activitytype_idx` (`activitytype`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_activitytype_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_afp` (
  `afpid` int(11) NOT NULL AUTO_INCREMENT,
  `afp` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`afpid`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_anio` (
  `anioid` int(11) NOT NULL AUTO_INCREMENT,
  `anio` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`anioid`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_announcementstatus` (
  `announcementstatusid` int(10) NOT NULL AUTO_INCREMENT,
  `announcementstatus` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT '0',
  PRIMARY KEY (`announcementstatusid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_anovehiculo` (
  `anovehiculoid` int(11) NOT NULL AUTO_INCREMENT,
  `anovehiculo` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`anovehiculoid`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_antigpropiedad` (
  `antigpropiedadid` int(11) NOT NULL AUTO_INCREMENT,
  `antigpropiedad` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`antigpropiedadid`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_antiguedad` (
  `antiguedadid` int(11) NOT NULL AUTO_INCREMENT,
  `antiguedad` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`antiguedadid`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_apiaddress` (
  `id` int(10) NOT NULL,
  `name` varchar(255) NOT NULL,
  `val` varchar(255) NOT NULL,
  `type` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_appsuspac` (
  `appsuspacid` int(11) NOT NULL AUTO_INCREMENT,
  `appsuspac` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` int(10) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`appsuspacid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_asociadoesterno` (
  `asociadoesternoid` int(11) NOT NULL AUTO_INCREMENT,
  `asociadoesterno` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` int(10) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`asociadoesternoid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_assets` (
  `assetsid` int(10) NOT NULL,
  `asset_no` varchar(30) NOT NULL,
  `product` int(10) NOT NULL,
  `serialnumber` varchar(200) DEFAULT NULL,
  `datesold` date DEFAULT NULL,
  `dateinservice` date DEFAULT NULL,
  `assetstatus` varchar(200) DEFAULT 'PLL_DRAFT',
  `assetname` varchar(100) DEFAULT NULL,
  `sum_time` decimal(10,2) DEFAULT '0.00',
  `parent_id` int(10) DEFAULT NULL,
  `ordertime` decimal(10,2) DEFAULT NULL,
  `pscategory` varchar(255) DEFAULT '',
  `ssalesprocessesid` int(10) DEFAULT NULL,
  `assets_renew` varchar(255) DEFAULT NULL,
  `renewalinvoice` int(10) DEFAULT NULL,
  `contactid` int(19) DEFAULT NULL,
  PRIMARY KEY (`assetsid`),
  KEY `parent_id` (`parent_id`),
  KEY `product` (`product`),
  KEY `ssalesprocessesid` (`ssalesprocessesid`),
  KEY `renewalinvoice` (`renewalinvoice`),
  KEY `contactid_idx` (`contactid`),
  CONSTRAINT `fk_1_vtiger_assets` FOREIGN KEY (`assetsid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_assets_renew` (
  `assets_renewid` int(10) NOT NULL AUTO_INCREMENT,
  `assets_renew` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT '0',
  PRIMARY KEY (`assets_renewid`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_assetscf` (
  `assetsid` int(10) NOT NULL,
  PRIMARY KEY (`assetsid`),
  CONSTRAINT `vtiger_assetscf_ibfk_1` FOREIGN KEY (`assetsid`) REFERENCES `vtiger_assets` (`assetsid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_assetstatus` (
  `assetstatusid` int(10) NOT NULL AUTO_INCREMENT,
  `assetstatus` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT '0',
  PRIMARY KEY (`assetstatusid`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_assetstatus_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_asterisk` (
  `server` varchar(30) DEFAULT NULL,
  `port` varchar(30) DEFAULT NULL,
  `username` varchar(50) DEFAULT NULL,
  `password` varchar(50) DEFAULT NULL,
  `version` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_asteriskextensions` (
  `userid` smallint(5) unsigned NOT NULL,
  `asterisk_extension` varchar(50) DEFAULT NULL,
  `use_asterisk` varchar(3) DEFAULT NULL,
  PRIMARY KEY (`userid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_asteriskincomingcalls` (
  `from_number` varchar(50) DEFAULT NULL,
  `from_name` varchar(50) DEFAULT NULL,
  `to_number` varchar(50) DEFAULT NULL,
  `callertype` varchar(30) DEFAULT NULL,
  `flag` int(10) DEFAULT NULL,
  `timer` int(10) DEFAULT NULL,
  `refuid` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_asteriskincomingevents` (
  `uid` varchar(255) NOT NULL,
  `channel` varchar(100) DEFAULT NULL,
  `from_number` bigint(10) DEFAULT NULL,
  `from_name` varchar(100) DEFAULT NULL,
  `to_number` bigint(10) DEFAULT NULL,
  `callertype` varchar(100) DEFAULT NULL,
  `timer` int(10) DEFAULT NULL,
  `flag` varchar(3) DEFAULT NULL,
  `pbxrecordid` int(10) DEFAULT NULL,
  `relcrmid` int(10) DEFAULT NULL,
  PRIMARY KEY (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_attachments` (
  `attachmentsid` int(10) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text,
  `type` varchar(100) DEFAULT NULL,
  `path` text,
  `subject` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`attachmentsid`),
  CONSTRAINT `fk_1_vtiger_attachments` FOREIGN KEY (`attachmentsid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_audcon` (
  `audconid` int(11) NOT NULL AUTO_INCREMENT,
  `audcon` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`audconid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_audit_trial` (
  `auditid` int(10) NOT NULL,
  `userid` int(10) DEFAULT NULL,
  `module` varchar(255) DEFAULT NULL,
  `action` varchar(255) DEFAULT NULL,
  `recordid` varchar(20) DEFAULT NULL,
  `actiondate` datetime DEFAULT NULL,
  PRIMARY KEY (`auditid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_automovil1` (
  `automovil1id` int(11) NOT NULL AUTO_INCREMENT,
  `automovil1` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`automovil1id`)
) ENGINE=InnoDB AUTO_INCREMENT=57 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_automovil2` (
  `automovil2id` int(11) NOT NULL AUTO_INCREMENT,
  `automovil2` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`automovil2id`)
) ENGINE=InnoDB AUTO_INCREMENT=57 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_bacnodepagocuotados` (
  `bacnodepagocuotadosid` int(11) NOT NULL AUTO_INCREMENT,
  `bacnodepagocuotados` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`bacnodepagocuotadosid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_banco` (
  `bancoid` int(11) NOT NULL AUTO_INCREMENT,
  `banco` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`bancoid`)
) ENGINE=InnoDB AUTO_INCREMENT=63 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_bancodepagocuotatres` (
  `bancodepagocuotatresid` int(11) NOT NULL AUTO_INCREMENT,
  `bancodepagocuotatres` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`bancodepagocuotatresid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_bancoempleado` (
  `bancoempleadoid` int(11) NOT NULL AUTO_INCREMENT,
  `bancoempleado` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`bancoempleadoid`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_bancopago` (
  `bancopagoid` int(11) NOT NULL AUTO_INCREMENT,
  `bancopago` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`bancopagoid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_bancopagoaddendum1` (
  `bancopagoaddendum1id` int(11) NOT NULL AUTO_INCREMENT,
  `bancopagoaddendum1` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`bancopagoaddendum1id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_bancopagocuotauno` (
  `bancopagocuotaunoid` int(11) NOT NULL AUTO_INCREMENT,
  `bancopagocuotauno` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`bancopagocuotaunoid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_bdepago` (
  `bdepagoid` int(11) NOT NULL AUTO_INCREMENT,
  `bdepago` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`bdepagoid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_bdpago` (
  `bdpagoid` int(11) NOT NULL AUTO_INCREMENT,
  `bdpago` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`bdpagoid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_bdpago1cuota` (
  `bdpago1cuotaid` int(11) NOT NULL AUTO_INCREMENT,
  `bdpago1cuota` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`bdpago1cuotaid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_bdpago2cuota` (
  `bdpago2cuotaid` int(11) NOT NULL AUTO_INCREMENT,
  `bdpago2cuota` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`bdpago2cuotaid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_bdpago3cuota` (
  `bdpago3cuotaid` int(11) NOT NULL AUTO_INCREMENT,
  `bdpago3cuota` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`bdpago3cuotaid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_bdpago4cuota` (
  `bdpago4cuotaid` int(11) NOT NULL AUTO_INCREMENT,
  `bdpago4cuota` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`bdpago4cuotaid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_bdpago5cuuota` (
  `bdpago5cuuotaid` int(11) NOT NULL AUTO_INCREMENT,
  `bdpago5cuuota` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`bdpago5cuuotaid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_bdpago6cuota` (
  `bdpago6cuotaid` int(11) NOT NULL AUTO_INCREMENT,
  `bdpago6cuota` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`bdpago6cuotaid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_bienesembargados` (
  `bienesembargadosid` int(11) NOT NULL AUTO_INCREMENT,
  `bienesembargados` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` int(10) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`bienesembargadosid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_bienesembargadosdc` (
  `bienesembargadosdcid` int(11) NOT NULL AUTO_INCREMENT,
  `bienesembargadosdc` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`bienesembargadosdcid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_bieninmueble1` (
  `bieninmueble1id` int(11) NOT NULL AUTO_INCREMENT,
  `bieninmueble1` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`bieninmueble1id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_bieninmueble2` (
  `bieninmueble2id` int(11) NOT NULL AUTO_INCREMENT,
  `bieninmueble2` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`bieninmueble2id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_blocks` (
  `blockid` int(10) NOT NULL AUTO_INCREMENT,
  `tabid` smallint(5) NOT NULL,
  `blocklabel` varchar(100) NOT NULL,
  `sequence` int(10) DEFAULT NULL,
  `show_title` int(2) DEFAULT NULL,
  `visible` int(2) NOT NULL DEFAULT '0',
  `create_view` int(2) NOT NULL DEFAULT '0',
  `edit_view` int(2) NOT NULL DEFAULT '0',
  `detail_view` int(2) NOT NULL DEFAULT '0',
  `display_status` int(1) NOT NULL DEFAULT '1',
  `iscustom` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`blockid`),
  KEY `block_tabid_idx` (`tabid`),
  CONSTRAINT `fk_1_vtiger_blocks` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=792 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_blocks_hide` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `blockid` int(10) unsigned DEFAULT NULL,
  `conditions` text,
  `enabled` tinyint(1) unsigned DEFAULT NULL,
  `view` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `blockid` (`blockid`,`enabled`),
  KEY `view` (`view`),
  KEY `blockid_2` (`blockid`,`enabled`,`view`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_calendar_config` (
  `type` varchar(10) DEFAULT NULL,
  `name` varchar(20) DEFAULT NULL,
  `label` varchar(20) DEFAULT NULL,
  `value` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_callduration` (
  `calldurationid` int(10) NOT NULL AUTO_INCREMENT,
  `callduration` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`calldurationid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_callduration_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_callhistory` (
  `callhistoryid` int(10) NOT NULL,
  `callhistorytype` varchar(255) DEFAULT NULL,
  `from_number` varchar(30) DEFAULT NULL,
  `to_number` varchar(30) DEFAULT NULL,
  `location` varchar(200) DEFAULT NULL,
  `phonecallid` varchar(100) DEFAULT NULL,
  `duration` int(10) DEFAULT NULL,
  `start_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `country` varchar(100) DEFAULT NULL,
  `imei` varchar(100) DEFAULT NULL,
  `ipaddress` varchar(100) DEFAULT NULL,
  `simserial` varchar(100) DEFAULT NULL,
  `subscriberid` varchar(100) DEFAULT NULL,
  `destination` int(10) DEFAULT NULL,
  `source` int(10) DEFAULT NULL,
  `from_number_extra` varchar(100) DEFAULT NULL,
  `to_number_extra` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`callhistoryid`),
  KEY `source` (`source`),
  KEY `destination` (`destination`),
  CONSTRAINT `vtiger_callhistory_ibfk_1` FOREIGN KEY (`callhistoryid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_callhistorycf` (
  `callhistoryid` int(10) NOT NULL,
  PRIMARY KEY (`callhistoryid`),
  CONSTRAINT `vtiger_callhistorycf_ibfk_1` FOREIGN KEY (`callhistoryid`) REFERENCES `vtiger_callhistory` (`callhistoryid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_callhistorytype` (
  `callhistorytypeid` int(10) NOT NULL AUTO_INCREMENT,
  `callhistorytype` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`callhistorytypeid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_callhistorytype_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_campaign` (
  `campaign_no` varchar(100) NOT NULL,
  `campaignname` varchar(255) DEFAULT NULL,
  `campaigntype` varchar(200) DEFAULT NULL,
  `campaignstatus` varchar(200) DEFAULT NULL,
  `expectedrevenue` decimal(25,8) DEFAULT NULL,
  `budgetcost` decimal(25,8) DEFAULT NULL,
  `actualcost` decimal(25,8) DEFAULT NULL,
  `expectedresponse` varchar(200) DEFAULT NULL,
  `numsent` decimal(11,0) DEFAULT NULL,
  `product_id` int(10) DEFAULT NULL,
  `sponsor` varchar(255) DEFAULT NULL,
  `targetaudience` varchar(255) DEFAULT NULL,
  `targetsize` int(10) DEFAULT NULL,
  `expectedresponsecount` int(10) DEFAULT NULL,
  `expectedsalescount` int(10) DEFAULT NULL,
  `expectedroi` decimal(25,8) DEFAULT NULL,
  `actualresponsecount` int(10) DEFAULT NULL,
  `actualsalescount` int(10) DEFAULT NULL,
  `actualroi` decimal(25,8) DEFAULT NULL,
  `campaignid` int(10) NOT NULL,
  `closingdate` date DEFAULT NULL,
  `sum_time` decimal(10,2) DEFAULT '0.00',
  PRIMARY KEY (`campaignid`),
  KEY `campaign_campaignstatus_idx` (`campaignstatus`),
  KEY `campaign_campaignname_idx` (`campaignname`),
  KEY `campaign_campaignid_idx` (`campaignid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_campaign_records` (
  `campaignid` int(10) NOT NULL DEFAULT '0',
  `crmid` int(10) NOT NULL DEFAULT '0',
  `campaignrelstatusid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`campaignid`,`crmid`,`campaignrelstatusid`),
  KEY `campaigncontrel_contractid_idx` (`crmid`),
  CONSTRAINT `fk_vtiger_crmentity` FOREIGN KEY (`crmid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_campaignscf` (
  `campaignid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`campaignid`),
  CONSTRAINT `fk_1_vtiger_campaignscf` FOREIGN KEY (`campaignid`) REFERENCES `vtiger_campaign` (`campaignid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_campaignstatus` (
  `campaignstatusid` int(10) NOT NULL AUTO_INCREMENT,
  `campaignstatus` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT NULL,
  PRIMARY KEY (`campaignstatusid`),
  KEY `campaignstatus_campaignstatus_idx` (`campaignstatus`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_campaignstatus_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_campaigntype` (
  `campaigntypeid` int(10) NOT NULL AUTO_INCREMENT,
  `campaigntype` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT NULL,
  PRIMARY KEY (`campaigntypeid`),
  UNIQUE KEY `campaigntype_campaigntype_idx` (`campaigntype`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_campaigntype_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_campana` (
  `campanaid` int(11) NOT NULL AUTO_INCREMENT,
  `campana` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`campanaid`)
) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_campanafacebook` (
  `campanafacebookid` int(11) NOT NULL DEFAULT '0',
  `campface` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `nombrecompleto` varchar(200) DEFAULT '',
  `telefono` varchar(20) DEFAULT '',
  `correo` varchar(100) DEFAULT '',
  `ciudad` varchar(50) DEFAULT '',
  `fecharegistro` date DEFAULT NULL,
  `nombrecampana` varchar(50) DEFAULT '',
  `nombreconjuntoanuncios` varchar(50) DEFAULT '',
  `nombreanuncio` varchar(50) DEFAULT '',
  `plataforma` varchar(50) DEFAULT '',
  `cuandoquieresquqtellamen` varchar(200) DEFAULT '',
  `estadollamada` varchar(255) DEFAULT 'Por realizar',
  `estadocorreo` varchar(255) DEFAULT '',
  `fechaultimallamada` date DEFAULT NULL,
  `fechaultimocorreo` date DEFAULT NULL,
  `estadodellead` varchar(255) DEFAULT '',
  `obsgestion` text,
  `fechaproximallamada` date DEFAULT NULL,
  `numerocaso` varchar(10) DEFAULT '',
  `motivonoleinteresa` varchar(255) DEFAULT '',
  `comuna` varchar(46) DEFAULT '',
  `tieneshipotecario` varchar(30) DEFAULT '',
  PRIMARY KEY (`campanafacebookid`),
  CONSTRAINT `fk_1_vtiger_campanafacebookcampanafacebookid` FOREIGN KEY (`campanafacebookid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_campanafacebook_inventory` (
  `id` int(11) DEFAULT NULL,
  `seq` int(10) DEFAULT NULL,
  KEY `campanafacebook_inventory_idx` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_campanafacebook_invfield` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `columnname` varchar(30) NOT NULL,
  `label` varchar(50) NOT NULL,
  `invtype` varchar(30) NOT NULL,
  `presence` smallint(1) unsigned NOT NULL DEFAULT '0',
  `defaultvalue` varchar(255) DEFAULT NULL,
  `sequence` int(10) unsigned NOT NULL,
  `block` smallint(1) unsigned NOT NULL,
  `displaytype` smallint(1) unsigned NOT NULL DEFAULT '1',
  `params` text,
  `colspan` smallint(1) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_campanafacebook_invmap` (
  `module` varchar(50) NOT NULL,
  `field` varchar(50) NOT NULL,
  `tofield` varchar(50) NOT NULL,
  PRIMARY KEY (`module`,`field`,`tofield`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_campanafacebookcf` (
  `campanafacebookid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`campanafacebookid`),
  CONSTRAINT `fk_1_vtiger_campanafacebookcfcampanafacebookid` FOREIGN KEY (`campanafacebookid`) REFERENCES `vtiger_campanafacebook` (`campanafacebookid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_campanasAsesorx` (
  `nombre_campana` varchar(100) NOT NULL,
  `comuna` varchar(60) NOT NULL,
  `nombre` varchar(100) NOT NULL,
  `telefono` varchar(40) NOT NULL,
  `correo` varchar(100) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_campanasmktdigital` (
  `campanasmktdigitalid` int(11) NOT NULL,
  `id` varchar(255) DEFAULT NULL,
  `number` varchar(100) DEFAULT NULL,
  `tienescrehip` varchar(100) DEFAULT '',
  `comuna` varchar(100) DEFAULT '',
  `nombrecompleto` varchar(100) DEFAULT '',
  `telefono` varchar(100) DEFAULT '',
  `correo` varchar(150) DEFAULT NULL,
  `campana` varchar(150) DEFAULT NULL,
  `conjuntodeanuncios` varchar(100) DEFAULT '',
  `anuncio` varchar(100) DEFAULT '',
  `mediodigital` varchar(100) DEFAULT '',
  `motivorechazo` varchar(255) DEFAULT '',
  `fechaultimallamada` date DEFAULT NULL,
  `fechaproximallamada` datetime DEFAULT NULL,
  `estadolead` varchar(255) DEFAULT '',
  `estadollamada` varchar(255) DEFAULT '',
  `codigocampana` varchar(40) DEFAULT '',
  `mescampana` varchar(40) DEFAULT '',
  `anocampana` varchar(40) DEFAULT '',
  `last_update` date DEFAULT NULL,
  `idfacebook` varchar(100) DEFAULT '',
  `gestionadopor` varchar(255) DEFAULT '',
  `obsrechazo` varchar(240) DEFAULT '',
  `obslead` varchar(240) DEFAULT '',
  `fecha_asignado` datetime DEFAULT NULL,
  `fecha_leads` date DEFAULT NULL,
  `leadan` varchar(10) DEFAULT '0',
  `Gestion_leads` text NOT NULL,
  PRIMARY KEY (`campanasmktdigitalid`),
  CONSTRAINT `fk_1_vtiger_campanasmktdigitalcampanasmktdigitalid` FOREIGN KEY (`campanasmktdigitalid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_campanasmktdigital_2` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `camp` varchar(10) NOT NULL,
  `email` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=546 DEFAULT CHARSET=latin1;
CREATE TABLE `vtiger_campanasmktdigital_inventory` (
  `id` int(11) DEFAULT NULL,
  `seq` int(10) DEFAULT NULL,
  KEY `campanasmktdigital_inventory_idx` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_campanasmktdigital_invfield` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `columnname` varchar(30) NOT NULL,
  `label` varchar(50) NOT NULL,
  `invtype` varchar(30) NOT NULL,
  `presence` smallint(1) unsigned NOT NULL DEFAULT '0',
  `defaultvalue` varchar(255) DEFAULT NULL,
  `sequence` int(10) unsigned NOT NULL,
  `block` smallint(1) unsigned NOT NULL,
  `displaytype` smallint(1) unsigned NOT NULL DEFAULT '1',
  `params` text,
  `colspan` smallint(1) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_campanasmktdigital_invmap` (
  `module` varchar(50) NOT NULL,
  `field` varchar(50) NOT NULL,
  `tofield` varchar(50) NOT NULL,
  PRIMARY KEY (`module`,`field`,`tofield`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_campanasmktdigitalcf` (
  `campanasmktdigitalid` int(11) NOT NULL,
  PRIMARY KEY (`campanasmktdigitalid`),
  CONSTRAINT `fk_1_vtiger_campanasmktdigitalcfcampanasmktdigitalid` FOREIGN KEY (`campanasmktdigitalid`) REFERENCES `vtiger_campanasmktdigital` (`campanasmktdigitalid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_canal` (
  `canalid` int(11) NOT NULL AUTO_INCREMENT,
  `canal` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`canalid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_canalcaptacion` (
  `canalcaptacionid` int(11) NOT NULL AUTO_INCREMENT,
  `canalcaptacion` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`canalcaptacionid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_cantidadnotenc` (
  `cantidadnotencid` int(11) NOT NULL AUTO_INCREMENT,
  `cantidadnotenc` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`cantidadnotencid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_cantllamados` (
  `cantllamadosid` int(11) NOT NULL AUTO_INCREMENT,
  `cantllamados` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`cantllamadosid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_captador` (
  `captadorid` int(11) NOT NULL AUTO_INCREMENT,
  `captador` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`captadorid`)
) ENGINE=InnoDB AUTO_INCREMENT=331 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_captadorfree` (
  `captadorfreeid` int(11) NOT NULL AUTO_INCREMENT,
  `captadorfree` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`captadorfreeid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_cargofijo` (
  `cargofijoid` int(11) NOT NULL DEFAULT '0',
  `montocontrato` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `siniestro` int(11) unsigned DEFAULT '0',
  `nrofactura` bigint(59) DEFAULT '0',
  `dctocontrato` bigint(32) DEFAULT '0',
  `ffactura` date DEFAULT NULL,
  `montofactura` bigint(59) DEFAULT '0',
  `fvenfactura` date DEFAULT NULL,
  `facturapagada` tinyint(1) DEFAULT '0',
  `fpagofactura` date DEFAULT NULL,
  `banco` varchar(255) DEFAULT '',
  `nrocuenta` bigint(59) DEFAULT '0',
  `tipocuenta` varchar(255) DEFAULT '',
  `sucursal` varchar(59) DEFAULT '',
  `diaspago` varchar(255) DEFAULT '',
  `nombrecliente` int(11) unsigned DEFAULT '0',
  `captador` varchar(255) DEFAULT '',
  `tipopago` varchar(255) DEFAULT '',
  `bancopago` varchar(255) DEFAULT '',
  `codwebpay` bigint(12) DEFAULT '0',
  `tarjpago` varchar(255) DEFAULT '',
  `estado` varchar(255) DEFAULT '',
  `entliquidadora` varchar(255) DEFAULT '',
  `ciudadcaso` varchar(255) DEFAULT '',
  `comunacaso` varchar(255) DEFAULT '',
  PRIMARY KEY (`cargofijoid`),
  KEY `vtiger_cargofijo_siniestro_idx` (`siniestro`),
  KEY `vtiger_cargofijo_nombrecliente_idx` (`nombrecliente`),
  CONSTRAINT `fk_1_vtiger_cargofijocargofijoid` FOREIGN KEY (`cargofijoid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_cargofijocf` (
  `cargofijoid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`cargofijoid`),
  CONSTRAINT `fk_1_vtiger_cargofijocfcargofijoid` FOREIGN KEY (`cargofijoid`) REFERENCES `vtiger_cargofijo` (`cargofijoid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_categoriacomision` (
  `categoriacomisionid` int(11) NOT NULL AUTO_INCREMENT,
  `categoriacomision` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`categoriacomisionid`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_categorizacion` (
  `categorizacionid` int(11) NOT NULL AUTO_INCREMENT,
  `categorizacion` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`categorizacionid`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_cau_as_le` (
  `cau_as_leid` int(11) NOT NULL AUTO_INCREMENT,
  `cau_as_le` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` int(10) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`cau_as_leid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_causalesmixtas` (
  `causalesmixtasid` int(11) NOT NULL AUTO_INCREMENT,
  `causalesmixtas` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`causalesmixtasid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_causalesmixtas2` (
  `causalesmixtas2id` int(11) NOT NULL AUTO_INCREMENT,
  `causalesmixtas2` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`causalesmixtas2id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ciaseguros` (
  `ciasegurosid` int(11) NOT NULL AUTO_INCREMENT,
  `ciaseguros` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`ciasegurosid`)
) ENGINE=InnoDB AUTO_INCREMENT=86 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ciudadcaso` (
  `ciudadcasoid` int(11) NOT NULL AUTO_INCREMENT,
  `ciudadcaso` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`ciudadcasoid`)
) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ciudadcliente` (
  `ciudadclienteid` int(11) NOT NULL AUTO_INCREMENT,
  `ciudadcliente` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`ciudadclienteid`)
) ENGINE=InnoDB AUTO_INCREMENT=115 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_claseapelacion` (
  `claseapelacionid` int(11) NOT NULL AUTO_INCREMENT,
  `claseapelacion` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`claseapelacionid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_clasecasacion` (
  `clasecasacionid` int(11) NOT NULL AUTO_INCREMENT,
  `clasecasacion` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`clasecasacionid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_clasedeapelacion` (
  `clasedeapelacionid` int(11) NOT NULL AUTO_INCREMENT,
  `clasedeapelacion` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`clasedeapelacionid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_cliente` (
  `clienteid` int(11) NOT NULL DEFAULT '0',
  `cliente` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `nombre` varchar(200) DEFAULT '',
  `apellido` varchar(200) DEFAULT '',
  `serienrodocto` varchar(16) DEFAULT '',
  `movil` varchar(30) DEFAULT '',
  `movil_extra` varchar(100) DEFAULT NULL,
  `tlfparticular` varchar(30) DEFAULT '',
  `tlfparticular_extra` varchar(100) DEFAULT NULL,
  `email` varchar(100) DEFAULT '',
  `tipocliente` varchar(255) DEFAULT '',
  `captador` varchar(255) DEFAULT '',
  `ofcaptador` varchar(255) DEFAULT '',
  `observaciones` text,
  `dircliente` text,
  `comunacliente` varchar(255) DEFAULT '',
  `ciudadcliente` varchar(255) DEFAULT '',
  `paiscliente` varchar(255) DEFAULT '',
  `clienteportal` tinyint(1) DEFAULT '0',
  `iniciosoporte` date DEFAULT NULL,
  `finsoporte` date DEFAULT NULL,
  `descripcion` text,
  `fnacimiento` date DEFAULT NULL,
  `edocivil` varchar(255) DEFAULT '',
  `estudios` varchar(255) DEFAULT '',
  `fuente` varchar(255) DEFAULT '',
  `profesion` varchar(32) DEFAULT '',
  `comunadelcliente` varchar(255) DEFAULT '',
  `provinciadelcliente` varchar(255) DEFAULT '',
  `regiondelcliente` varchar(255) DEFAULT '',
  `proviene` varchar(255) DEFAULT '',
  `password` varchar(64) DEFAULT '',
  `referido` int(11) unsigned DEFAULT '0',
  `contrasenaenviada` tinyint(1) DEFAULT '0',
  `marcaportal` tinyint(1) DEFAULT '0',
  `cli` int(11) unsigned DEFAULT '0',
  `client` int(11) unsigned DEFAULT '0',
  `idclientevd` int(11) unsigned DEFAULT '0',
  `claveportal` varchar(20) DEFAULT '',
  `sinacofi` tinyint(1) DEFAULT '0',
  `fonoarrendatario` varchar(30) DEFAULT '',
  `estadopac` varchar(255) DEFAULT '1',
  `appsuspac` text,
  `fechasuspac` date DEFAULT NULL,
  `ven_asig_pac` varchar(100) DEFAULT '',
  `enviarwp` tinyint(1) DEFAULT '0',
  `asociadoesterno` varchar(200) DEFAULT '',
  PRIMARY KEY (`clienteid`),
  KEY `vtiger_cliente_referido_idx` (`referido`),
  KEY `vtiger_cliente_cli_idx` (`cli`),
  KEY `vtiger_cliente_client_idx` (`client`),
  KEY `vtiger_cliente_idclientevd_idx` (`idclientevd`),
  CONSTRAINT `fk_1_vtiger_clienteclienteid` FOREIGN KEY (`clienteid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_clientecf` (
  `clienteid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`clienteid`),
  CONSTRAINT `fk_1_vtiger_clientecfclienteid` FOREIGN KEY (`clienteid`) REFERENCES `vtiger_cliente` (`clienteid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_clientesgarantia` (
  `clientesgarantiaid` int(11) NOT NULL,
  `clientes_garantia` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `cliente_contactado` tinyint(1) DEFAULT '0',
  `fecha_contacto` date DEFAULT NULL,
  `firma_contrato` tinyint(1) DEFAULT '0',
  `fecha_firma_asl` date DEFAULT NULL,
  PRIMARY KEY (`clientesgarantiaid`),
  CONSTRAINT `fk_1_vtiger_clientesgarantiaclientesgarantiaid` FOREIGN KEY (`clientesgarantiaid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_clientesgarantiacf` (
  `clientesgarantiaid` int(11) NOT NULL,
  PRIMARY KEY (`clientesgarantiaid`),
  CONSTRAINT `fk_1_vtiger_clientesgarantiacfclientesgarantiaid` FOREIGN KEY (`clientesgarantiaid`) REFERENCES `vtiger_clientesgarantia` (`clientesgarantiaid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_cmileage_logbook_status` (
  `cmileage_logbook_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `cmileage_logbook_status` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` smallint(5) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`cmileage_logbook_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_cobertura` (
  `coberturaid` int(11) NOT NULL AUTO_INCREMENT,
  `cobertura` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`coberturaid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_cobertura2` (
  `cobertura2id` int(11) NOT NULL AUTO_INCREMENT,
  `cobertura2` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`cobertura2id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_cobertura3` (
  `cobertura3id` int(11) NOT NULL AUTO_INCREMENT,
  `cobertura3` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`cobertura3id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_comuna` (
  `comunaid` int(11) NOT NULL AUTO_INCREMENT,
  `comuna` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`comunaid`)
) ENGINE=InnoDB AUTO_INCREMENT=347 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_comunabi1` (
  `comunabi1id` int(11) NOT NULL AUTO_INCREMENT,
  `comunabi1` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`comunabi1id`)
) ENGINE=InnoDB AUTO_INCREMENT=347 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_comunabi2` (
  `comunabi2id` int(11) NOT NULL AUTO_INCREMENT,
  `comunabi2` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`comunabi2id`)
) ENGINE=InnoDB AUTO_INCREMENT=347 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_comunacaso` (
  `comunacasoid` int(11) NOT NULL AUTO_INCREMENT,
  `comunacaso` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  `color` varchar(25) DEFAULT NULL,
  PRIMARY KEY (`comunacasoid`)
) ENGINE=InnoDB AUTO_INCREMENT=148 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_comunacli` (
  `comunacliid` int(11) NOT NULL AUTO_INCREMENT,
  `comunacli` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`comunacliid`)
) ENGINE=InnoDB AUTO_INCREMENT=347 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_comunacliente` (
  `comunaclienteid` int(11) NOT NULL AUTO_INCREMENT,
  `comunacliente` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`comunaclienteid`)
) ENGINE=InnoDB AUTO_INCREMENT=409 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_comunadelcaso` (
  `comunadelcasoid` int(11) NOT NULL AUTO_INCREMENT,
  `comunadelcaso` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`comunadelcasoid`)
) ENGINE=InnoDB AUTO_INCREMENT=347 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_comunadelcliente` (
  `comunadelclienteid` int(11) NOT NULL AUTO_INCREMENT,
  `comunadelcliente` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`comunadelclienteid`)
) ENGINE=InnoDB AUTO_INCREMENT=347 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_comunaempleador` (
  `comunaempleadorid` int(11) NOT NULL AUTO_INCREMENT,
  `comunaempleador` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`comunaempleadorid`)
) ENGINE=InnoDB AUTO_INCREMENT=347 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_concepto` (
  `conceptoid` int(11) NOT NULL AUTO_INCREMENT,
  `concepto` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`conceptoid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_concepto1` (
  `concepto1id` int(11) NOT NULL AUTO_INCREMENT,
  `concepto1` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`concepto1id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_concepto2` (
  `concepto2id` int(11) NOT NULL AUTO_INCREMENT,
  `concepto2` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`concepto2id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_concepto3` (
  `concepto3id` int(11) NOT NULL AUTO_INCREMENT,
  `concepto3` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`concepto3id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_contactaddress` (
  `contactaddressid` int(10) NOT NULL DEFAULT '0',
  `addresslevel1a` varchar(255) DEFAULT NULL,
  `addresslevel1b` varchar(255) DEFAULT NULL,
  `addresslevel2a` varchar(255) DEFAULT NULL,
  `addresslevel2b` varchar(255) DEFAULT NULL,
  `addresslevel3a` varchar(255) DEFAULT NULL,
  `addresslevel3b` varchar(255) DEFAULT NULL,
  `addresslevel4a` varchar(255) DEFAULT NULL,
  `addresslevel4b` varchar(255) DEFAULT NULL,
  `addresslevel5a` varchar(255) DEFAULT NULL,
  `addresslevel5b` varchar(255) DEFAULT NULL,
  `addresslevel6a` varchar(255) DEFAULT NULL,
  `addresslevel6b` varchar(255) DEFAULT NULL,
  `addresslevel7a` varchar(255) DEFAULT NULL,
  `addresslevel7b` varchar(255) DEFAULT NULL,
  `addresslevel8a` varchar(255) DEFAULT NULL,
  `addresslevel8b` varchar(255) DEFAULT NULL,
  `buildingnumbera` varchar(100) DEFAULT NULL,
  `localnumbera` varchar(100) DEFAULT NULL,
  `buildingnumberb` varchar(100) DEFAULT NULL,
  `localnumberb` varchar(100) DEFAULT NULL,
  `poboxa` varchar(50) DEFAULT NULL,
  `poboxb` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`contactaddressid`),
  CONSTRAINT `fk_1_vtiger_contactaddress` FOREIGN KEY (`contactaddressid`) REFERENCES `vtiger_contactdetails` (`contactid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_contactdetails` (
  `contactid` int(10) NOT NULL DEFAULT '0',
  `contact_no` varchar(100) NOT NULL,
  `parentid` int(10) DEFAULT NULL,
  `salutation` varchar(200) DEFAULT NULL,
  `firstname` varchar(40) DEFAULT NULL,
  `lastname` varchar(80) NOT NULL,
  `email` varchar(100) DEFAULT NULL,
  `phone` varchar(50) DEFAULT NULL,
  `mobile` varchar(50) DEFAULT NULL,
  `reportsto` varchar(30) DEFAULT NULL,
  `training` varchar(50) DEFAULT NULL,
  `usertype` varchar(50) DEFAULT NULL,
  `contacttype` varchar(50) DEFAULT NULL,
  `otheremail` varchar(100) DEFAULT NULL,
  `donotcall` smallint(1) DEFAULT NULL,
  `emailoptout` smallint(1) DEFAULT '0',
  `imagename` varchar(150) DEFAULT NULL,
  `isconvertedfromlead` smallint(1) DEFAULT '0',
  `verification` text,
  `secondary_email` varchar(100) DEFAULT '',
  `notifilanguage` varchar(100) DEFAULT '',
  `contactstatus` varchar(255) DEFAULT '',
  `dav_status` tinyint(1) DEFAULT '1',
  `jobtitle` varchar(100) DEFAULT '',
  `decision_maker` tinyint(1) DEFAULT '0',
  `sum_time` decimal(10,2) DEFAULT '0.00',
  `active` tinyint(1) DEFAULT '0',
  `phone_extra` varchar(100) DEFAULT NULL,
  `mobile_extra` varchar(100) DEFAULT NULL,
  `comisionpagada` tinyint(1) DEFAULT '0',
  `fechapagocomision` date DEFAULT NULL,
  `valorplan` bigint(40) DEFAULT '0',
  `suscripcionid` int(11) unsigned DEFAULT '0',
  PRIMARY KEY (`contactid`),
  KEY `contactdetails_accountid_idx` (`parentid`),
  KEY `email_idx` (`email`),
  KEY `lastname` (`lastname`),
  KEY `vtiger_contactdetails_suscripcionid_idx` (`suscripcionid`),
  CONSTRAINT `fk_1_vtiger_contactdetails` FOREIGN KEY (`contactid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_contactscf` (
  `contactid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`contactid`),
  CONSTRAINT `fk_1_vtiger_contactscf` FOREIGN KEY (`contactid`) REFERENCES `vtiger_contactdetails` (`contactid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_contactstatus` (
  `contactstatusid` int(10) NOT NULL AUTO_INCREMENT,
  `contactstatus` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT '0',
  PRIMARY KEY (`contactstatusid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_contactstatus_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_contactsubdetails` (
  `contactsubscriptionid` int(10) NOT NULL DEFAULT '0',
  `birthday` date DEFAULT NULL,
  `laststayintouchrequest` int(10) DEFAULT '0',
  `laststayintouchsavedate` int(10) DEFAULT '0',
  `leadsource` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`contactsubscriptionid`),
  CONSTRAINT `fk_1_vtiger_contactsubdetails` FOREIGN KEY (`contactsubscriptionid`) REFERENCES `vtiger_contactdetails` (`contactid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_contract_priority` (
  `contract_priorityid` int(10) NOT NULL AUTO_INCREMENT,
  `contract_priority` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT '0',
  PRIMARY KEY (`contract_priorityid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_contract_priority_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_contract_status` (
  `contract_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `contract_status` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT '0',
  PRIMARY KEY (`contract_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_contract_status_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_contract_type` (
  `contract_typeid` int(10) NOT NULL AUTO_INCREMENT,
  `contract_type` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT '0',
  PRIMARY KEY (`contract_typeid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_contract_type_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_convenio` (
  `convenioid` int(11) NOT NULL,
  `id_convenio` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `nro_caso` varchar(100) DEFAULT '',
  `rut` varchar(100) DEFAULT '',
  `direccion` varchar(100) DEFAULT '',
  `estadosus` varchar(255) DEFAULT '',
  `nroconvenio` varchar(50) DEFAULT '',
  `nombrecliente` varchar(100) DEFAULT '',
  `capital` bigint(50) DEFAULT '0',
  `interes` bigint(100) DEFAULT '0',
  `gastoscobranza` bigint(100) DEFAULT '0',
  `gastoconvenio` bigint(100) DEFAULT '0',
  `honorariosabogado` bigint(100) DEFAULT '0',
  `capital_convenio` bigint(100) DEFAULT '0',
  `interes_convenio` bigint(100) DEFAULT '0',
  `gastoscobranza_convenio` bigint(100) DEFAULT '0',
  `gastosconvenio_convenio` bigint(100) DEFAULT '0',
  `honorariosabogados_convenio` bigint(100) DEFAULT '0',
  `tipodenegociacion` varchar(255) DEFAULT '',
  `suscritopac` tinyint(1) DEFAULT '0',
  `totaldeudanegociar` bigint(100) DEFAULT '0',
  `fechaconvenio` date DEFAULT NULL,
  `totalconvenio1` bigint(100) DEFAULT '0',
  `abono_convenio` bigint(100) DEFAULT '0',
  `saldocapital` bigint(100) DEFAULT '0',
  `nrocuotas` varchar(255) DEFAULT '',
  `valorcuotas` bigint(100) DEFAULT '0',
  `diasvencimiento` varchar(100) DEFAULT '',
  `fechavencimientocuota1` date DEFAULT NULL,
  `interesconvenio` bigint(100) DEFAULT '0',
  `conveniofirmado` tinyint(1) DEFAULT '0',
  `abonorealizado` tinyint(1) DEFAULT '0',
  `abonoconfirmado` tinyint(1) DEFAULT '0',
  `sistemaregularizado` tinyint(1) DEFAULT '0',
  `eliminadosinacofi` tinyint(1) DEFAULT '0',
  `estadoconvenio` varchar(255) DEFAULT '',
  `concepto` varchar(255) DEFAULT '',
  `totalcapconvenio` bigint(100) DEFAULT '0',
  PRIMARY KEY (`convenioid`),
  CONSTRAINT `fk_1_vtiger_convenioconvenioid` FOREIGN KEY (`convenioid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_conveniocf` (
  `convenioid` int(11) NOT NULL,
  PRIMARY KEY (`convenioid`),
  CONSTRAINT `fk_1_vtiger_conveniocfconvenioid` FOREIGN KEY (`convenioid`) REFERENCES `vtiger_convenio` (`convenioid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_convertleadmapping` (
  `cfmid` int(10) NOT NULL AUTO_INCREMENT,
  `leadfid` int(10) NOT NULL,
  `accountfid` int(10) DEFAULT NULL,
  `editable` int(10) DEFAULT '1',
  PRIMARY KEY (`cfmid`)
) ENGINE=InnoDB AUTO_INCREMENT=45 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_corr_seg` (
  `corr_segid` int(11) NOT NULL AUTO_INCREMENT,
  `corr_seg` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`corr_segid`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_cortecompetente` (
  `cortecompetenteid` int(11) NOT NULL AUTO_INCREMENT,
  `cortecompetente` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`cortecompetenteid`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_credito` (
  `creditoid` int(11) NOT NULL DEFAULT '0',
  `credito` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `posibilidad` decimal(5,2) DEFAULT NULL,
  `viveencasa` varchar(255) DEFAULT '',
  `marca` varchar(255) DEFAULT '',
  `modelo` varchar(16) DEFAULT '',
  `nuevousado` varchar(255) DEFAULT '',
  `anio` varchar(255) DEFAULT '',
  `plazo` varchar(255) DEFAULT '',
  `acreditacionpie` varchar(255) DEFAULT '',
  `patente` varchar(16) DEFAULT '',
  `edocredito` varchar(255) DEFAULT '',
  `nreferencia1` varchar(32) DEFAULT '',
  `apellidoreferencia1` varchar(32) DEFAULT '',
  `fonoreferencia1` varchar(30) DEFAULT '',
  `fonoreferencia1_extra` varchar(100) DEFAULT NULL,
  `nreferencia2` varchar(32) DEFAULT '',
  `fonoreferencia2` varchar(30) DEFAULT '',
  `fonoreferencia2_extra` varchar(100) DEFAULT NULL,
  `parentezcoreferencia2` varchar(255) DEFAULT '',
  `apellidoreferencia2` varchar(32) DEFAULT '',
  `tipoempleado` varchar(255) DEFAULT '',
  `nempleador` varchar(32) DEFAULT '',
  `rutempleador` varchar(16) DEFAULT '',
  `direccionempleador` text,
  `fonoempleador` varchar(30) DEFAULT '',
  `fonoempleador_extra` varchar(100) DEFAULT NULL,
  `fingreso` date DEFAULT NULL,
  `dondeotrosingresos` text,
  `banco` varchar(255) DEFAULT '',
  `cuentacorriente` tinyint(1) DEFAULT '0',
  `antiguedad` varchar(255) DEFAULT '',
  `nombreconyugue` varchar(32) DEFAULT '',
  `apellidoconyugue` varchar(32) DEFAULT '',
  `actividad` varchar(32) DEFAULT '',
  `tipoempleadoconyugue` varchar(255) DEFAULT '',
  `movilconyugue` varchar(30) DEFAULT '',
  `movilconyugue_extra` varchar(100) DEFAULT NULL,
  `rutconyugue` varchar(16) DEFAULT '',
  `fingresoconyugue` date DEFAULT NULL,
  `nempleadorconyugue` varchar(32) DEFAULT '',
  `bieninmueble1` varchar(255) DEFAULT '',
  `dirbieninmueble1` text,
  `deudabieninmueble1` varchar(255) DEFAULT '',
  `bieninmueble2` varchar(255) DEFAULT '',
  `dirbieninmueble2` text,
  `deudainmueble2` varchar(255) DEFAULT '',
  `automovil1` varchar(255) DEFAULT '',
  `modeloauto1` varchar(32) DEFAULT '',
  `patenteauto1` varchar(16) DEFAULT '',
  `prendaauto1` varchar(255) DEFAULT '',
  `automovil2` varchar(255) DEFAULT '',
  `modeloauto2` varchar(32) DEFAULT '',
  `patenteauto2` varchar(16) DEFAULT '',
  `prendaauto2` varchar(255) DEFAULT '',
  `observacion` text,
  `parentezcoreferencia1` varchar(255) DEFAULT '',
  `observaciones` text,
  `entfinanciera1` varchar(255) DEFAULT '',
  `edoef1` varchar(255) DEFAULT '',
  `comunaempleador` varchar(255) DEFAULT '',
  `provinciaempleador` varchar(255) DEFAULT '',
  `comunabi1` varchar(255) DEFAULT '',
  `comunabi2` varchar(255) DEFAULT '',
  `provinciabi1` varchar(255) DEFAULT '',
  `regionbi1` varchar(255) DEFAULT '',
  `provinciabi2` varchar(255) DEFAULT '',
  `regionbi2` varchar(255) DEFAULT '',
  `valorvehiculo` bigint(64) DEFAULT '0',
  `montopie` bigint(64) DEFAULT '0',
  `rentaliquida` bigint(64) DEFAULT '0',
  `arriendobiener` bigint(64) DEFAULT '0',
  `pensionjubilacion` bigint(64) DEFAULT '0',
  `honorarios` bigint(64) DEFAULT '0',
  `otrosingresos` bigint(64) DEFAULT '0',
  `montolineacredito` bigint(64) DEFAULT '0',
  `totalingresos` bigint(64) DEFAULT '0',
  `sueldoconyugue` bigint(64) DEFAULT '0',
  `valorcomercialbi1` bigint(64) DEFAULT '0',
  `valorcomercialbi2` bigint(64) DEFAULT '0',
  `valorcomercialbm1` bigint(64) DEFAULT '0',
  `valorcomercialbm2` bigint(64) DEFAULT '0',
  `regionempleador` varchar(255) DEFAULT '',
  `cargo` varchar(64) DEFAULT '',
  `cargoconyugue` varchar(64) DEFAULT '',
  `nombrecliente` int(11) unsigned DEFAULT '0',
  PRIMARY KEY (`creditoid`),
  KEY `vtiger_credito_nombrecliente_idx` (`nombrecliente`),
  CONSTRAINT `fk_1_vtiger_creditocreditoid` FOREIGN KEY (`creditoid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_creditocf` (
  `creditoid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`creditoid`),
  CONSTRAINT `fk_1_vtiger_creditocfcreditoid` FOREIGN KEY (`creditoid`) REFERENCES `vtiger_credito` (`creditoid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_crmentity` (
  `crmid` int(10) NOT NULL AUTO_INCREMENT,
  `smcreatorid` smallint(5) unsigned NOT NULL DEFAULT '0',
  `smownerid` smallint(5) unsigned NOT NULL DEFAULT '0',
  `shownerid` tinyint(1) DEFAULT NULL,
  `modifiedby` smallint(5) unsigned NOT NULL DEFAULT '0',
  `setype` varchar(30) NOT NULL,
  `description` text,
  `attention` text,
  `createdtime` datetime NOT NULL,
  `modifiedtime` datetime NOT NULL,
  `viewedtime` datetime DEFAULT NULL,
  `closedtime` datetime DEFAULT NULL,
  `status` varchar(50) DEFAULT NULL,
  `version` int(10) unsigned NOT NULL DEFAULT '0',
  `presence` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `was_read` tinyint(1) DEFAULT '0',
  `private` tinyint(1) DEFAULT '0',
  `users` text,
  PRIMARY KEY (`crmid`),
  KEY `crmentity_smcreatorid_idx` (`smcreatorid`),
  KEY `crmentity_modifiedby_idx` (`modifiedby`),
  KEY `crmentity_deleted_idx` (`deleted`),
  KEY `crm_ownerid_del_setype_idx` (`smownerid`,`deleted`,`setype`),
  KEY `crmid` (`crmid`,`deleted`),
  KEY `crmid_2` (`crmid`,`setype`),
  KEY `setypedeleted` (`setype`,`deleted`),
  KEY `setype` (`setype`)
) ENGINE=InnoDB AUTO_INCREMENT=397797 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_crmentityrel` (
  `crmid` int(10) NOT NULL,
  `module` varchar(25) NOT NULL,
  `relcrmid` int(10) NOT NULL,
  `relmodule` varchar(25) NOT NULL,
  `rel_created_user` int(10) DEFAULT NULL,
  `rel_created_time` datetime DEFAULT NULL,
  `rel_comment` varchar(255) DEFAULT NULL,
  KEY `crmid` (`crmid`),
  KEY `relcrmid` (`relcrmid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_cron_task` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) DEFAULT NULL,
  `handler_file` varchar(100) DEFAULT NULL,
  `frequency` int(10) DEFAULT NULL,
  `laststart` int(10) unsigned DEFAULT NULL,
  `lastend` int(10) unsigned DEFAULT NULL,
  `status` int(10) DEFAULT NULL,
  `module` varchar(100) DEFAULT NULL,
  `sequence` int(10) DEFAULT NULL,
  `description` text,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`),
  UNIQUE KEY `handler_file` (`handler_file`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_currencies` (
  `currencyid` int(10) NOT NULL AUTO_INCREMENT,
  `currency_name` varchar(200) DEFAULT NULL,
  `currency_code` varchar(50) DEFAULT NULL,
  `currency_symbol` varchar(11) DEFAULT NULL,
  PRIMARY KEY (`currencyid`)
) ENGINE=InnoDB AUTO_INCREMENT=139 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_currencies_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_currency` (
  `currencyid` int(10) NOT NULL AUTO_INCREMENT,
  `currency` varchar(200) NOT NULL,
  `sortorderid` int(10) NOT NULL DEFAULT '0',
  `presence` int(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`currencyid`),
  UNIQUE KEY `currency_currency_idx` (`currency`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_currency_decimal_separator` (
  `currency_decimal_separatorid` int(10) NOT NULL AUTO_INCREMENT,
  `currency_decimal_separator` varchar(2) NOT NULL,
  `sortorderid` int(10) NOT NULL DEFAULT '0',
  `presence` int(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`currency_decimal_separatorid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_currency_decimal_separator_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_currency_grouping_pattern` (
  `currency_grouping_patternid` int(10) NOT NULL AUTO_INCREMENT,
  `currency_grouping_pattern` varchar(200) NOT NULL,
  `sortorderid` int(10) NOT NULL DEFAULT '0',
  `presence` int(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`currency_grouping_patternid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_currency_grouping_pattern_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_currency_grouping_separator` (
  `currency_grouping_separatorid` int(10) NOT NULL AUTO_INCREMENT,
  `currency_grouping_separator` varchar(2) NOT NULL,
  `sortorderid` int(10) NOT NULL DEFAULT '0',
  `presence` int(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`currency_grouping_separatorid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_currency_grouping_separator_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_currency_info` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `currency_name` varchar(100) DEFAULT NULL,
  `currency_code` varchar(100) DEFAULT NULL,
  `currency_symbol` varchar(30) DEFAULT NULL,
  `conversion_rate` decimal(12,5) DEFAULT NULL,
  `currency_status` varchar(25) DEFAULT NULL,
  `defaultid` tinyint(3) NOT NULL DEFAULT '0',
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `deleted` (`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_currency_symbol_placement` (
  `currency_symbol_placementid` int(10) NOT NULL AUTO_INCREMENT,
  `currency_symbol_placement` varchar(30) NOT NULL,
  `sortorderid` int(10) NOT NULL DEFAULT '0',
  `presence` int(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`currency_symbol_placementid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_currency_symbol_placement_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_customaction` (
  `cvid` int(10) NOT NULL,
  `subject` varchar(250) NOT NULL,
  `module` varchar(50) NOT NULL,
  `content` text,
  KEY `customaction_cvid_idx` (`cvid`),
  CONSTRAINT `fk_1_vtiger_customaction` FOREIGN KEY (`cvid`) REFERENCES `vtiger_customview` (`cvid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_customerdetails` (
  `customerid` int(10) NOT NULL,
  `portal` smallint(1) DEFAULT NULL,
  `support_start_date` date DEFAULT NULL,
  `support_end_date` date DEFAULT NULL,
  PRIMARY KEY (`customerid`),
  CONSTRAINT `fk_1_vtiger_customerdetails` FOREIGN KEY (`customerid`) REFERENCES `vtiger_contactdetails` (`contactid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_customview` (
  `cvid` int(10) NOT NULL AUTO_INCREMENT,
  `viewname` varchar(100) NOT NULL,
  `setdefault` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `setmetrics` tinyint(1) NOT NULL DEFAULT '0',
  `entitytype` varchar(25) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `userid` int(10) DEFAULT '1',
  `privileges` tinyint(2) DEFAULT '1',
  `featured` tinyint(1) DEFAULT '0',
  `sequence` int(10) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `description` text,
  `sort` varchar(30) DEFAULT '',
  `color` varchar(10) DEFAULT '',
  PRIMARY KEY (`cvid`),
  KEY `customview_entitytype_idx` (`entitytype`),
  KEY `setdefault` (`setdefault`,`entitytype`),
  CONSTRAINT `fk_1_vtiger_customview` FOREIGN KEY (`entitytype`) REFERENCES `vtiger_tab` (`name`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1465 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_cvadvfilter` (
  `cvid` int(10) NOT NULL,
  `columnindex` int(10) NOT NULL,
  `columnname` varchar(250) DEFAULT '',
  `comparator` varchar(20) DEFAULT NULL,
  `value` varchar(512) DEFAULT NULL,
  `groupid` int(10) DEFAULT '1',
  `column_condition` varchar(255) DEFAULT 'and',
  PRIMARY KEY (`cvid`,`columnindex`),
  KEY `cvadvfilter_cvid_idx` (`cvid`),
  CONSTRAINT `fk_1_vtiger_cvadvfilter` FOREIGN KEY (`cvid`) REFERENCES `vtiger_customview` (`cvid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_cvadvfilter_grouping` (
  `groupid` int(10) unsigned NOT NULL,
  `cvid` int(10) unsigned NOT NULL,
  `group_condition` varchar(255) DEFAULT NULL,
  `condition_expression` text,
  PRIMARY KEY (`groupid`,`cvid`),
  KEY `cvid` (`cvid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_cvcolumnlist` (
  `cvid` int(10) NOT NULL,
  `columnindex` int(10) NOT NULL,
  `columnname` varchar(250) DEFAULT '',
  PRIMARY KEY (`cvid`,`columnindex`),
  KEY `cvcolumnlist_columnindex_idx` (`columnindex`),
  KEY `cvcolumnlist_cvid_idx` (`cvid`),
  CONSTRAINT `fk_1_vtiger_cvcolumnlist` FOREIGN KEY (`cvid`) REFERENCES `vtiger_customview` (`cvid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_cvstdfilter` (
  `cvid` int(10) NOT NULL,
  `columnname` varchar(250) DEFAULT '',
  `stdfilter` varchar(250) DEFAULT '',
  `startdate` date DEFAULT NULL,
  `enddate` date DEFAULT NULL,
  PRIMARY KEY (`cvid`),
  KEY `cvstdfilter_cvid_idx` (`cvid`),
  CONSTRAINT `fk_1_vtiger_cvstdfilter` FOREIGN KEY (`cvid`) REFERENCES `vtiger_customview` (`cvid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_datashare_grp2grp` (
  `shareid` int(10) NOT NULL,
  `share_groupid` int(10) DEFAULT NULL,
  `to_groupid` int(10) DEFAULT NULL,
  `permission` int(10) DEFAULT NULL,
  PRIMARY KEY (`shareid`),
  KEY `datashare_grp2grp_share_groupid_idx` (`share_groupid`),
  KEY `datashare_grp2grp_to_groupid_idx` (`to_groupid`),
  CONSTRAINT `fk_3_vtiger_datashare_grp2grp` FOREIGN KEY (`to_groupid`) REFERENCES `vtiger_groups` (`groupid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_datashare_grp2role` (
  `shareid` int(10) NOT NULL,
  `share_groupid` int(10) DEFAULT NULL,
  `to_roleid` varchar(255) DEFAULT NULL,
  `permission` int(10) DEFAULT NULL,
  PRIMARY KEY (`shareid`),
  KEY `idx_datashare_grp2role_share_groupid` (`share_groupid`),
  KEY `idx_datashare_grp2role_to_roleid` (`to_roleid`),
  CONSTRAINT `fk_3_vtiger_datashare_grp2role` FOREIGN KEY (`to_roleid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_datashare_grp2rs` (
  `shareid` int(10) NOT NULL,
  `share_groupid` int(10) DEFAULT NULL,
  `to_roleandsubid` varchar(255) DEFAULT NULL,
  `permission` int(10) DEFAULT NULL,
  PRIMARY KEY (`shareid`),
  KEY `datashare_grp2rs_share_groupid_idx` (`share_groupid`),
  KEY `datashare_grp2rs_to_roleandsubid_idx` (`to_roleandsubid`),
  CONSTRAINT `fk_3_vtiger_datashare_grp2rs` FOREIGN KEY (`to_roleandsubid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_datashare_grp2us` (
  `shareid` int(10) NOT NULL,
  `share_groupid` int(10) DEFAULT NULL,
  `to_userid` int(10) DEFAULT NULL,
  `permission` int(10) DEFAULT NULL,
  PRIMARY KEY (`shareid`),
  KEY `datashare_grp2us_share_groupid_idx` (`share_groupid`),
  KEY `datashare_grp2us_to_userid_idx` (`to_userid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_datashare_module_rel` (
  `shareid` int(10) NOT NULL AUTO_INCREMENT,
  `tabid` smallint(5) NOT NULL,
  `relationtype` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`shareid`),
  KEY `idx_datashare_module_rel_tabid` (`tabid`),
  CONSTRAINT `fk_1_vtiger_datashare_module_rel` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_datashare_relatedmodule_permission` (
  `shareid` int(10) NOT NULL,
  `datashare_relatedmodule_id` int(10) NOT NULL,
  `permission` int(10) DEFAULT NULL,
  PRIMARY KEY (`shareid`,`datashare_relatedmodule_id`),
  KEY `datashare_relatedmodule_permission_shareid_permissions_idx` (`shareid`,`permission`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_datashare_relatedmodules` (
  `datashare_relatedmodule_id` int(10) NOT NULL,
  `tabid` smallint(5) DEFAULT NULL,
  `relatedto_tabid` int(10) DEFAULT NULL,
  PRIMARY KEY (`datashare_relatedmodule_id`),
  KEY `datashare_relatedmodules_tabid_idx` (`tabid`),
  KEY `datashare_relatedmodules_relatedto_tabid_idx` (`relatedto_tabid`),
  CONSTRAINT `fk_2_vtiger_datashare_relatedmodules` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_datashare_relatedmodules_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_datashare_role2group` (
  `shareid` int(10) NOT NULL,
  `share_roleid` varchar(255) DEFAULT NULL,
  `to_groupid` int(10) DEFAULT NULL,
  `permission` int(10) DEFAULT NULL,
  PRIMARY KEY (`shareid`),
  KEY `idx_datashare_role2group_share_roleid` (`share_roleid`),
  KEY `idx_datashare_role2group_to_groupid` (`to_groupid`),
  CONSTRAINT `fk_3_vtiger_datashare_role2group` FOREIGN KEY (`share_roleid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_datashare_role2role` (
  `shareid` int(10) NOT NULL,
  `share_roleid` varchar(255) DEFAULT NULL,
  `to_roleid` varchar(255) DEFAULT NULL,
  `permission` int(10) DEFAULT NULL,
  PRIMARY KEY (`shareid`),
  KEY `datashare_role2role_share_roleid_idx` (`share_roleid`),
  KEY `datashare_role2role_to_roleid_idx` (`to_roleid`),
  CONSTRAINT `fk_3_vtiger_datashare_role2role` FOREIGN KEY (`to_roleid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_datashare_role2rs` (
  `shareid` int(10) NOT NULL,
  `share_roleid` varchar(255) DEFAULT NULL,
  `to_roleandsubid` varchar(255) DEFAULT NULL,
  `permission` int(10) DEFAULT NULL,
  PRIMARY KEY (`shareid`),
  KEY `datashare_role2s_share_roleid_idx` (`share_roleid`),
  KEY `datashare_role2s_to_roleandsubid_idx` (`to_roleandsubid`),
  CONSTRAINT `fk_3_vtiger_datashare_role2rs` FOREIGN KEY (`to_roleandsubid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_datashare_role2us` (
  `shareid` int(10) NOT NULL,
  `share_roleid` varchar(255) DEFAULT NULL,
  `to_userid` int(10) DEFAULT NULL,
  `permission` int(10) DEFAULT NULL,
  PRIMARY KEY (`shareid`),
  KEY `datashare_role2us_share_roleid_idx` (`share_roleid`),
  KEY `datashare_role2us_to_userid_idx` (`to_userid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_datashare_rs2grp` (
  `shareid` int(10) NOT NULL,
  `share_roleandsubid` varchar(255) DEFAULT NULL,
  `to_groupid` int(10) DEFAULT NULL,
  `permission` int(10) DEFAULT NULL,
  PRIMARY KEY (`shareid`),
  KEY `datashare_rs2grp_share_roleandsubid_idx` (`share_roleandsubid`),
  KEY `datashare_rs2grp_to_groupid_idx` (`to_groupid`),
  CONSTRAINT `fk_3_vtiger_datashare_rs2grp` FOREIGN KEY (`share_roleandsubid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_datashare_rs2role` (
  `shareid` int(10) NOT NULL,
  `share_roleandsubid` varchar(255) DEFAULT NULL,
  `to_roleid` varchar(255) DEFAULT NULL,
  `permission` int(10) DEFAULT NULL,
  PRIMARY KEY (`shareid`),
  KEY `datashare_rs2role_share_roleandsubid_idx` (`share_roleandsubid`),
  KEY `datashare_rs2role_to_roleid_idx` (`to_roleid`),
  CONSTRAINT `fk_3_vtiger_datashare_rs2role` FOREIGN KEY (`to_roleid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_datashare_rs2rs` (
  `shareid` int(10) NOT NULL,
  `share_roleandsubid` varchar(255) DEFAULT NULL,
  `to_roleandsubid` varchar(255) DEFAULT NULL,
  `permission` int(10) DEFAULT NULL,
  PRIMARY KEY (`shareid`),
  KEY `datashare_rs2rs_share_roleandsubid_idx` (`share_roleandsubid`),
  KEY `idx_datashare_rs2rs_to_roleandsubid_idx` (`to_roleandsubid`),
  CONSTRAINT `fk_3_vtiger_datashare_rs2rs` FOREIGN KEY (`to_roleandsubid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_datashare_rs2us` (
  `shareid` int(10) NOT NULL,
  `share_roleandsubid` varchar(255) DEFAULT NULL,
  `to_userid` int(10) DEFAULT NULL,
  `permission` int(10) DEFAULT NULL,
  PRIMARY KEY (`shareid`),
  KEY `datashare_rs2us_share_roleandsubid_idx` (`share_roleandsubid`),
  KEY `datashare_rs2us_to_userid_idx` (`to_userid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_datashare_us2grp` (
  `shareid` int(10) NOT NULL,
  `share_userid` int(10) DEFAULT NULL,
  `to_groupid` int(10) DEFAULT NULL,
  `permission` int(10) DEFAULT NULL,
  PRIMARY KEY (`shareid`),
  KEY `datashare_us2grp_share_userid_idx` (`share_userid`),
  KEY `datashare_us2grp_to_groupid_idx` (`to_groupid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_datashare_us2role` (
  `shareid` int(10) NOT NULL,
  `share_userid` int(10) DEFAULT NULL,
  `to_roleid` varchar(255) DEFAULT NULL,
  `permission` int(10) DEFAULT NULL,
  PRIMARY KEY (`shareid`),
  KEY `idx_datashare_us2role_share_userid` (`share_userid`),
  KEY `idx_datashare_us2role_to_roleid` (`to_roleid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_datashare_us2rs` (
  `shareid` int(10) NOT NULL,
  `share_userid` int(10) DEFAULT NULL,
  `to_roleandsubid` varchar(255) DEFAULT NULL,
  `permission` int(10) DEFAULT NULL,
  PRIMARY KEY (`shareid`),
  KEY `datashare_us2rs_share_userid_idx` (`share_userid`),
  KEY `datashare_us2rs_to_roleandsubid_idx` (`to_roleandsubid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_datashare_us2us` (
  `shareid` int(10) NOT NULL,
  `share_userid` int(10) DEFAULT NULL,
  `to_userid` int(10) DEFAULT NULL,
  `permission` int(10) DEFAULT NULL,
  PRIMARY KEY (`shareid`),
  KEY `datashare_us2us_share_userid_idx` (`share_userid`),
  KEY `datashare_us2us_to_userid_idx` (`to_userid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_date_format` (
  `date_formatid` int(10) NOT NULL AUTO_INCREMENT,
  `date_format` varchar(200) NOT NULL,
  `sortorderid` int(10) NOT NULL DEFAULT '0',
  `presence` int(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`date_formatid`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_date_format_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_dayoftheweek` (
  `dayoftheweekid` int(10) NOT NULL AUTO_INCREMENT,
  `dayoftheweek` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`dayoftheweekid`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_dayoftheweek_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ddo` (
  `ddoid` int(11) NOT NULL AUTO_INCREMENT,
  `ddo` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`ddoid`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_deducible` (
  `deducibleid` int(11) NOT NULL AUTO_INCREMENT,
  `deducible` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`deducibleid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_deducible2` (
  `deducible2id` int(11) NOT NULL AUTO_INCREMENT,
  `deducible2` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`deducible2id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_deducible3` (
  `deducible3id` int(11) NOT NULL AUTO_INCREMENT,
  `deducible3` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`deducible3id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_def_org_field` (
  `tabid` smallint(5) DEFAULT NULL,
  `fieldid` int(10) NOT NULL,
  `visible` int(10) DEFAULT NULL,
  `readonly` int(10) DEFAULT NULL,
  PRIMARY KEY (`fieldid`),
  KEY `def_org_field_tabid_fieldid_idx` (`tabid`,`fieldid`),
  KEY `def_org_field_tabid_idx` (`tabid`),
  KEY `def_org_field_visible_fieldid_idx` (`visible`,`fieldid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_def_org_share` (
  `ruleid` int(10) NOT NULL AUTO_INCREMENT,
  `tabid` smallint(5) NOT NULL,
  `permission` int(10) DEFAULT NULL,
  `editstatus` int(10) DEFAULT NULL,
  PRIMARY KEY (`ruleid`),
  KEY `fk_1_vtiger_def_org_share` (`permission`),
  CONSTRAINT `fk_1_vtiger_def_org_share` FOREIGN KEY (`permission`) REFERENCES `vtiger_org_share_action_mapping` (`share_action_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=142 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_default_record_view` (
  `default_record_viewid` int(10) NOT NULL AUTO_INCREMENT,
  `default_record_view` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`default_record_viewid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_default_record_view_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_defaultactivitytype` (
  `defaultactivitytypeid` int(10) NOT NULL AUTO_INCREMENT,
  `defaultactivitytype` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT '0',
  PRIMARY KEY (`defaultactivitytypeid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_defaultactivitytype_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_defaultcv` (
  `tabid` smallint(5) NOT NULL,
  `defaultviewname` varchar(50) NOT NULL,
  `query` text,
  PRIMARY KEY (`tabid`),
  CONSTRAINT `fk_1_vtiger_defaultcv` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_defaulteventstatus` (
  `defaulteventstatusid` int(10) NOT NULL AUTO_INCREMENT,
  `defaulteventstatus` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT '0',
  PRIMARY KEY (`defaulteventstatusid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_defaulteventstatus_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_demanda` (
  `demandaid` int(11) NOT NULL DEFAULT '0',
  `demanda` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `cliente` varchar(16) DEFAULT '',
  `siniestro` int(11) unsigned DEFAULT '0',
  `nombrecliente` int(11) unsigned DEFAULT '0',
  `fpresupuesto` date DEFAULT NULL,
  `ciaseguros` varchar(255) DEFAULT '',
  `rutciaseguros` varchar(16) DEFAULT '',
  `direccionciaseguros` varchar(59) DEFAULT '',
  `nropoliza` varchar(16) DEFAULT '',
  `fdenuncio` date DEFAULT NULL,
  `nrosiniestro` varchar(32) DEFAULT '',
  `entliquidadora` varchar(255) DEFAULT '',
  `frecinfliq` date DEFAULT NULL,
  `freccartares` date DEFAULT NULL,
  `estdem` varchar(255) DEFAULT '',
  `solcla` tinyint(1) DEFAULT '0',
  `fechsolcla` date DEFAULT NULL,
  `clauni` varchar(10) DEFAULT '',
  `fechreccla` date DEFAULT NULL,
  `valcla` varchar(255) DEFAULT '',
  `fecvalcla` date DEFAULT NULL,
  `mannot` tinyint(1) DEFAULT '0',
  `fecrecman` date DEFAULT NULL,
  `gestmandof` tinyint(1) DEFAULT '0',
  `fechgesmanof` date DEFAULT NULL,
  `estllam` varchar(255) DEFAULT '',
  `obs` varchar(25) DEFAULT '',
  `razllam` varchar(255) DEFAULT '',
  `fechllam` date DEFAULT NULL,
  `reccla` tinyint(1) DEFAULT '0',
  `demingr` tinyint(1) DEFAULT '0',
  `certdem` tinyint(1) DEFAULT '0',
  `casa` tinyint(1) DEFAULT '0',
  `resaudnoof` tinyint(1) DEFAULT '0',
  `resaudnoas` tinyint(1) DEFAULT '0',
  `etadis` tinyint(1) DEFAULT '0',
  `autpru` tinyint(1) DEFAULT '0',
  `sentac` tinyint(1) DEFAULT '0',
  `sentacpar` tinyint(1) DEFAULT '0',
  `sentrech` tinyint(1) DEFAULT '0',
  `apelcom` tinyint(1) DEFAULT '0',
  `apelamacpa` tinyint(1) DEFAULT '0',
  `apelpracpar` tinyint(1) DEFAULT '0',
  `cascerrac` tinyint(1) DEFAULT '0',
  `movil` text,
  `inf_caso` int(11) unsigned DEFAULT '0',
  `ncaso` text,
  PRIMARY KEY (`demandaid`),
  KEY `vtiger_demanda_siniestro_idx` (`siniestro`),
  KEY `vtiger_demanda_nombrecliente_idx` (`nombrecliente`),
  KEY `vtiger_demanda_inf_caso_idx` (`inf_caso`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_demanda_inventory` (
  `id` int(11) DEFAULT NULL,
  `seq` int(10) DEFAULT NULL,
  KEY `demanda_inventory_idx` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_demanda_invfield` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `columnname` varchar(30) NOT NULL,
  `label` varchar(50) NOT NULL,
  `invtype` varchar(30) NOT NULL,
  `presence` smallint(1) unsigned NOT NULL DEFAULT '0',
  `defaultvalue` varchar(255) DEFAULT NULL,
  `sequence` int(10) unsigned NOT NULL,
  `block` smallint(1) unsigned NOT NULL,
  `displaytype` smallint(1) unsigned NOT NULL DEFAULT '1',
  `params` text,
  `colspan` smallint(1) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_demanda_invmap` (
  `module` varchar(50) NOT NULL,
  `field` varchar(50) NOT NULL,
  `tofield` varchar(50) NOT NULL,
  PRIMARY KEY (`module`,`field`,`tofield`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_demandacf` (
  `demandaid` int(11) NOT NULL DEFAULT '0',
  `cf_3980` int(11) unsigned DEFAULT '0',
  PRIMARY KEY (`demandaid`),
  KEY `vtiger_demandacf_cf_3980_idx` (`cf_3980`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_demandacobertura` (
  `demandacoberturaid` int(11) NOT NULL DEFAULT '0',
  `id` int(11) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `relsiniestro` int(11) unsigned DEFAULT '0',
  `siniestro` int(11) unsigned DEFAULT '0',
  `rut` varchar(15) DEFAULT '',
  `perddeterminadauf` decimal(10,2) DEFAULT NULL,
  `deducibleuf` decimal(8,2) DEFAULT NULL,
  `correo` varchar(25) DEFAULT '',
  `movil` varchar(15) DEFAULT '',
  `rol` varchar(25) DEFAULT '',
  `caratula` varchar(50) DEFAULT '',
  `perdreclamadauf` decimal(8,2) DEFAULT NULL,
  `valoruf` decimal(13,5) DEFAULT NULL,
  `perdindemnizableuff` decimal(8,2) DEFAULT NULL,
  `estdelcaso` varchar(30) DEFAULT '',
  `tribunalcompetente` varchar(255) DEFAULT '',
  `tribunalradicado` varchar(255) DEFAULT '',
  `estadodda` varchar(255) DEFAULT '',
  `bienesembargados` varchar(255) DEFAULT '',
  `cortecompetente` varchar(255) DEFAULT '',
  `rolrecursoqueja` varchar(30) DEFAULT '',
  `clasedeapelacion` varchar(255) DEFAULT '',
  `rolapelacion` varchar(30) DEFAULT '',
  `clasecasacion` varchar(255) DEFAULT '',
  `rolrecursocasacion` varchar(30) DEFAULT '',
  `rolrecursohecho` varchar(30) DEFAULT '',
  `formatoica` tinyint(1) DEFAULT '0',
  `generardda` tinyint(1) DEFAULT '0',
  `generarcumpleord` tinyint(1) DEFAULT '0',
  `generarart44` tinyint(1) DEFAULT '0',
  `generarformato` tinyint(1) DEFAULT '0',
  `generarautoprueba` tinyint(1) DEFAULT '0',
  `generaroirsentencia` tinyint(1) DEFAULT '0',
  `generarreposicion` tinyint(1) DEFAULT '0',
  `generarrepoyapela` tinyint(1) DEFAULT '0',
  `generarapela` tinyint(1) DEFAULT '0',
  `nombrereceptor` varchar(255) DEFAULT '',
  `comunacliente` varchar(255) DEFAULT '',
  `busquedanegativa` bigint(30) DEFAULT '0',
  `estadobusqueda` varchar(255) DEFAULT '',
  `not44` bigint(30) DEFAULT '0',
  `estadonot44` varchar(255) DEFAULT '',
  `notporcedula` bigint(30) DEFAULT '0',
  `estadonotcedula` varchar(255) DEFAULT '',
  `notificacionpersonal` bigint(30) DEFAULT '0',
  `estadonotpersonal` varchar(255) DEFAULT '',
  `embargo` bigint(30) DEFAULT '0',
  `estadoembargo` varchar(255) DEFAULT '',
  `preciobusqueda` bigint(30) DEFAULT '0',
  `precionotcedula` bigint(30) DEFAULT '0',
  `precionot44` bigint(30) DEFAULT '0',
  `precioembargo` bigint(30) DEFAULT '0',
  `precionotpersonal` bigint(30) DEFAULT '0',
  `totalapagar` bigint(30) DEFAULT '0',
  `pagar` tinyint(1) DEFAULT '0',
  `pagohistorico` bigint(30) DEFAULT '0',
  `informativoddapresentada` tinyint(1) DEFAULT '0',
  `fechainfddapresentada` date DEFAULT NULL,
  `ddapresentada` tinyint(1) DEFAULT '0',
  `fechaddapresentada` date DEFAULT NULL,
  `cert_pjudenv` tinyint(1) DEFAULT '0',
  `fech_envcertpjud` date DEFAULT NULL,
  `comuna` varchar(255) DEFAULT '',
  `idclientevd1` int(11) unsigned DEFAULT '0',
  `ddo` varchar(255) DEFAULT '',
  `rutcomp` varchar(255) DEFAULT '',
  `gestionespendientes` tinyint(1) DEFAULT '0',
  `tarea` text,
  `fechaaudcon` date DEFAULT NULL,
  `edocaupru` varchar(255) DEFAULT '',
  `fechanotcausapru` date DEFAULT NULL,
  `notext` tinyint(1) DEFAULT '0',
  `informativoddaprove` tinyint(1) DEFAULT '0',
  `informativoaud` tinyint(1) DEFAULT '0',
  `informativocausaprueba` tinyint(1) DEFAULT '0',
  `actualizar` tinyint(1) DEFAULT '0',
  `tribunal` varchar(255) DEFAULT '',
  `audcon` varchar(255) DEFAULT '',
  `cumpinc` tinyint(1) DEFAULT '0',
  `abogadoasignado` varchar(255) DEFAULT '',
  `mesasignacion` varchar(255) DEFAULT '',
  `tipo_demanda` varchar(255) DEFAULT '',
  `obs_llamada` text,
  `fechallama` date DEFAULT NULL,
  `tiposervicio` varchar(255) DEFAULT '',
  PRIMARY KEY (`demandacoberturaid`),
  KEY `vtiger_demandacobertura_relsiniestro_idx` (`relsiniestro`),
  KEY `vtiger_demandacobertura_siniestro_idx` (`siniestro`),
  KEY `vtiger_demandacobertura_idclientevd1_idx` (`idclientevd1`),
  CONSTRAINT `fk_1_vtiger_demandacoberturademandacoberturaid` FOREIGN KEY (`demandacoberturaid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_demandacoberturacf` (
  `demandacoberturaid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`demandacoberturaid`),
  CONSTRAINT `fk_1_vtiger_demandacoberturacfdemandacoberturaid` FOREIGN KEY (`demandacoberturaid`) REFERENCES `vtiger_demandacobertura` (`demandacoberturaid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_demandacobranzaclientes` (
  `demandacobranzaclientesid` int(11) NOT NULL,
  `id` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `correo` varchar(25) DEFAULT '',
  `direcnot` varchar(50) DEFAULT '',
  `montofact` bigint(20) DEFAULT '0',
  `indem` bigint(15) DEFAULT '0',
  `telefono` varchar(15) DEFAULT '',
  `rol` varchar(30) DEFAULT '',
  `caratula` varchar(40) DEFAULT '',
  `estadodda` varchar(255) DEFAULT '',
  `tribunalcompetente` varchar(255) DEFAULT '',
  `tribunalradicado` varchar(255) DEFAULT '',
  `generarformato` tinyint(1) DEFAULT '0',
  `genart44` tinyint(1) DEFAULT '0',
  `generargestprep` tinyint(1) DEFAULT '0',
  `generarcumpleord` tinyint(1) DEFAULT '0',
  `generarautoprueba` tinyint(1) DEFAULT '0',
  `generaroirsentencia` tinyint(1) DEFAULT '0',
  `generarreposicion` tinyint(1) DEFAULT '0',
  `generarrepoyapela` tinyint(1) DEFAULT '0',
  `generarapela` tinyint(1) DEFAULT '0',
  `estadocobranza` varchar(30) DEFAULT '',
  `ciudadnotificacion` varchar(30) DEFAULT '',
  `comuna` varchar(255) DEFAULT '',
  `actualizar` tinyint(1) DEFAULT '0',
  `nrocaso` int(11) unsigned DEFAULT '0',
  `rut` varchar(14) DEFAULT '',
  `generarddasinoposi` tinyint(1) DEFAULT '0',
  `generarddaconoposi` tinyint(1) DEFAULT '0',
  `preciobusquedas` bigint(15) DEFAULT '0',
  `precionotcedula` bigint(15) DEFAULT '0',
  `precionotpersonal` bigint(15) DEFAULT '0',
  `totaldeudasuscrip` bigint(15) DEFAULT '0',
  `totaldeudaasesoria` bigint(15) DEFAULT '0',
  `deudatotal` bigint(15) DEFAULT '0',
  `nrofacturasuscripcion` varchar(15) DEFAULT '',
  `fechafacturasus` date DEFAULT NULL,
  `fechavencimientofacturasus` date DEFAULT NULL,
  `nrofacturaasesoria` varchar(15) DEFAULT '',
  `fechafacturaasesoria` date DEFAULT NULL,
  `fechavencimientofacturaaseso` date DEFAULT NULL,
  `demandado` int(11) unsigned DEFAULT '0',
  `busquedanegativa` bigint(15) DEFAULT '0',
  `not44` bigint(15) DEFAULT '0',
  `notporcedula` bigint(15) DEFAULT '0',
  `notpersonal` bigint(15) DEFAULT '0',
  `precionot44` bigint(15) DEFAULT '0',
  `totalapagar` bigint(15) DEFAULT '0',
  `comunacliente` varchar(255) DEFAULT '',
  `relacioncobranza` int(11) NOT NULL,
  `idcobranzas` bigint(11) DEFAULT '0',
  `estadobusqueda` varchar(255) DEFAULT '',
  `estadonot44` varchar(255) DEFAULT '',
  `estadonotcedula` varchar(255) DEFAULT '',
  `estadonotpersonal` varchar(255) DEFAULT '',
  `pagar` tinyint(1) DEFAULT '0',
  `pagohistorico` bigint(20) DEFAULT '0',
  `bienesembargados` text,
  `precioembargo` bigint(20) DEFAULT '0',
  `estadoembargo` varchar(255) DEFAULT '',
  `nombrereceptord` varchar(255) DEFAULT '',
  `embargo` bigint(20) DEFAULT '0',
  `cortecompetente` varchar(255) DEFAULT '',
  `rolrecursohecho` varchar(45) DEFAULT '',
  `rolrecursoqueja` varchar(45) DEFAULT '',
  `clasecasacion` varchar(255) DEFAULT '',
  `rolrecursocasacion` varchar(45) DEFAULT '',
  `rolapelacion` varchar(45) DEFAULT '',
  `claseapelacion` varchar(255) DEFAULT '',
  `formatoica` tinyint(1) DEFAULT '0',
  `generargestprepsusas` tinyint(1) DEFAULT '0',
  `ddasinopsusas` tinyint(1) DEFAULT '0',
  `ddaconopsussas` tinyint(1) DEFAULT '0',
  `divisionempresa` varchar(255) DEFAULT '',
  `tipddacob` varchar(255) DEFAULT '',
  `etapacobam` varchar(255) DEFAULT '',
  `gabogados` tinyint(1) DEFAULT '0',
  `montogabogados` bigint(100) DEFAULT '0',
  `protesto` tinyint(1) DEFAULT '0',
  `mprotesto` bigint(100) DEFAULT '0',
  `cantidadnotenc` varchar(255) DEFAULT '',
  `valornot` bigint(100) DEFAULT '0',
  `montonot` bigint(100) DEFAULT '0',
  `correopreuno` tinyint(1) DEFAULT '0',
  `correopredos` tinyint(1) DEFAULT '0',
  `correopretres` tinyint(1) DEFAULT '0',
  `correojudicialunouno` tinyint(1) DEFAULT '0',
  `correojudicialunodos` tinyint(1) DEFAULT '0',
  `correojudicialtres` tinyint(1) DEFAULT '0',
  `correojudicialdosuno` tinyint(1) DEFAULT '0',
  `correojudicialdosdos` tinyint(1) DEFAULT '0',
  `correojudicialdostres` tinyint(1) DEFAULT '0',
  `gadmin` tinyint(1) DEFAULT '0',
  `montogadministrativos` bigint(100) DEFAULT '0',
  `fechanotdda` date DEFAULT NULL,
  `fechaaudprep` date DEFAULT NULL,
  `fechaaudcon` date DEFAULT NULL,
  `fechainiterpro` date DEFAULT NULL,
  `fechasentdef` date DEFAULT NULL,
  `valorplan` bigint(100) DEFAULT '0',
  `fechainicioetapados` date DEFAULT NULL,
  `fechainicioetapauno` date DEFAULT NULL,
  `fechainicioetapatres` date DEFAULT NULL,
  `valorplansus` bigint(100) DEFAULT '0',
  `valorabonosus` bigint(100) DEFAULT '0',
  `valorcuotaunosus` bigint(100) DEFAULT '0',
  `valorcuotadossus` bigint(100) DEFAULT '0',
  `abonopagadosus` tinyint(1) DEFAULT '0',
  `cuotaunopagadasus` tinyint(1) DEFAULT '0',
  `cuotadospagadasus` tinyint(1) DEFAULT '0',
  `estadopagohonorarios` varchar(255) DEFAULT '',
  `facturapagadasus` tinyint(1) DEFAULT '0',
  `facturapagadahon` tinyint(1) DEFAULT '0',
  `reajusteinteres` tinyint(1) DEFAULT '0',
  `montoreajusteinteres` bigint(100) DEFAULT '0',
  `montodeudatotal` bigint(100) DEFAULT '0',
  `obs` text,
  PRIMARY KEY (`demandacobranzaclientesid`),
  KEY `vtiger_demandacobranzaclientes_nrocaso_idx` (`nrocaso`),
  KEY `vtiger_demandacobranzaclientes_demandado_idx` (`demandado`),
  CONSTRAINT `fk_1_vtiger_demandacobranzaclientesdemandacobranzaclientesid` FOREIGN KEY (`demandacobranzaclientesid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_demandacobranzaclientes_inventory` (
  `id` int(11) DEFAULT NULL,
  `seq` int(10) DEFAULT NULL,
  KEY `demandacobranzaclientes_inventory_idx` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_demandacobranzaclientes_invfield` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `columnname` varchar(30) NOT NULL,
  `label` varchar(50) NOT NULL,
  `invtype` varchar(30) NOT NULL,
  `presence` smallint(1) unsigned NOT NULL DEFAULT '0',
  `defaultvalue` varchar(255) DEFAULT NULL,
  `sequence` int(10) unsigned NOT NULL,
  `block` smallint(1) unsigned NOT NULL,
  `displaytype` smallint(1) unsigned NOT NULL DEFAULT '1',
  `params` text,
  `colspan` smallint(1) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_demandacobranzaclientes_invmap` (
  `module` varchar(50) NOT NULL,
  `field` varchar(50) NOT NULL,
  `tofield` varchar(50) NOT NULL,
  PRIMARY KEY (`module`,`field`,`tofield`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_demandacobranzaclientescf` (
  `demandacobranzaclientesid` int(11) NOT NULL,
  PRIMARY KEY (`demandacobranzaclientesid`),
  CONSTRAINT `fk_1_vtiger_demandacobranzaclientescfdemandacobranzaclientesid` FOREIGN KEY (`demandacobranzaclientesid`) REFERENCES `vtiger_demandacobranzaclientes` (`demandacobranzaclientesid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_demandacolectiva` (
  `demandacolectivaid` int(11) NOT NULL,
  `demandacolectiva` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `idcliente` int(11) unsigned DEFAULT '0',
  `idsiniestro` int(11) unsigned DEFAULT '0',
  `movil` varchar(20) DEFAULT '',
  `email` varchar(30) DEFAULT '',
  `contratofirmado` tinyint(1) DEFAULT '0',
  `descargadoc` varchar(255) DEFAULT '',
  `fcontratofirmado` date DEFAULT NULL,
  PRIMARY KEY (`demandacolectivaid`),
  KEY `vtiger_demandacolectiva_idcliente_idx` (`idcliente`),
  KEY `vtiger_demandacolectiva_idsiniestro_idx` (`idsiniestro`),
  CONSTRAINT `fk_1_vtiger_demandacolectivademandacolectivaid` FOREIGN KEY (`demandacolectivaid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_demandacolectivacf` (
  `demandacolectivaid` int(11) NOT NULL,
  PRIMARY KEY (`demandacolectivaid`),
  CONSTRAINT `fk_1_vtiger_demandacolectivacfdemandacolectivaid` FOREIGN KEY (`demandacolectivaid`) REFERENCES `vtiger_demandacolectiva` (`demandacolectivaid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_demandacomercial` (
  `demandacomercialid` int(11) NOT NULL DEFAULT '0',
  `id` int(11) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `siniestro` int(11) unsigned DEFAULT '0',
  `inf_dda_presentada` tinyint(1) DEFAULT '0',
  `fecha_inf_dda_presentada` date DEFAULT NULL,
  `cert_pjudenv` tinyint(1) DEFAULT '0',
  `fech_envcertpjud` date DEFAULT NULL,
  `rol` varchar(15) DEFAULT '',
  `caratula` varchar(150) DEFAULT '',
  `dda_presentada` tinyint(1) DEFAULT '0',
  `fech_dda_presentada` varchar(50) DEFAULT NULL,
  `rut` varchar(15) DEFAULT '',
  `relgestcom` int(11) unsigned DEFAULT '0',
  `tribunalcompetente` varchar(255) DEFAULT '',
  `tribunalradicado` varchar(255) DEFAULT '',
  `estadodda` varchar(255) DEFAULT '',
  `bienesembargados` varchar(255) DEFAULT '',
  `cortecompetente` varchar(255) DEFAULT '',
  `rolrecursoqueja` varchar(30) DEFAULT '',
  `clasedeapelacion` varchar(255) DEFAULT '',
  `rolapelacion` varchar(30) DEFAULT '',
  `clasecasacion` varchar(255) DEFAULT '',
  `rolrecursocasacion` varchar(20) DEFAULT '',
  `rolrecursohecho` varchar(30) DEFAULT '',
  `generardda` tinyint(1) DEFAULT '0',
  `generarcumpleord` tinyint(1) DEFAULT '0',
  `genart44` tinyint(1) DEFAULT '0',
  `generarformato` tinyint(1) DEFAULT '0',
  `generarautoprueba` tinyint(1) DEFAULT '0',
  `generaroirsentencia` tinyint(1) DEFAULT '0',
  `generarreposicion` tinyint(1) DEFAULT '0',
  `generarrepoyapela` tinyint(1) DEFAULT '0',
  `generarapela` tinyint(1) DEFAULT '0',
  `formatoica` tinyint(1) DEFAULT '0',
  `relacionventaddas` int(11) unsigned DEFAULT '0',
  `nombrereceptor` varchar(255) DEFAULT '',
  `busquedanegativa` bigint(30) DEFAULT '0',
  `estadobusqueda` varchar(255) DEFAULT '',
  `not44` bigint(30) DEFAULT '0',
  `estadonot44` varchar(255) DEFAULT '',
  `notporcedula` bigint(30) DEFAULT '0',
  `estadonotcedula` varchar(255) DEFAULT '',
  `notpersonal` bigint(30) DEFAULT '0',
  `estadonotpersonal` varchar(255) DEFAULT '',
  `embargo` bigint(30) DEFAULT '0',
  `estadoembargo` varchar(255) DEFAULT '',
  `preciobusqueda` bigint(30) DEFAULT '0',
  `precionotcedula` bigint(30) DEFAULT '0',
  `precionot44` bigint(30) DEFAULT '0',
  `precioembargo` bigint(30) DEFAULT '0',
  `precionotpersonal` bigint(30) DEFAULT '0',
  `totalapagar` bigint(30) DEFAULT '0',
  `pagar` tinyint(1) DEFAULT '0',
  `pagohistorico` bigint(30) DEFAULT '0',
  `comunacliente` varchar(255) DEFAULT '',
  `comuna` varchar(255) DEFAULT '',
  `demandadoid` int(11) unsigned DEFAULT '0',
  `correo` varchar(100) DEFAULT '',
  `movil` varchar(50) DEFAULT '',
  `ddo` varchar(255) DEFAULT '',
  `rutcomp` varchar(255) DEFAULT '',
  `tribunalradica` varchar(100) DEFAULT '',
  `gestionespendientes` tinyint(1) DEFAULT '0',
  `tarea` text,
  `actualizar` tinyint(1) DEFAULT '0',
  `ventadedemandasid` int(11) unsigned DEFAULT '0',
  `fechacuotaunopagada` date DEFAULT NULL,
  `tribunal` varchar(255) DEFAULT '',
  `abogadoasignado` varchar(255) DEFAULT '',
  `mesasignacion` varchar(255) DEFAULT '',
  `suscripcionddaid` int(11) unsigned DEFAULT '0',
  `tiposervicio` varchar(255) DEFAULT '',
  PRIMARY KEY (`demandacomercialid`),
  KEY `vtiger_demandacomercial_siniestro_idx` (`siniestro`),
  KEY `vtiger_demandacomercial_relgestcom_idx` (`relgestcom`),
  KEY `vtiger_demandacomercial_relacionventaddas_idx` (`relacionventaddas`),
  KEY `vtiger_demandacomercial_demandadoid_idx` (`demandadoid`),
  KEY `vtiger_demandacomercial_ventadedemandasid_idx` (`ventadedemandasid`),
  KEY `vtiger_demandacomercial_suscripcionddaid_idx` (`suscripcionddaid`),
  CONSTRAINT `fk_1_vtiger_demandacomercialdemandacomercialid` FOREIGN KEY (`demandacomercialid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_demandacomercial_inventory` (
  `id` int(11) DEFAULT NULL,
  `seq` int(10) DEFAULT NULL,
  KEY `demandacomercial_inventory_idx` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_demandacomercial_invfield` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `columnname` varchar(30) NOT NULL,
  `label` varchar(50) NOT NULL,
  `invtype` varchar(30) NOT NULL,
  `presence` smallint(1) unsigned NOT NULL DEFAULT '0',
  `defaultvalue` varchar(255) DEFAULT NULL,
  `sequence` int(10) unsigned NOT NULL,
  `block` smallint(1) unsigned NOT NULL,
  `displaytype` smallint(1) unsigned NOT NULL DEFAULT '1',
  `params` text,
  `colspan` smallint(1) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_demandacomercial_invmap` (
  `module` varchar(50) NOT NULL,
  `field` varchar(50) NOT NULL,
  `tofield` varchar(50) NOT NULL,
  PRIMARY KEY (`module`,`field`,`tofield`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_demandacomercialcf` (
  `demandacomercialid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`demandacomercialid`),
  CONSTRAINT `fk_1_vtiger_demandacomercialcfdemandacomercialid` FOREIGN KEY (`demandacomercialid`) REFERENCES `vtiger_demandacomercial` (`demandacomercialid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_departamento` (
  `departamentoid` int(11) NOT NULL AUTO_INCREMENT,
  `departamento` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` int(10) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`departamentoid`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_detactividad` (
  `detactividadid` int(11) NOT NULL AUTO_INCREMENT,
  `detactividad` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`detactividadid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_detallecobrosypagos` (
  `detallecobrosypagosid` int(11) NOT NULL,
  `id` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `concepto` varchar(100) DEFAULT '',
  `monto` decimal(16,8) DEFAULT NULL,
  `sinisestroid` int(11) unsigned DEFAULT '0',
  `clienteid` int(11) unsigned DEFAULT '0',
  PRIMARY KEY (`detallecobrosypagosid`),
  KEY `vtiger_detallecobrosypagos_sinisestroid_idx` (`sinisestroid`),
  KEY `vtiger_detallecobrosypagos_clienteid_idx` (`clienteid`),
  CONSTRAINT `fk_1_vtiger_detallecobrosypagosdetallecobrosypagosid` FOREIGN KEY (`detallecobrosypagosid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_detallecobrosypagoscf` (
  `detallecobrosypagosid` int(11) NOT NULL,
  PRIMARY KEY (`detallecobrosypagosid`),
  CONSTRAINT `fk_1_vtiger_detallecobrosypagoscfdetallecobrosypagosid` FOREIGN KEY (`detallecobrosypagosid`) REFERENCES `vtiger_detallecobrosypagos` (`detallecobrosypagosid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_deudabieninmueble1` (
  `deudabieninmueble1id` int(11) NOT NULL AUTO_INCREMENT,
  `deudabieninmueble1` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`deudabieninmueble1id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_deudainmueble2` (
  `deudainmueble2id` int(11) NOT NULL AUTO_INCREMENT,
  `deudainmueble2` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`deudainmueble2id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_diapago` (
  `diapagoid` int(11) NOT NULL AUTO_INCREMENT,
  `diapago` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`diapagoid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_diasdisppre` (
  `diasdisppreid` int(11) NOT NULL AUTO_INCREMENT,
  `diasdisppre` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` int(10) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`diasdisppreid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_diaspago` (
  `diaspagoid` int(11) NOT NULL AUTO_INCREMENT,
  `diaspago` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`diaspagoid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_direccionciaseguros` (
  `direccionciasegurosid` int(11) NOT NULL AUTO_INCREMENT,
  `direccionciaseguros` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`direccionciasegurosid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_divisionempresa` (
  `divisionempresaid` int(11) NOT NULL AUTO_INCREMENT,
  `divisionempresa` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`divisionempresaid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_duration_minutes` (
  `minutesid` int(10) NOT NULL AUTO_INCREMENT,
  `duration_minutes` varchar(200) NOT NULL,
  `sortorderid` int(10) NOT NULL DEFAULT '0',
  `presence` int(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`minutesid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_duration_minutes_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_durationhrs` (
  `hrsid` int(10) NOT NULL AUTO_INCREMENT,
  `hrs` varchar(50) DEFAULT NULL,
  `sortorderid` int(10) NOT NULL DEFAULT '0',
  `presence` int(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`hrsid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_durationmins` (
  `minsid` int(10) NOT NULL AUTO_INCREMENT,
  `mins` varchar(50) DEFAULT NULL,
  `sortorderid` int(10) NOT NULL DEFAULT '0',
  `presence` int(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`minsid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_edoasesoria` (
  `edoasesoriaid` int(11) NOT NULL AUTO_INCREMENT,
  `edoasesoria` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`edoasesoriaid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_edocaso` (
  `edocasoid` int(11) NOT NULL AUTO_INCREMENT,
  `edocaso` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`edocasoid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_edocaupru` (
  `edocaupruid` int(11) NOT NULL AUTO_INCREMENT,
  `edocaupru` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`edocaupruid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_edocivil` (
  `edocivilid` int(11) NOT NULL AUTO_INCREMENT,
  `edocivil` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`edocivilid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_edocomercialasesor` (
  `edocomercialasesorid` int(11) NOT NULL AUTO_INCREMENT,
  `edocomercialasesor` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`edocomercialasesorid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_edocontacto` (
  `edocontactoid` int(11) NOT NULL AUTO_INCREMENT,
  `edocontacto` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`edocontactoid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_edocredito` (
  `edocreditoid` int(11) NOT NULL AUTO_INCREMENT,
  `edocredito` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`edocreditoid`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_edoef1` (
  `edoef1id` int(11) NOT NULL AUTO_INCREMENT,
  `edoef1` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`edoef1id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_edogestion` (
  `edogestionid` int(11) NOT NULL AUTO_INCREMENT,
  `edogestion` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`edogestionid`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_edosolcredito` (
  `edosolcreditoid` int(11) NOT NULL AUTO_INCREMENT,
  `edosolcredito` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`edosolcreditoid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_edosolicitud` (
  `edosolicitudid` int(11) NOT NULL AUTO_INCREMENT,
  `edosolicitud` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`edosolicitudid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_email_template_priority` (
  `email_template_priorityid` int(10) NOT NULL AUTO_INCREMENT,
  `email_template_priority` tinyint(1) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`email_template_priorityid`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_email_template_type` (
  `email_template_typeid` int(10) NOT NULL AUTO_INCREMENT,
  `email_template_type` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`email_template_typeid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_employee_education` (
  `employee_educationid` int(10) NOT NULL AUTO_INCREMENT,
  `employee_education` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT '0',
  PRIMARY KEY (`employee_educationid`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_employee_education_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_employee_status` (
  `employee_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `employee_status` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT '0',
  PRIMARY KEY (`employee_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_employee_status_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_end_hour` (
  `end_hourid` int(10) NOT NULL AUTO_INCREMENT,
  `end_hour` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`end_hourid`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_end_hour_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ente` (
  `enteid` int(11) NOT NULL AUTO_INCREMENT,
  `ente` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`enteid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_entfinanciera1` (
  `entfinanciera1id` int(11) NOT NULL AUTO_INCREMENT,
  `entfinanciera1` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`entfinanciera1id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_entity_stats` (
  `crmid` int(10) NOT NULL,
  `crmactivity` smallint(5) DEFAULT NULL,
  PRIMARY KEY (`crmid`),
  CONSTRAINT `fk_1_vtiger_entity_stats` FOREIGN KEY (`crmid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_entityname` (
  `tabid` smallint(5) NOT NULL DEFAULT '0',
  `modulename` varchar(25) NOT NULL,
  `tablename` varchar(50) NOT NULL,
  `fieldname` varchar(100) NOT NULL,
  `entityidfield` varchar(30) NOT NULL,
  `entityidcolumn` varchar(30) NOT NULL,
  `searchcolumn` varchar(150) NOT NULL,
  `turn_off` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `sequence` smallint(3) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`tabid`),
  KEY `turn_off` (`turn_off`),
  CONSTRAINT `fk_1_vtiger_entityname` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_entliquidadora` (
  `entliquidadoraid` int(11) NOT NULL AUTO_INCREMENT,
  `entliquidadora` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`entliquidadoraid`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_est_liq` (
  `est_liqid` int(11) NOT NULL AUTO_INCREMENT,
  `est_liq` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`est_liqid`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estado` (
  `estadoid` int(11) NOT NULL AUTO_INCREMENT,
  `estado` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadoid`)
) ENGINE=InnoDB AUTO_INCREMENT=151 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estado_` (
  `estado_id` int(11) NOT NULL AUTO_INCREMENT,
  `estado_` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estado_id`)
) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadobusqueda` (
  `estadobusquedaid` int(11) NOT NULL AUTO_INCREMENT,
  `estadobusqueda` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadobusquedaid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadocomercialdda` (
  `estadocomercialddaid` int(11) NOT NULL AUTO_INCREMENT,
  `estadocomercialdda` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadocomercialddaid`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadoconvenio` (
  `estadoconvenioid` int(11) NOT NULL AUTO_INCREMENT,
  `estadoconvenio` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadoconvenioid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadocorreo` (
  `estadocorreoid` int(11) NOT NULL AUTO_INCREMENT,
  `estadocorreo` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadocorreoid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadodda` (
  `estadoddaid` int(11) NOT NULL AUTO_INCREMENT,
  `estadodda` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadoddaid`)
) ENGINE=InnoDB AUTO_INCREMENT=65 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadoddadc` (
  `estadoddadcid` int(11) NOT NULL AUTO_INCREMENT,
  `estadoddadc` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadoddadcid`)
) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadodellead` (
  `estadodelleadid` int(11) NOT NULL AUTO_INCREMENT,
  `estadodellead` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadodelleadid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadoembargo` (
  `estadoembargoid` int(11) NOT NULL AUTO_INCREMENT,
  `estadoembargo` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadoembargoid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadogc` (
  `estadogcid` int(11) NOT NULL AUTO_INCREMENT,
  `estadogc` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadogcid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadolead` (
  `estadoleadid` int(11) NOT NULL AUTO_INCREMENT,
  `estadolead` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadoleadid`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadollamada` (
  `estadollamadaid` int(11) NOT NULL AUTO_INCREMENT,
  `estadollamada` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadollamadaid`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadollamadados` (
  `estadollamadadosid` int(11) NOT NULL AUTO_INCREMENT,
  `estadollamadados` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadollamadadosid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadollamadatres` (
  `estadollamadatresid` int(11) NOT NULL AUTO_INCREMENT,
  `estadollamadatres` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadollamadatresid`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadollamadauno` (
  `estadollamadaunoid` int(11) NOT NULL AUTO_INCREMENT,
  `estadollamadauno` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadollamadaunoid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadonot44` (
  `estadonot44id` int(11) NOT NULL AUTO_INCREMENT,
  `estadonot44` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadonot44id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadonotcedula` (
  `estadonotcedulaid` int(11) NOT NULL AUTO_INCREMENT,
  `estadonotcedula` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadonotcedulaid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadonotpersonal` (
  `estadonotpersonalid` int(11) NOT NULL AUTO_INCREMENT,
  `estadonotpersonal` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadonotpersonalid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadopac` (
  `estadopacid` int(11) NOT NULL AUTO_INCREMENT,
  `estadopac` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadopacid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadopagohonorarios` (
  `estadopagohonorariosid` int(11) NOT NULL AUTO_INCREMENT,
  `estadopagohonorarios` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadopagohonorariosid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadopreaprobacion` (
  `estadopreaprobacionid` int(11) NOT NULL AUTO_INCREMENT,
  `estadopreaprobacion` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadopreaprobacionid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadoprogreso` (
  `estadoprogresoid` int(11) NOT NULL AUTO_INCREMENT,
  `estadoprogreso` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadoprogresoid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadoreprogramacion` (
  `estadoreprogramacionid` int(11) NOT NULL AUTO_INCREMENT,
  `estadoreprogramacion` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadoreprogramacionid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadossos` (
  `estadossosid` int(11) NOT NULL AUTO_INCREMENT,
  `estadossos` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadossosid`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadosus` (
  `estadosusid` int(11) NOT NULL AUTO_INCREMENT,
  `estadosus` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadosusid`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estadosuscripcion` (
  `estadosuscripcionid` int(11) NOT NULL AUTO_INCREMENT,
  `estadosuscripcion` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estadosuscripcionid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estudios` (
  `estudiosid` int(11) NOT NULL AUTO_INCREMENT,
  `estudios` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estudiosid`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_estudioscredito` (
  `estudioscreditoid` int(11) NOT NULL AUTO_INCREMENT,
  `estudioscredito` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`estudioscreditoid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_etapacobam` (
  `etapacobamid` int(11) NOT NULL AUTO_INCREMENT,
  `etapacobam` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`etapacobamid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_evalasignado` (
  `evalasignadoid` int(11) NOT NULL AUTO_INCREMENT,
  `evalasignado` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`evalasignadoid`)
) ENGINE=InnoDB AUTO_INCREMENT=141 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_evalpreinsp` (
  `evalpreinspid` int(11) NOT NULL AUTO_INCREMENT,
  `evalpreinsp` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`evalpreinspid`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_evalreinspeccion` (
  `evalreinspeccionid` int(11) NOT NULL AUTO_INCREMENT,
  `evalreinspeccion` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`evalreinspeccionid`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_evapre` (
  `evapreid` int(11) NOT NULL AUTO_INCREMENT,
  `evapre` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`evapreid`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_eventhandlers` (
  `eventhandler_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `event_name` varchar(50) NOT NULL,
  `handler_class` varchar(100) NOT NULL,
  `is_active` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `include_modules` varchar(255) NOT NULL DEFAULT '',
  `exclude_modules` varchar(255) NOT NULL DEFAULT '',
  `priority` tinyint(1) unsigned NOT NULL DEFAULT '5',
  `owner_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`eventhandler_id`),
  KEY `event_name_class` (`event_name`,`handler_class`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_eventstatus` (
  `eventstatusid` int(10) NOT NULL AUTO_INCREMENT,
  `eventstatus` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT NULL,
  PRIMARY KEY (`eventstatusid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_eventstatus_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_expectedresponse` (
  `expectedresponseid` int(10) NOT NULL AUTO_INCREMENT,
  `expectedresponse` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT NULL,
  PRIMARY KEY (`expectedresponseid`),
  UNIQUE KEY `CampaignExpRes_UK01` (`expectedresponse`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_expectedresponse_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_faq` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `faq_no` varchar(100) NOT NULL,
  `product_id` varchar(100) DEFAULT NULL,
  `question` text,
  `answer` text,
  `category` varchar(200) NOT NULL,
  `status` varchar(200) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `faq_id_idx` (`id`),
  CONSTRAINT `fk_1_vtiger_faq` FOREIGN KEY (`id`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_faqcategories` (
  `faqcategories_id` int(10) NOT NULL AUTO_INCREMENT,
  `faqcategories` varchar(200) DEFAULT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT NULL,
  PRIMARY KEY (`faqcategories_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_faqcategories_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_faqcf` (
  `faqid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`faqid`),
  CONSTRAINT `fk_1_vtiger_faqcf` FOREIGN KEY (`faqid`) REFERENCES `vtiger_faq` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_faqcomments` (
  `commentid` int(10) NOT NULL AUTO_INCREMENT,
  `faqid` int(10) DEFAULT NULL,
  `comments` text,
  `createdtime` datetime NOT NULL,
  PRIMARY KEY (`commentid`),
  KEY `faqcomments_faqid_idx` (`faqid`),
  CONSTRAINT `fk_1_vtiger_faqcomments` FOREIGN KEY (`faqid`) REFERENCES `vtiger_faq` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_faqstatus` (
  `faqstatus_id` int(10) NOT NULL AUTO_INCREMENT,
  `faqstatus` varchar(200) DEFAULT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT NULL,
  PRIMARY KEY (`faqstatus_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_faqstatus_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_fcorectinginvoice_formpayment` (
  `fcorectinginvoice_formpaymentid` int(10) NOT NULL AUTO_INCREMENT,
  `fcorectinginvoice_formpayment` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT '0',
  PRIMARY KEY (`fcorectinginvoice_formpaymentid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_fcorectinginvoice_status` (
  `fcorectinginvoice_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `fcorectinginvoice_status` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT '0',
  PRIMARY KEY (`fcorectinginvoice_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_fechaaudpend` (
  `fechaaudpendid` int(11) NOT NULL AUTO_INCREMENT,
  `fechaaudpend` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`fechaaudpendid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_feedback` (
  `userid` int(10) DEFAULT NULL,
  `dontshow` varchar(19) DEFAULT 'false'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_field` (
  `tabid` smallint(5) NOT NULL,
  `fieldid` int(10) NOT NULL AUTO_INCREMENT,
  `columnname` varchar(30) NOT NULL,
  `tablename` varchar(50) NOT NULL,
  `generatedtype` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `uitype` smallint(5) unsigned NOT NULL,
  `fieldname` varchar(50) NOT NULL,
  `fieldlabel` varchar(50) NOT NULL,
  `readonly` tinyint(1) unsigned NOT NULL,
  `presence` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `defaultvalue` text,
  `maximumlength` smallint(5) unsigned NOT NULL,
  `sequence` smallint(5) unsigned NOT NULL,
  `block` int(10) DEFAULT NULL,
  `displaytype` tinyint(1) unsigned NOT NULL,
  `typeofdata` varchar(100) DEFAULT NULL,
  `quickcreate` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `quickcreatesequence` int(10) DEFAULT NULL,
  `info_type` varchar(20) DEFAULT NULL,
  `masseditable` int(10) NOT NULL DEFAULT '1',
  `helpinfo` varchar(30) DEFAULT '',
  `summaryfield` int(10) NOT NULL DEFAULT '0',
  `fieldparams` varchar(255) DEFAULT '',
  `header_field` varchar(15) DEFAULT NULL,
  `maxlengthtext` smallint(3) unsigned DEFAULT '0',
  `maxwidthcolumn` smallint(3) unsigned DEFAULT '0',
  PRIMARY KEY (`fieldid`),
  KEY `field_tabid_idx` (`tabid`),
  KEY `field_fieldname_idx` (`fieldname`),
  KEY `field_block_idx` (`block`),
  KEY `field_displaytype_idx` (`displaytype`),
  KEY `tabid` (`tabid`,`tablename`),
  KEY `quickcreate` (`quickcreate`),
  KEY `presence` (`presence`),
  KEY `tabid_2` (`tabid`,`fieldname`),
  KEY `tabid_3` (`tabid`,`block`),
  CONSTRAINT `fk_1_vtiger_field` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5810 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_field_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_fieldmodulerel` (
  `fieldid` smallint(5) unsigned NOT NULL,
  `module` varchar(25) NOT NULL,
  `relmodule` varchar(25) NOT NULL,
  `status` varchar(10) DEFAULT NULL,
  `sequence` tinyint(1) unsigned DEFAULT '0',
  KEY `fieldid` (`fieldid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_finvoice_formpayment` (
  `finvoice_formpaymentid` int(10) NOT NULL AUTO_INCREMENT,
  `finvoice_formpayment` varchar(200) NOT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` smallint(5) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`finvoice_formpaymentid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_finvoice_paymentstatus` (
  `finvoice_paymentstatusid` int(10) NOT NULL AUTO_INCREMENT,
  `finvoice_paymentstatus` varchar(200) NOT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` smallint(5) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`finvoice_paymentstatusid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_finvoice_status` (
  `finvoice_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `finvoice_status` varchar(200) NOT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` smallint(5) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`finvoice_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_finvoice_type` (
  `finvoice_typeid` int(10) NOT NULL AUTO_INCREMENT,
  `finvoice_type` varchar(200) NOT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` smallint(5) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`finvoice_typeid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_finvoicecost_formpayment` (
  `finvoicecost_formpaymentid` int(10) NOT NULL AUTO_INCREMENT,
  `finvoicecost_formpayment` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` smallint(5) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`finvoicecost_formpaymentid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_finvoicecost_paymentstatus` (
  `finvoicecost_paymentstatusid` int(10) NOT NULL AUTO_INCREMENT,
  `finvoicecost_paymentstatus` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` smallint(5) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`finvoicecost_paymentstatusid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_finvoicecost_status` (
  `finvoicecost_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `finvoicecost_status` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` smallint(5) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`finvoicecost_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_finvoiceproforma_formpayment` (
  `finvoiceproforma_formpaymentid` int(10) NOT NULL AUTO_INCREMENT,
  `finvoiceproforma_formpayment` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT '0',
  PRIMARY KEY (`finvoiceproforma_formpaymentid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_finvoiceproforma_status` (
  `finvoiceproforma_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `finvoiceproforma_status` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT '0',
  PRIMARY KEY (`finvoiceproforma_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_fixed_assets_fuel_type` (
  `fixed_assets_fuel_typeid` int(10) NOT NULL AUTO_INCREMENT,
  `fixed_assets_fuel_type` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`fixed_assets_fuel_typeid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_fixed_assets_status` (
  `fixed_assets_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `fixed_assets_status` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` smallint(5) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`fixed_assets_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_fixed_assets_type` (
  `fixed_assets_typeid` int(10) NOT NULL AUTO_INCREMENT,
  `fixed_assets_type` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` smallint(5) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`fixed_assets_typeid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_formadenuncia` (
  `formadenunciaid` int(11) NOT NULL AUTO_INCREMENT,
  `formadenuncia` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`formadenunciaid`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_fsismo` (
  `fsismoid` int(11) NOT NULL AUTO_INCREMENT,
  `fsismo` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`fsismoid`)
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_fsismo_nuevo` (
  `fsismo_nuevoid` int(11) NOT NULL AUTO_INCREMENT,
  `fsismo_nuevo` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`fsismo_nuevoid`)
) ENGINE=InnoDB AUTO_INCREMENT=95 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_fuente` (
  `fuenteid` int(11) NOT NULL AUTO_INCREMENT,
  `fuente` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`fuenteid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_gest_ext` (
  `gest_extid` int(11) NOT NULL AUTO_INCREMENT,
  `gest_ext` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`gest_extid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_gestcomdda` (
  `gestcomddaid` int(11) NOT NULL DEFAULT '0',
  `gestcomdda` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `nombre` varchar(59) DEFAULT '',
  `apellido` varchar(59) DEFAULT '',
  `cliente` varchar(59) DEFAULT '',
  `serienrodocto` varchar(59) DEFAULT '',
  `movil` varchar(30) DEFAULT '',
  `movil_extra` varchar(100) DEFAULT NULL,
  `tlfparticular` varchar(30) DEFAULT '',
  `tlfparticular_extra` varchar(100) DEFAULT NULL,
  `email` varchar(100) DEFAULT '',
  `observaciones` text,
  `edogestion` varchar(255) DEFAULT '',
  `llamada` varchar(255) DEFAULT '',
  `direccionsiniestro` text,
  `categorizacion` varchar(255) DEFAULT '',
  `perdidaindemnizable` decimal(62,2) DEFAULT NULL,
  `deducibleafecto` decimal(62,2) DEFAULT NULL,
  `perdidadeterminada` decimal(62,2) DEFAULT NULL,
  `pagoporcentaje` decimal(5,2) DEFAULT NULL,
  `fdenuncio` date DEFAULT NULL,
  `fvisita` date DEFAULT NULL,
  `fpresupuesto` date DEFAULT NULL,
  `frecinfliq` date DEFAULT NULL,
  `fimpugnacion` date DEFAULT NULL,
  `frespimpugnacion` date DEFAULT NULL,
  `fultgestion` date DEFAULT NULL,
  `notificacionemail` tinyint(1) DEFAULT '0',
  `notificacionrechazo` tinyint(1) DEFAULT '0',
  `notificacionaceptacion` tinyint(1) DEFAULT '0',
  `tlfotro` varchar(30) DEFAULT '',
  `tlfotro_extra` varchar(100) DEFAULT NULL,
  `mailotro` varchar(100) DEFAULT '',
  `siniestro` int(11) unsigned DEFAULT '0',
  `valor1cuota` bigint(59) DEFAULT '0',
  `valor2cuota` bigint(59) DEFAULT '0',
  `valor3cuota` bigint(59) DEFAULT '0',
  `1cuotapagada` tinyint(1) DEFAULT '0',
  `2cuotapagada` tinyint(1) DEFAULT '0',
  `3cuotapagada` tinyint(1) DEFAULT '0',
  `f1cuota` date DEFAULT NULL,
  `f2cuota` date DEFAULT NULL,
  `f3cuota` date DEFAULT NULL,
  `tiposiniestro` varchar(16) DEFAULT '',
  `comunacaso` varchar(16) DEFAULT '',
  `ciaseguros` varchar(16) DEFAULT '',
  `banco` varchar(32) DEFAULT '',
  `entliquidadora` varchar(32) DEFAULT '',
  `estado` varchar(32) DEFAULT '',
  `fsismo` varchar(32) DEFAULT '',
  `fvolverllamar` date DEFAULT NULL,
  `hvolverllamar` varchar(255) DEFAULT '',
  `obsllamada` text,
  `volverllamar` tinyint(1) DEFAULT '0',
  `modificardatos` tinyint(1) DEFAULT '0',
  `comentariomodificacion` text,
  `fcompromisocuota1` date DEFAULT NULL,
  `fcompromisocuota2` date DEFAULT NULL,
  `fcompromisocuota3` date DEFAULT NULL,
  `montopresupuesto` bigint(64) DEFAULT '0',
  `perdidadeterminadap` bigint(64) DEFAULT '0',
  `deducibleafectop` bigint(64) DEFAULT '0',
  `perdidaindemnizablep` bigint(64) DEFAULT '0',
  `dctosfirmados` tinyint(1) DEFAULT '0',
  `fcontratofirmado` date DEFAULT NULL,
  `comentariocontrato` text,
  `dctosdec` tinyint(1) DEFAULT '0',
  `montoporreclamarp` bigint(64) DEFAULT '0',
  `perdidareclamada` bigint(64) DEFAULT '0',
  `casorevisado` tinyint(1) DEFAULT '0',
  `costodemanda` bigint(32) DEFAULT '0',
  `abono` bigint(59) DEFAULT '0',
  `valorcuota` bigint(59) DEFAULT '0',
  `diapago` varchar(255) DEFAULT '',
  `fprimerpago` date DEFAULT NULL,
  `deudarestante` bigint(59) DEFAULT '0',
  `ciudadcaso` varchar(32) DEFAULT '',
  `nombrecliente` int(11) unsigned DEFAULT '0',
  `edocivil` varchar(255) DEFAULT '',
  `profesion` varchar(59) DEFAULT '',
  `abonopagado` tinyint(1) DEFAULT '0',
  `fabono` date DEFAULT NULL,
  `tpagoabono` varchar(255) DEFAULT '',
  `bdpago` varchar(255) DEFAULT '',
  `nrocuotasgd` varchar(255) DEFAULT '',
  `tpago1cuota` varchar(255) DEFAULT '',
  `tpago2cuota` varchar(255) DEFAULT '',
  `tpago3cuota` varchar(255) DEFAULT '',
  `bdpago1cuota` varchar(255) DEFAULT '',
  `bdpago3cuota` varchar(255) DEFAULT '',
  `bdpago2cuota` varchar(255) DEFAULT '',
  `fpagoabono` date DEFAULT NULL,
  `nfacabono` bigint(59) DEFAULT '0',
  `mailinformativo` tinyint(1) DEFAULT '0',
  `fabono0` date DEFAULT NULL,
  `nrofactura` bigint(59) DEFAULT '0',
  `ffactura` date DEFAULT NULL,
  `ffacturapagada` date DEFAULT NULL,
  `facturapagada` tinyint(1) DEFAULT '0',
  `fnegociacion` date DEFAULT NULL,
  `fdocdec` date DEFAULT NULL,
  `result` text,
  `presupuestomanual` tinyint(1) DEFAULT '0',
  `descmand` tinyint(1) DEFAULT '0',
  `mandatofirmado` tinyint(1) DEFAULT '0',
  `fmandatofirmado` date DEFAULT NULL,
  `codwebpayabono` bigint(12) DEFAULT '0',
  `codwebpaycuota1` bigint(12) DEFAULT '0',
  `codwebpaycuota2` bigint(12) DEFAULT '0',
  `codwebpaycuota3` bigint(12) DEFAULT '0',
  `tarjpagoabono` varchar(255) DEFAULT '',
  `tarjpagocuota1` varchar(255) DEFAULT '',
  `tarjpagocuota2` varchar(255) DEFAULT '',
  `tarjpagocuota3` varchar(255) DEFAULT '',
  `carta_demanda` tinyint(1) DEFAULT '0',
  `mail_firmas` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`gestcomddaid`),
  KEY `vtiger_gestcomdda_siniestro_idx` (`siniestro`),
  KEY `vtiger_gestcomdda_nombrecliente_idx` (`nombrecliente`),
  CONSTRAINT `fk_1_vtiger_gestcomddagestcomddaid` FOREIGN KEY (`gestcomddaid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_gestcomddacf` (
  `gestcomddaid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`gestcomddaid`),
  CONSTRAINT `fk_1_vtiger_gestcomddacfgestcomddaid` FOREIGN KEY (`gestcomddaid`) REFERENCES `vtiger_gestcomdda` (`gestcomddaid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_gestionadopor` (
  `gestionadoporid` int(11) NOT NULL AUTO_INCREMENT,
  `gestionadopor` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`gestionadoporid`)
) ENGINE=InnoDB AUTO_INCREMENT=49 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_gestionllamada` (
  `gestionllamadaid` int(11) NOT NULL DEFAULT '0',
  `telefono` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `llamada` varchar(255) DEFAULT '',
  `volverllamar` tinyint(1) DEFAULT '0',
  `edoasesoria` varchar(255) DEFAULT '',
  `fvolverllamar` date DEFAULT NULL,
  `hvolverllamar` varchar(255) DEFAULT '',
  `obsllamada` text,
  `nombres` varchar(59) DEFAULT '',
  `apellidos` varchar(59) DEFAULT '',
  `rut` varchar(16) DEFAULT '',
  `serienrodocto` varchar(16) DEFAULT '',
  `email` varchar(100) DEFAULT '',
  `otrotlf` varchar(30) DEFAULT '',
  `otrotlf_extra` varchar(100) DEFAULT NULL,
  `otroemail` varchar(100) DEFAULT '',
  `profesion` varchar(59) DEFAULT '',
  `edocivil` varchar(255) DEFAULT '',
  `obscliente` text,
  `quienrefirio` int(11) unsigned DEFAULT '0',
  `comunadelcliente` varchar(255) DEFAULT '',
  `provinciadelcliente` varchar(255) DEFAULT '',
  `regiondelcliente` varchar(255) DEFAULT '',
  `direccioncaso` text,
  `direccioncliente` text,
  `comunadelcaso` varchar(255) DEFAULT '',
  `provinciadelcaso` varchar(255) DEFAULT '',
  `regiondelcaso` varchar(255) DEFAULT '',
  `nacionalidad` varchar(255) DEFAULT '',
  `provienede` varchar(255) DEFAULT '',
  `telefono2` varchar(24) DEFAULT '',
  `telefono3` varchar(24) DEFAULT '',
  `fnacimiento` date DEFAULT NULL,
  `renta` bigint(24) DEFAULT '0',
  `tiposiniestro` varchar(255) DEFAULT '',
  `tipopropiedad` varchar(255) DEFAULT '',
  `banco` varchar(255) DEFAULT '',
  `ciaseguros` varchar(255) DEFAULT '',
  `mts2` decimal(27,2) DEFAULT NULL,
  `valoruf` bigint(12) DEFAULT '0',
  `diapago` varchar(255) DEFAULT '',
  `nrocaso` varchar(24) DEFAULT '',
  `valorplan` varchar(255) DEFAULT '',
  `metodopago` varchar(255) DEFAULT '',
  `motivorechazo` varchar(255) DEFAULT '',
  `otromotivo` text,
  `enviocorreopres` tinyint(1) DEFAULT '0',
  `fenviocorreopres` date DEFAULT NULL,
  `eliminarbd` tinyint(1) DEFAULT '0',
  `cantllamados` varchar(255) DEFAULT '',
  `resultgestion` varchar(255) DEFAULT '',
  PRIMARY KEY (`gestionllamadaid`),
  KEY `vtiger_gestionllamada_quienrefirio_idx` (`quienrefirio`),
  CONSTRAINT `fk_1_vtiger_gestionllamadagestionllamadaid` FOREIGN KEY (`gestionllamadaid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_gestionllamadacf` (
  `gestionllamadaid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`gestionllamadaid`),
  CONSTRAINT `fk_1_vtiger_gestionllamadacfgestionllamadaid` FOREIGN KEY (`gestionllamadaid`) REFERENCES `vtiger_gestionllamada` (`gestionllamadaid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_gestionrrss` (
  `gestionrrssid` int(11) NOT NULL DEFAULT '0',
  `nickname` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `fcontacto` date DEFAULT NULL,
  `canal` varchar(255) DEFAULT '',
  `edocontacto` varchar(255) DEFAULT '',
  `edocaso` varchar(255) DEFAULT '',
  `motivorechazo` varchar(255) DEFAULT '',
  `otro` varchar(24) DEFAULT '',
  `obscontacto` text,
  `obscaso` text,
  `movil` varchar(30) DEFAULT '',
  `movil_extra` varchar(100) DEFAULT NULL,
  `otrotlf` varchar(30) DEFAULT '',
  `otrotlf_extra` varchar(100) DEFAULT NULL,
  `nombres` varchar(24) DEFAULT '',
  `apellidos` varchar(24) DEFAULT '',
  `banco` varchar(255) DEFAULT '',
  `obsventa` text,
  `comunadelcaso` varchar(255) DEFAULT '',
  `provinciadelcaso` varchar(255) DEFAULT '',
  PRIMARY KEY (`gestionrrssid`),
  CONSTRAINT `fk_1_vtiger_gestionrrssgestionrrssid` FOREIGN KEY (`gestionrrssid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_gestionrrss_inventory` (
  `id` int(11) DEFAULT NULL,
  `seq` int(10) DEFAULT NULL,
  KEY `gestionrrss_inventory_idx` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_gestionrrss_invfield` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `columnname` varchar(30) NOT NULL,
  `label` varchar(50) NOT NULL,
  `invtype` varchar(30) NOT NULL,
  `presence` smallint(1) unsigned NOT NULL DEFAULT '0',
  `defaultvalue` varchar(255) DEFAULT NULL,
  `sequence` int(10) unsigned NOT NULL,
  `block` smallint(1) unsigned NOT NULL,
  `displaytype` smallint(1) unsigned NOT NULL DEFAULT '1',
  `params` text,
  `colspan` smallint(1) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_gestionrrss_invmap` (
  `module` varchar(50) NOT NULL,
  `field` varchar(50) NOT NULL,
  `tofield` varchar(50) NOT NULL,
  PRIMARY KEY (`module`,`field`,`tofield`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_gestionrrsscf` (
  `gestionrrssid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`gestionrrssid`),
  CONSTRAINT `fk_1_vtiger_gestionrrsscfgestionrrssid` FOREIGN KEY (`gestionrrssid`) REFERENCES `vtiger_gestionrrss` (`gestionrrssid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_glacct` (
  `glacctid` int(10) NOT NULL AUTO_INCREMENT,
  `glacct` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT NULL,
  PRIMARY KEY (`glacctid`),
  UNIQUE KEY `glacct_glacct_idx` (`glacct`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_glacct_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_group2grouprel` (
  `groupid` int(10) NOT NULL,
  `containsgroupid` int(10) unsigned NOT NULL,
  PRIMARY KEY (`groupid`,`containsgroupid`),
  KEY `containsgroupid` (`containsgroupid`),
  KEY `groupid` (`groupid`),
  CONSTRAINT `fk_2_vtiger_group2grouprel` FOREIGN KEY (`groupid`) REFERENCES `vtiger_groups` (`groupid`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_group2modules` (
  `groupid` int(10) NOT NULL,
  `tabid` smallint(5) NOT NULL,
  KEY `groupid` (`groupid`),
  KEY `tabid` (`tabid`),
  CONSTRAINT `vtiger_group2modules_ibfk_1` FOREIGN KEY (`groupid`) REFERENCES `vtiger_groups` (`groupid`) ON DELETE CASCADE,
  CONSTRAINT `vtiger_group2modules_ibfk_2` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_group2role` (
  `groupid` int(10) NOT NULL,
  `roleid` varchar(255) NOT NULL,
  PRIMARY KEY (`groupid`,`roleid`),
  KEY `fk_2_vtiger_group2role` (`roleid`),
  CONSTRAINT `fk_2_vtiger_group2role` FOREIGN KEY (`roleid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_group2rs` (
  `groupid` int(10) unsigned NOT NULL,
  `roleandsubid` varchar(255) NOT NULL,
  PRIMARY KEY (`groupid`,`roleandsubid`),
  KEY `fk_2_vtiger_group2rs` (`roleandsubid`),
  CONSTRAINT `fk_2_vtiger_group2rs` FOREIGN KEY (`roleandsubid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_groups` (
  `groupid` int(10) NOT NULL,
  `groupname` varchar(100) DEFAULT NULL,
  `description` text,
  `color` varchar(25) DEFAULT '#E6FAD8',
  `modules` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`groupid`),
  UNIQUE KEY `groups_groupname_idx` (`groupname`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_holidaysentitlement` (
  `holidaysentitlementid` int(10) NOT NULL DEFAULT '0',
  `holidaysentitlement_no` varchar(255) DEFAULT NULL,
  `holidaysentitlement_year` varchar(50) DEFAULT NULL,
  `days` int(3) DEFAULT '0',
  `ossemployeesid` int(10) DEFAULT NULL,
  PRIMARY KEY (`holidaysentitlementid`),
  KEY `ossemployeesid` (`ossemployeesid`),
  CONSTRAINT `fk_1_vtiger_holidaysentitlement` FOREIGN KEY (`holidaysentitlementid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_holidaysentitlement_year` (
  `holidaysentitlement_yearid` int(10) NOT NULL AUTO_INCREMENT,
  `holidaysentitlement_year` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT '0',
  PRIMARY KEY (`holidaysentitlement_yearid`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_holidaysentitlement_year_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_holidaysentitlementcf` (
  `holidaysentitlementid` int(10) NOT NULL,
  PRIMARY KEY (`holidaysentitlementid`),
  CONSTRAINT `fk_1_vtiger_holidaysentitlementcf` FOREIGN KEY (`holidaysentitlementid`) REFERENCES `vtiger_holidaysentitlement` (`holidaysentitlementid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_hour_format` (
  `hour_formatid` int(10) NOT NULL AUTO_INCREMENT,
  `hour_format` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT '0',
  PRIMARY KEY (`hour_formatid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_hour_format_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_hvolverllamar` (
  `hvolverllamarid` int(11) NOT NULL AUTO_INCREMENT,
  `hvolverllamar` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`hvolverllamarid`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ideas` (
  `ideasid` int(10) NOT NULL DEFAULT '0',
  `ideas_no` varchar(255) DEFAULT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `ideasstatus` varchar(255) DEFAULT '',
  `extent_description` text,
  PRIMARY KEY (`ideasid`),
  CONSTRAINT `fk_1_vtiger_ideas` FOREIGN KEY (`ideasid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ideascf` (
  `ideasid` int(10) NOT NULL,
  PRIMARY KEY (`ideasid`),
  CONSTRAINT `fk_1_vtiger_ideascf` FOREIGN KEY (`ideasid`) REFERENCES `vtiger_ideas` (`ideasid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ideasstatus` (
  `ideasstatusid` int(10) NOT NULL AUTO_INCREMENT,
  `ideasstatus` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT '0',
  PRIMARY KEY (`ideasstatusid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ideasstatus_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_igdn_status` (
  `igdn_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `igdn_status` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`igdn_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_igdnc_status` (
  `igdnc_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `igdnc_status` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`igdnc_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_igin_status` (
  `igin_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `igin_status` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`igin_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_igrn_status` (
  `igrn_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `igrn_status` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`igrn_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_igrnc_status` (
  `igrnc_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `igrnc_status` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`igrnc_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_iidn_status` (
  `iidn_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `iidn_status` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`iidn_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
