CREATE TABLE `vtiger_import_locks` (
  `vtiger_import_lock_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `userid` int(10) NOT NULL,
  `tabid` smallint(5) NOT NULL,
  `importid` int(10) NOT NULL,
  `locked_since` datetime DEFAULT NULL,
  PRIMARY KEY (`vtiger_import_lock_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_import_maps` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(36) NOT NULL,
  `module` varchar(36) NOT NULL,
  `content` longblob,
  `has_header` int(1) NOT NULL DEFAULT '1',
  `deleted` int(1) NOT NULL DEFAULT '0',
  `date_entered` timestamp NULL DEFAULT NULL,
  `date_modified` timestamp NULL DEFAULT NULL,
  `assigned_user_id` varchar(36) DEFAULT NULL,
  `is_published` varchar(3) NOT NULL DEFAULT 'no',
  PRIMARY KEY (`id`),
  KEY `import_maps_assigned_user_id_module_name_deleted_idx` (`assigned_user_id`,`module`,`name`,`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_import_queue` (
  `importid` int(10) NOT NULL AUTO_INCREMENT,
  `userid` int(10) NOT NULL,
  `tabid` smallint(5) unsigned NOT NULL,
  `field_mapping` text,
  `default_values` text,
  `merge_type` int(10) DEFAULT NULL,
  `merge_fields` text,
  `temp_status` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`importid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_industry` (
  `industryid` int(10) NOT NULL AUTO_INCREMENT,
  `industry` 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 (`industryid`),
  UNIQUE KEY `industry_industry_idx` (`industry`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_industry_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_internal_tickets_status` (
  `internal_tickets_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `internal_tickets_status` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` smallint(5) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`internal_tickets_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_inventory_tandc` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `type` varchar(30) NOT NULL,
  `tandc` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_inventoryproductrel` (
  `id` int(10) DEFAULT NULL,
  `productid` int(10) DEFAULT NULL,
  `sequence_no` int(4) DEFAULT NULL,
  `quantity` decimal(25,3) DEFAULT NULL,
  `listprice` decimal(28,8) DEFAULT NULL,
  `discount_percent` decimal(7,3) DEFAULT NULL,
  `discount_amount` decimal(28,8) DEFAULT NULL,
  `comment` varchar(500) DEFAULT NULL,
  `description` text,
  `incrementondel` int(10) NOT NULL DEFAULT '0',
  `lineitem_id` int(10) NOT NULL AUTO_INCREMENT,
  `tax` varchar(10) DEFAULT NULL,
  `tax1` decimal(7,3) DEFAULT NULL,
  `tax2` decimal(7,3) DEFAULT NULL,
  `tax3` decimal(7,3) DEFAULT NULL,
  `purchase` decimal(10,2) DEFAULT NULL,
  `margin` decimal(10,2) DEFAULT NULL,
  `marginp` decimal(10,2) DEFAULT NULL,
  PRIMARY KEY (`lineitem_id`),
  KEY `inventoryproductrel_id_idx` (`id`),
  KEY `inventoryproductrel_productid_idx` (`productid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_inventoryproductrel_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_inventorysubproductrel` (
  `id` int(10) NOT NULL,
  `sequence_no` int(10) NOT NULL,
  `productid` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ipreorder_status` (
  `ipreorder_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `ipreorder_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 (`ipreorder_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_istdn_status` (
  `istdn_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `istdn_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 (`istdn_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_istn_status` (
  `istn_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `istn_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 (`istn_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_istn_type` (
  `istn_typeid` int(10) NOT NULL AUTO_INCREMENT,
  `istn_type` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`istn_typeid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_istrn_status` (
  `istrn_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `istrn_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 (`istrn_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_knowledgebase_status` (
  `knowledgebase_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `knowledgebase_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 (`knowledgebase_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_knowledgebase_view` (
  `knowledgebase_viewid` int(10) NOT NULL AUTO_INCREMENT,
  `knowledgebase_view` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`knowledgebase_viewid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_language` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  `prefix` varchar(10) NOT NULL,
  `label` varchar(30) NOT NULL,
  `lastupdated` datetime DEFAULT NULL,
  `sequence` int(10) DEFAULT NULL,
  `isdefault` tinyint(1) NOT NULL DEFAULT '0',
  `active` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `prefix` (`prefix`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_language_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_layout` (
  `id` int(10) NOT NULL,
  `name` varchar(50) DEFAULT NULL,
  `label` varchar(30) DEFAULT NULL,
  `lastupdated` datetime DEFAULT NULL,
  `isdefault` tinyint(1) DEFAULT NULL,
  `active` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lead_view` (
  `lead_viewid` int(10) NOT NULL AUTO_INCREMENT,
  `lead_view` varchar(200) NOT NULL,
  `sortorderid` int(10) NOT NULL DEFAULT '0',
  `presence` int(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`lead_viewid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lead_view_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_leadaddress` (
  `leadaddressid` int(10) NOT NULL DEFAULT '0',
  `phone` varchar(50) DEFAULT NULL,
  `mobile` varchar(50) DEFAULT NULL,
  `fax` varchar(50) DEFAULT 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,
  `phone_extra` varchar(100) DEFAULT NULL,
  `mobile_extra` varchar(100) DEFAULT NULL,
  `fax_extra` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`leadaddressid`),
  CONSTRAINT `fk_1_vtiger_leadaddress` FOREIGN KEY (`leadaddressid`) REFERENCES `vtiger_leaddetails` (`leadid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_leaddetails` (
  `leadid` int(10) NOT NULL,
  `lead_no` varchar(100) NOT NULL,
  `email` varchar(100) DEFAULT NULL,
  `interest` varchar(50) DEFAULT NULL,
  `firstname` varchar(40) DEFAULT NULL,
  `salutation` varchar(200) DEFAULT NULL,
  `lastname` varchar(80) DEFAULT NULL,
  `company` varchar(100) NOT NULL,
  `annualrevenue` decimal(25,8) DEFAULT NULL,
  `industry` varchar(200) DEFAULT NULL,
  `campaign` varchar(30) DEFAULT NULL,
  `leadstatus` varchar(50) DEFAULT NULL,
  `leadsource` varchar(200) DEFAULT NULL,
  `converted` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `licencekeystatus` varchar(50) DEFAULT NULL,
  `space` varchar(250) DEFAULT NULL,
  `comments` text,
  `priority` varchar(50) DEFAULT NULL,
  `demorequest` varchar(50) DEFAULT NULL,
  `partnercontact` varchar(50) DEFAULT NULL,
  `productversion` varchar(20) DEFAULT NULL,
  `product` varchar(50) DEFAULT NULL,
  `maildate` date DEFAULT NULL,
  `nextstepdate` date DEFAULT NULL,
  `fundingsituation` varchar(50) DEFAULT NULL,
  `purpose` varchar(50) DEFAULT NULL,
  `evaluationstatus` varchar(50) DEFAULT NULL,
  `transferdate` date DEFAULT NULL,
  `revenuetype` varchar(50) DEFAULT NULL,
  `noofemployees` int(50) DEFAULT NULL,
  `secondaryemail` varchar(100) DEFAULT NULL,
  `assignleadchk` int(1) DEFAULT '0',
  `noapprovalcalls` smallint(1) DEFAULT NULL,
  `noapprovalemails` smallint(1) DEFAULT NULL,
  `vat_id` varchar(30) DEFAULT NULL,
  `registration_number_1` varchar(30) DEFAULT NULL,
  `registration_number_2` varchar(30) DEFAULT NULL,
  `verification` text,
  `subindustry` varchar(255) DEFAULT '',
  `atenttion` text,
  `leads_relation` varchar(255) DEFAULT NULL,
  `legal_form` varchar(255) DEFAULT NULL,
  `sum_time` decimal(10,2) DEFAULT '0.00',
  `active` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`leadid`),
  KEY `leaddetails_converted_leadstatus_idx` (`converted`,`leadstatus`),
  KEY `email_idx` (`email`),
  KEY `lastname` (`lastname`),
  KEY `converted` (`converted`),
  CONSTRAINT `fk_1_vtiger_leaddetails` FOREIGN KEY (`leadid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_leads_relation` (
  `leads_relationid` int(10) NOT NULL AUTO_INCREMENT,
  `leads_relation` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`leads_relationid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_leads_relation_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_leadscf` (
  `leadid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`leadid`),
  CONSTRAINT `fk_1_vtiger_leadscf` FOREIGN KEY (`leadid`) REFERENCES `vtiger_leaddetails` (`leadid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_leadsource` (
  `leadsourceid` int(10) NOT NULL AUTO_INCREMENT,
  `leadsource` 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 (`leadsourceid`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_leadsource_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_leadstage` (
  `leadstageid` int(10) NOT NULL AUTO_INCREMENT,
  `stage` varchar(200) NOT NULL,
  `sortorderid` int(10) NOT NULL DEFAULT '0',
  `presence` int(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`leadstageid`),
  UNIQUE KEY `leadstage_stage_idx` (`stage`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_leadstatus` (
  `leadstatusid` int(10) NOT NULL AUTO_INCREMENT,
  `leadstatus` 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 '#E6FAD8',
  PRIMARY KEY (`leadstatusid`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_leadstatus_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_leadsubdetails` (
  `leadsubscriptionid` int(10) NOT NULL DEFAULT '0',
  `website` varchar(255) DEFAULT NULL,
  `callornot` int(1) DEFAULT '0',
  `readornot` int(1) DEFAULT '0',
  `empct` int(10) DEFAULT '0',
  PRIMARY KEY (`leadsubscriptionid`),
  CONSTRAINT `fk_1_vtiger_leadsubdetails` FOREIGN KEY (`leadsubscriptionid`) REFERENCES `vtiger_leaddetails` (`leadid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_legal_form` (
  `legal_formid` int(10) NOT NULL AUTO_INCREMENT,
  `legal_form` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`legal_formid`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_legal_form_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lettersin` (
  `lettersinid` int(10) NOT NULL DEFAULT '0',
  `number` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `relatedid` int(10) DEFAULT NULL,
  `person_receiving` int(10) DEFAULT NULL,
  `parentid` int(10) DEFAULT NULL,
  `date_adoption` date DEFAULT NULL,
  `lin_type_ship` varchar(255) DEFAULT '',
  `lin_type_doc` text,
  `lin_status` varchar(255) DEFAULT '',
  `deadline_reply` date DEFAULT NULL,
  `cocument_no` varchar(100) DEFAULT '',
  `no_internal` varchar(100) DEFAULT '',
  `lin_dimensions` varchar(255) DEFAULT '',
  `custom_sender` varchar(255) DEFAULT NULL,
  `lin_type` varchar(255) DEFAULT NULL,
  `cash_amount_on_delivery` decimal(25,8) DEFAULT NULL,
  `date_of_receipt` date DEFAULT NULL,
  `outgoing_correspondence` int(10) DEFAULT NULL,
  PRIMARY KEY (`lettersinid`),
  KEY `vtiger_lettersin_outgoing_correspondence_idx` (`outgoing_correspondence`),
  CONSTRAINT `fk_1_vtiger_lettersin` FOREIGN KEY (`lettersinid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lettersincf` (
  `lettersinid` int(10) NOT NULL,
  `internal_notes` text,
  `public_notes` text,
  PRIMARY KEY (`lettersinid`),
  CONSTRAINT `fk_1_vtiger_lettersincf` FOREIGN KEY (`lettersinid`) REFERENCES `vtiger_lettersin` (`lettersinid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lettersout` (
  `lettersoutid` int(10) NOT NULL DEFAULT '0',
  `number` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `relatedid` int(10) DEFAULT NULL,
  `person_receiving` int(10) DEFAULT NULL,
  `parentid` int(10) DEFAULT NULL,
  `date_adoption` date DEFAULT NULL,
  `lout_type_ship` varchar(255) DEFAULT '',
  `lout_type_doc` text,
  `lout_status` varchar(255) DEFAULT '',
  `deadline_reply` date DEFAULT NULL,
  `cocument_no` varchar(100) DEFAULT '',
  `no_internal` varchar(100) DEFAULT '',
  `lout_dimensions` varchar(255) DEFAULT '',
  `incoming_correspondence` int(10) DEFAULT NULL,
  PRIMARY KEY (`lettersoutid`),
  KEY `vtiger_lettersout_incoming_correspondence_idx` (`incoming_correspondence`),
  CONSTRAINT `fk_1_vtiger_lettersout` FOREIGN KEY (`lettersoutid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lettersoutcf` (
  `lettersoutid` int(10) NOT NULL,
  PRIMARY KEY (`lettersoutid`),
  CONSTRAINT `fk_1_vtiger_lettersoutcf` FOREIGN KEY (`lettersoutid`) REFERENCES `vtiger_lettersout` (`lettersoutid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lin_dimensions` (
  `lin_dimensionsid` int(10) NOT NULL AUTO_INCREMENT,
  `lin_dimensions` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`lin_dimensionsid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lin_dimensions_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lin_status` (
  `lin_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `lin_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 (`lin_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lin_status_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lin_type` (
  `lin_typeid` int(11) NOT NULL AUTO_INCREMENT,
  `lin_type` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`lin_typeid`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lin_type_doc` (
  `lin_type_docid` int(10) NOT NULL AUTO_INCREMENT,
  `lin_type_doc` 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 (`lin_type_docid`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lin_type_doc_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lin_type_ship` (
  `lin_type_shipid` int(10) NOT NULL AUTO_INCREMENT,
  `lin_type_ship` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`lin_type_shipid`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lin_type_ship_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_links` (
  `linkid` int(10) NOT NULL AUTO_INCREMENT,
  `tabid` smallint(5) DEFAULT NULL,
  `linktype` varchar(50) DEFAULT NULL,
  `linklabel` varchar(50) DEFAULT NULL,
  `linkurl` varchar(255) DEFAULT NULL,
  `linkicon` varchar(100) DEFAULT NULL,
  `sequence` int(10) DEFAULT NULL,
  `handler_path` varchar(128) DEFAULT NULL,
  `handler_class` varchar(50) DEFAULT NULL,
  `handler` varchar(50) DEFAULT NULL,
  `params` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`linkid`),
  KEY `link_tabidtype_idx` (`tabid`,`linktype`),
  KEY `linklabel` (`linklabel`),
  KEY `linkid` (`linkid`,`tabid`,`linktype`,`linklabel`),
  KEY `linktype` (`linktype`)
) ENGINE=InnoDB AUTO_INCREMENT=316 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_listaprueba` (
  `listapruebaid` int(11) NOT NULL AUTO_INCREMENT,
  `listaprueba` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`listapruebaid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_llamada` (
  `llamadaid` int(11) NOT NULL AUTO_INCREMENT,
  `llamada` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`llamadaid`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_loginhistory` (
  `login_id` int(10) NOT NULL AUTO_INCREMENT,
  `user_name` varchar(32) DEFAULT NULL,
  `user_ip` varchar(100) NOT NULL,
  `logout_time` timestamp NULL DEFAULT NULL,
  `login_time` timestamp NULL DEFAULT NULL,
  `status` varchar(25) DEFAULT NULL,
  `browser` varchar(25) DEFAULT NULL,
  PRIMARY KEY (`login_id`),
  KEY `user_name` (`user_name`),
  KEY `user_ip` (`user_ip`,`login_time`,`status`)
) ENGINE=InnoDB AUTO_INCREMENT=33966 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lout_dimensions` (
  `lout_dimensionsid` int(10) NOT NULL AUTO_INCREMENT,
  `lout_dimensions` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`lout_dimensionsid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lout_dimensions_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lout_status` (
  `lout_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `lout_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 (`lout_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lout_status_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lout_type_doc` (
  `lout_type_docid` int(10) NOT NULL AUTO_INCREMENT,
  `lout_type_doc` 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 (`lout_type_docid`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lout_type_doc_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lout_type_ship` (
  `lout_type_shipid` int(10) NOT NULL AUTO_INCREMENT,
  `lout_type_ship` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`lout_type_shipid`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lout_type_ship_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_lugarsismo` (
  `lugarsismoid` int(11) NOT NULL AUTO_INCREMENT,
  `lugarsismo` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`lugarsismoid`)
) ENGINE=InnoDB AUTO_INCREMENT=114 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_mail_accounts` (
  `account_id` int(10) NOT NULL,
  `user_id` int(10) NOT NULL,
  `display_name` varchar(50) DEFAULT NULL,
  `mail_id` varchar(50) DEFAULT NULL,
  `account_name` varchar(50) DEFAULT NULL,
  `mail_protocol` varchar(20) DEFAULT NULL,
  `mail_username` varchar(50) NOT NULL,
  `mail_password` varchar(250) NOT NULL,
  `mail_servername` varchar(50) DEFAULT NULL,
  `box_refresh` int(10) DEFAULT NULL,
  `mails_per_page` int(10) DEFAULT NULL,
  `ssltype` varchar(50) DEFAULT NULL,
  `sslmeth` varchar(50) DEFAULT NULL,
  `int_mailer` int(1) DEFAULT '0',
  `status` varchar(10) DEFAULT NULL,
  `set_default` int(2) DEFAULT NULL,
  `sent_folder` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`account_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_manufacturer` (
  `manufacturerid` int(10) NOT NULL AUTO_INCREMENT,
  `manufacturer` 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 (`manufacturerid`),
  UNIQUE KEY `manufacturer_manufacturer_idx` (`manufacturer`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_manufacturer_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_marca` (
  `marcaid` int(11) NOT NULL AUTO_INCREMENT,
  `marca` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`marcaid`)
) ENGINE=InnoDB AUTO_INCREMENT=57 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_mesasignacion` (
  `mesasignacionid` int(11) NOT NULL AUTO_INCREMENT,
  `mesasignacion` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`mesasignacionid`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_metodopago` (
  `metodopagoid` int(11) NOT NULL AUTO_INCREMENT,
  `metodopago` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`metodopagoid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_modcomments` (
  `modcommentsid` int(10) NOT NULL,
  `commentcontent` text,
  `related_to` int(10) DEFAULT NULL,
  `parent_comments` int(10) DEFAULT NULL,
  `customer` varchar(100) DEFAULT NULL,
  `userid` int(10) DEFAULT NULL,
  `reasontoedit` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`modcommentsid`),
  KEY `relatedto_idx` (`related_to`),
  KEY `modcommentsid` (`modcommentsid`),
  KEY `parent_comments` (`parent_comments`),
  KEY `userid` (`userid`),
  KEY `related_to` (`related_to`,`parent_comments`),
  CONSTRAINT `vtiger_modcomments_ibfk_1` FOREIGN KEY (`related_to`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_modcommentscf` (
  `modcommentsid` int(10) NOT NULL,
  PRIMARY KEY (`modcommentsid`),
  CONSTRAINT `vtiger_modcommentscf_ibfk_1` FOREIGN KEY (`modcommentsid`) REFERENCES `vtiger_modcomments` (`modcommentsid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_modentity_num` (
  `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `tabid` smallint(5) unsigned NOT NULL,
  `prefix` varchar(50) NOT NULL DEFAULT '',
  `postfix` varchar(50) NOT NULL DEFAULT '',
  `start_id` int(10) unsigned NOT NULL,
  `cur_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `semodule` (`cur_id`),
  KEY `prefix` (`prefix`,`postfix`,`cur_id`),
  KEY `tabid` (`tabid`),
  KEY `tabid_2` (`tabid`,`cur_id`)
) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_modtracker_basic` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `crmid` int(10) DEFAULT NULL,
  `module` varchar(50) DEFAULT NULL,
  `whodid` int(10) DEFAULT NULL,
  `changedon` datetime DEFAULT NULL,
  `status` int(1) DEFAULT '0',
  `last_reviewed_users` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `crmidx` (`crmid`),
  KEY `idx` (`id`),
  KEY `id` (`id`,`module`,`changedon`),
  KEY `crmid` (`crmid`,`changedon`)
) ENGINE=InnoDB AUTO_INCREMENT=187991714 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_modtracker_detail` (
  `id` int(10) DEFAULT NULL,
  `fieldname` varchar(100) DEFAULT NULL,
  `prevalue` text,
  `postvalue` text,
  KEY `idx` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_modtracker_relations` (
  `id` int(10) NOT NULL,
  `targetmodule` varchar(100) NOT NULL,
  `targetid` int(10) NOT NULL,
  `changedon` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_modtracker_tabs` (
  `tabid` smallint(5) unsigned NOT NULL,
  `visible` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`tabid`),
  KEY `tabid` (`tabid`,`visible`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_module_dashboard` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `blockid` int(10) NOT NULL,
  `linkid` int(10) DEFAULT NULL,
  `filterid` varchar(100) DEFAULT NULL,
  `title` varchar(100) DEFAULT NULL,
  `data` text,
  `size` varchar(50) DEFAULT NULL,
  `limit` tinyint(2) DEFAULT NULL,
  `isdefault` tinyint(1) NOT NULL DEFAULT '0',
  `owners` varchar(100) DEFAULT NULL,
  `cache` tinyint(1) DEFAULT '0',
  `date` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vtiger_module_dashboard_ibfk_1` (`blockid`)
) ENGINE=InnoDB AUTO_INCREMENT=1351 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_module_dashboard_blocks` (
  `id` int(100) unsigned NOT NULL AUTO_INCREMENT,
  `authorized` varchar(10) NOT NULL,
  `tabid` smallint(5) unsigned NOT NULL,
  `dashboard_id` int(10) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `authorized` (`authorized`,`tabid`),
  KEY `tabid` (`tabid`)
) ENGINE=InnoDB AUTO_INCREMENT=88 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_module_dashboard_widgets` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `linkid` int(10) NOT NULL,
  `userid` int(10) DEFAULT NULL,
  `templateid` int(10) NOT NULL,
  `filterid` varchar(100) DEFAULT NULL,
  `title` varchar(100) DEFAULT NULL,
  `data` text,
  `size` varchar(50) DEFAULT NULL,
  `limit` tinyint(2) DEFAULT NULL,
  `position` varchar(50) DEFAULT NULL,
  `isdefault` tinyint(1) DEFAULT '0',
  `active` tinyint(1) DEFAULT '0',
  `owners` varchar(100) DEFAULT NULL,
  `module` int(10) DEFAULT '0',
  `cache` tinyint(1) DEFAULT '0',
  `date` varchar(20) DEFAULT NULL,
  `dashboardid` int(10) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vtiger_module_dashboard_widgets_ibfk_1` (`templateid`),
  KEY `userid` (`userid`,`active`,`module`),
  CONSTRAINT `vtiger_module_dashboard_widgets_ibfk_1` FOREIGN KEY (`templateid`) REFERENCES `vtiger_module_dashboard` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7469 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_motivonoleinteresa` (
  `motivonoleinteresaid` int(11) NOT NULL AUTO_INCREMENT,
  `motivonoleinteresa` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`motivonoleinteresaid`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_motivorechazo` (
  `motivorechazoid` int(11) NOT NULL AUTO_INCREMENT,
  `motivorechazo` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`motivorechazoid`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_motivorechazovtadda` (
  `motivorechazovtaddaid` int(11) NOT NULL AUTO_INCREMENT,
  `motivorechazovtadda` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`motivorechazovtaddaid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_mulcomp_status` (
  `mulcomp_statusid` int(11) NOT NULL AUTO_INCREMENT,
  `mulcomp_status` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`mulcomp_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_nacionalidad` (
  `nacionalidadid` int(11) NOT NULL AUTO_INCREMENT,
  `nacionalidad` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`nacionalidadid`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_no_of_currency_decimals` (
  `no_of_currency_decimalsid` int(10) NOT NULL AUTO_INCREMENT,
  `no_of_currency_decimals` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`no_of_currency_decimalsid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_no_of_currency_decimals_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_nombrereceptor` (
  `nombrereceptorid` int(11) NOT NULL AUTO_INCREMENT,
  `nombrereceptor` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`nombrereceptorid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_nombrereceptord` (
  `nombrereceptordid` int(11) NOT NULL AUTO_INCREMENT,
  `nombrereceptord` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`nombrereceptordid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_notebook_contents` (
  `userid` int(10) NOT NULL,
  `notebookid` int(10) NOT NULL,
  `contents` text
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_notes` (
  `notesid` int(10) NOT NULL DEFAULT '0',
  `note_no` varchar(100) NOT NULL,
  `title` varchar(200) NOT NULL,
  `filename` varchar(200) DEFAULT NULL,
  `notecontent` text,
  `folderid` varchar(255) DEFAULT NULL,
  `filetype` varchar(100) DEFAULT NULL,
  `filelocationtype` varchar(5) DEFAULT NULL,
  `filedownloadcount` int(10) DEFAULT NULL,
  `filestatus` smallint(1) DEFAULT NULL,
  `filesize` int(10) NOT NULL DEFAULT '0',
  `fileversion` varchar(50) DEFAULT NULL,
  `ossdc_status` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`notesid`),
  KEY `notes_title_idx` (`title`),
  KEY `notes_notesid_idx` (`notesid`),
  CONSTRAINT `fk_1_vtiger_notes` FOREIGN KEY (`notesid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_notescf` (
  `notesid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`notesid`),
  CONSTRAINT `vtiger_notescf_ibfk_1` FOREIGN KEY (`notesid`) REFERENCES `vtiger_notes` (`notesid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_notification_status` (
  `notification_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `notification_status` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`notification_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_notification_type` (
  `notification_typeid` int(10) NOT NULL AUTO_INCREMENT,
  `notification_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 (`notification_typeid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_nreprelegal` (
  `nreprelegalid` int(11) NOT NULL AUTO_INCREMENT,
  `nreprelegal` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`nreprelegalid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_nrocuotas` (
  `nrocuotasid` int(11) NOT NULL AUTO_INCREMENT,
  `nrocuotas` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`nrocuotasid`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_nrocuotasgd` (
  `nrocuotasgdid` int(11) NOT NULL AUTO_INCREMENT,
  `nrocuotasgd` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`nrocuotasgdid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_nroreprogramacion` (
  `nroreprogramacionid` int(11) NOT NULL AUTO_INCREMENT,
  `nroreprogramacion` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`nroreprogramacionid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_nuevousado` (
  `nuevousadoid` int(11) NOT NULL AUTO_INCREMENT,
  `nuevousado` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`nuevousadoid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_objconcob` (
  `objconcobid` int(11) NOT NULL AUTO_INCREMENT,
  `objconcob` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` int(10) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`objconcobid`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_objconcob2` (
  `objconcob2id` int(11) NOT NULL AUTO_INCREMENT,
  `objconcob2` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` int(10) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`objconcob2id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_objsincobmix` (
  `objsincobmixid` int(11) NOT NULL AUTO_INCREMENT,
  `objsincobmix` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` int(10) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`objsincobmixid`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_objsincobmix2` (
  `objsincobmix2id` int(11) NOT NULL AUTO_INCREMENT,
  `objsincobmix2` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` int(10) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`objsincobmix2id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_objsincobpur` (
  `objsincobpurid` int(11) NOT NULL AUTO_INCREMENT,
  `objsincobpur` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` int(10) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`objsincobpurid`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_objsincobpur2` (
  `objsincobpur2id` int(11) NOT NULL AUTO_INCREMENT,
  `objsincobpur2` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` int(10) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`objsincobpur2id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ofcaptador` (
  `ofcaptadorid` int(11) NOT NULL AUTO_INCREMENT,
  `ofcaptador` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`ofcaptadorid`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_opportunitystage` (
  `potstageid` int(10) NOT NULL AUTO_INCREMENT,
  `stage` varchar(200) NOT NULL,
  `sortorderid` int(10) NOT NULL DEFAULT '0',
  `presence` int(1) NOT NULL DEFAULT '1',
  `probability` decimal(3,2) DEFAULT '0.00',
  PRIMARY KEY (`potstageid`),
  UNIQUE KEY `opportunitystage_stage_idx` (`stage`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_oproductstatus` (
  `oproductstatusid` int(10) NOT NULL AUTO_INCREMENT,
  `oproductstatus` 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 (`oproductstatusid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_oproductstatus_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_org_share_action2tab` (
  `share_action_id` int(10) NOT NULL,
  `tabid` smallint(5) NOT NULL,
  PRIMARY KEY (`share_action_id`,`tabid`),
  KEY `fk_2_vtiger_org_share_action2tab` (`tabid`),
  CONSTRAINT `fk_2_vtiger_org_share_action2tab` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_org_share_action_mapping` (
  `share_action_id` int(10) NOT NULL,
  `share_action_name` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`share_action_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ossdc_status` (
  `ossdc_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `ossdc_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 (`ossdc_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ossdc_status_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ossemployees` (
  `ossemployeesid` int(10) NOT NULL DEFAULT '0',
  `ossemployees_no` varchar(255) DEFAULT NULL,
  `parentid` int(10) DEFAULT '0',
  `employee_status` varchar(200) DEFAULT NULL,
  `name` varchar(200) DEFAULT NULL,
  `last_name` varchar(200) DEFAULT NULL,
  `pesel` varchar(20) DEFAULT NULL,
  `id_card` varchar(200) DEFAULT NULL,
  `employee_education` varchar(200) DEFAULT NULL,
  `birth_date` date DEFAULT NULL,
  `business_phone` varchar(20) DEFAULT NULL,
  `private_phone` varchar(25) DEFAULT NULL,
  `business_mail` varchar(100) DEFAULT NULL,
  `private_mail` varchar(100) DEFAULT NULL,
  `street` varchar(200) DEFAULT NULL,
  `code` varchar(200) DEFAULT NULL,
  `city` varchar(200) DEFAULT NULL,
  `state` varchar(200) DEFAULT NULL,
  `country` varchar(200) DEFAULT NULL,
  `ship_street` varchar(200) DEFAULT NULL,
  `ship_code` varchar(200) DEFAULT NULL,
  `ship_city` varchar(200) DEFAULT NULL,
  `ship_state` varchar(200) DEFAULT NULL,
  `ship_country` varchar(200) DEFAULT NULL,
  `dav_status` tinyint(1) DEFAULT '1',
  `sum_time` decimal(10,2) DEFAULT '0.00',
  `secondary_phone` varchar(25) DEFAULT NULL,
  `position` varchar(255) DEFAULT NULL,
  `rbh` decimal(25,8) DEFAULT NULL,
  `business_phone_extra` varchar(100) DEFAULT NULL,
  `private_phone_extra` varchar(100) DEFAULT NULL,
  `secondary_phone_extra` varchar(100) DEFAULT NULL,
  `rut` varchar(32) DEFAULT '',
  `nacionalidad` varchar(255) DEFAULT '',
  `edocivil` varchar(255) DEFAULT '',
  `extension` bigint(32) DEFAULT '0',
  `jefedirecto` int(11) unsigned DEFAULT '0',
  `fingreso` date DEFAULT NULL,
  `tipocontrato` varchar(255) DEFAULT '',
  `bancoempleado` varchar(255) DEFAULT '',
  `tipocuenta` varchar(255) DEFAULT '',
  `nrocuenta` varchar(64) DEFAULT '',
  `prevision` varchar(255) DEFAULT '',
  `sueldoliquido` bigint(64) DEFAULT '0',
  `afp` varchar(255) DEFAULT '',
  `comuna` varchar(255) DEFAULT '',
  `provincia` varchar(255) DEFAULT '',
  `region` varchar(255) DEFAULT '',
  `seriedocumento` varchar(64) DEFAULT '',
  `departamento` text,
  `pasaporte` varchar(59) DEFAULT '',
  PRIMARY KEY (`ossemployeesid`),
  KEY `vtiger_ossemployees_jefedirecto_idx` (`jefedirecto`),
  CONSTRAINT `fk_1_vtiger_ossemployees` FOREIGN KEY (`ossemployeesid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ossemployeescf` (
  `ossemployeesid` int(10) NOT NULL,
  PRIMARY KEY (`ossemployeesid`),
  CONSTRAINT `fk_1_vtiger_ossemployeescf` FOREIGN KEY (`ossemployeesid`) REFERENCES `vtiger_ossemployees` (`ossemployeesid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_osservicesstatus` (
  `osservicesstatusid` int(10) NOT NULL AUTO_INCREMENT,
  `osservicesstatus` 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 (`osservicesstatusid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_osservicesstatus_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ossmails_logs` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `start_time` timestamp NULL DEFAULT NULL,
  `end_time` timestamp NULL DEFAULT NULL,
  `action` varchar(100) DEFAULT NULL,
  `status` tinyint(3) DEFAULT NULL,
  `user` varchar(100) DEFAULT NULL,
  `count` int(10) DEFAULT NULL,
  `stop_user` varchar(100) DEFAULT NULL,
  `info` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ossmailscanner_config` (
  `conf_type` varchar(100) NOT NULL,
  `parameter` varchar(100) DEFAULT NULL,
  `value` text
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ossmailscanner_folders_uid` (
  `user_id` int(10) unsigned DEFAULT NULL,
  `type` varchar(50) DEFAULT NULL,
  `folder` varchar(100) DEFAULT NULL,
  `uid` int(10) DEFAULT '0',
  KEY `user_id` (`user_id`),
  KEY `folder` (`folder`),
  CONSTRAINT `vtiger_ossmailscanner_folders_uid_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `roundcube_users` (`user_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ossmailscanner_log_cron` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `created_time` timestamp NULL DEFAULT NULL,
  `laststart` int(10) unsigned DEFAULT NULL,
  `status` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ossmailview` (
  `ossmailviewid` int(10) NOT NULL,
  `ossmailview_no` varchar(50) DEFAULT NULL,
  `from_email` text,
  `to_email` text,
  `subject` text,
  `content` text,
  `cc_email` text,
  `bcc_email` text,
  `id` int(10) DEFAULT NULL,
  `mbox` varchar(100) DEFAULT NULL,
  `uid` varchar(150) DEFAULT NULL,
  `cid` char(40) DEFAULT NULL,
  `rc_user` varchar(3) DEFAULT NULL,
  `reply_to_email` text,
  `ossmailview_sendtype` varchar(30) DEFAULT NULL,
  `attachments_exist` smallint(1) DEFAULT '0',
  `type` tinyint(1) DEFAULT NULL,
  `from_id` varchar(50) NOT NULL,
  `to_id` varchar(100) NOT NULL,
  `orginal_mail` text,
  `verify` smallint(1) DEFAULT '0',
  `rel_mod` varchar(128) DEFAULT NULL,
  `date` datetime DEFAULT NULL,
  PRIMARY KEY (`ossmailviewid`),
  KEY `id` (`id`),
  KEY `verify` (`verify`),
  KEY `message_id` (`uid`,`rc_user`),
  KEY `mbox` (`mbox`),
  KEY `ossmailview_cid_idx` (`cid`),
  CONSTRAINT `fk_1_vtiger_ossmailview` FOREIGN KEY (`ossmailviewid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ossmailview_files` (
  `ossmailviewid` int(10) NOT NULL,
  `documentsid` int(10) NOT NULL,
  `attachmentsid` int(10) NOT NULL,
  KEY `fk_1_vtiger_ossmailview_files` (`ossmailviewid`),
  KEY `documentsid` (`documentsid`),
  CONSTRAINT `fk_1_vtiger_ossmailview_files` FOREIGN KEY (`ossmailviewid`) REFERENCES `vtiger_ossmailview` (`ossmailviewid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ossmailview_relation` (
  `ossmailviewid` int(10) NOT NULL,
  `crmid` int(10) NOT NULL,
  `date` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  UNIQUE KEY `ossmailviewid_2` (`ossmailviewid`,`crmid`),
  KEY `ossmailviewid` (`ossmailviewid`),
  KEY `crmid` (`crmid`,`deleted`),
  CONSTRAINT `vtiger_ossmailview_relation_ibfk_1` FOREIGN KEY (`ossmailviewid`) REFERENCES `vtiger_ossmailview` (`ossmailviewid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ossmailview_sendtype` (
  `ossmailview_sendtypeid` int(10) NOT NULL AUTO_INCREMENT,
  `ossmailview_sendtype` 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 (`ossmailview_sendtypeid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ossmailview_sendtype_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ossmailviewcf` (
  `ossmailviewid` int(10) NOT NULL,
  PRIMARY KEY (`ossmailviewid`),
  CONSTRAINT `fk_1_vtiger_ossmailviewcf` FOREIGN KEY (`ossmailviewid`) REFERENCES `vtiger_ossmailview` (`ossmailviewid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ossoutsourcedservices` (
  `ossoutsourcedservicesid` int(10) NOT NULL DEFAULT '0',
  `ossoutsourcedservices_no` varchar(255) DEFAULT NULL,
  `productname` varchar(100) DEFAULT '',
  `osservicesstatus` varchar(50) DEFAULT NULL,
  `pscategory` varchar(255) DEFAULT NULL,
  `datesold` date DEFAULT NULL,
  `dateinservice` date DEFAULT NULL,
  `wherebought` varchar(100) DEFAULT '',
  `parent_id` int(10) DEFAULT NULL,
  `ssalesprocessesid` int(10) DEFAULT NULL,
  PRIMARY KEY (`ossoutsourcedservicesid`),
  KEY `parent_id` (`parent_id`),
  KEY `ssalesprocessesid` (`ssalesprocessesid`),
  CONSTRAINT `fk_1_vtiger_ossoutsourcedservices` FOREIGN KEY (`ossoutsourcedservicesid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ossoutsourcedservicescf` (
  `ossoutsourcedservicesid` int(10) NOT NULL,
  PRIMARY KEY (`ossoutsourcedservicesid`),
  CONSTRAINT `fk_1_vtiger_ossoutsourcedservicescf` FOREIGN KEY (`ossoutsourcedservicesid`) REFERENCES `vtiger_ossoutsourcedservices` (`ossoutsourcedservicesid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_osspasswords` (
  `osspasswordsid` int(10) NOT NULL,
  `osspassword_no` varchar(100) NOT NULL,
  `passwordname` varchar(100) NOT NULL,
  `username` varchar(100) NOT NULL,
  `password` varbinary(200) NOT NULL,
  `link_adres` varchar(255) DEFAULT NULL,
  `linkto` int(10) DEFAULT NULL,
  `linkextend` int(10) DEFAULT NULL,
  PRIMARY KEY (`osspasswordsid`),
  KEY `linkto` (`linkto`),
  KEY `linkextend` (`linkextend`),
  CONSTRAINT `fk_1_vtiger_osspasswords` FOREIGN KEY (`osspasswordsid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_osspasswordscf` (
  `osspasswordsid` int(10) NOT NULL,
  PRIMARY KEY (`osspasswordsid`),
  CONSTRAINT `fk_1_vtiger_osspasswordscf` FOREIGN KEY (`osspasswordsid`) REFERENCES `vtiger_osspasswords` (`osspasswordsid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_osssoldservices` (
  `osssoldservicesid` int(10) NOT NULL DEFAULT '0',
  `osssoldservices_no` varchar(255) DEFAULT NULL,
  `productname` varchar(255) DEFAULT '',
  `ssservicesstatus` varchar(255) DEFAULT NULL,
  `pscategory` varchar(255) DEFAULT '',
  `datesold` date DEFAULT NULL,
  `dateinservice` date DEFAULT NULL,
  `invoice` varchar(255) DEFAULT '',
  `parent_id` int(10) DEFAULT NULL,
  `serviceid` int(10) DEFAULT NULL,
  `ordertime` decimal(10,2) DEFAULT NULL,
  `ssalesprocessesid` int(10) DEFAULT NULL,
  `osssoldservices_renew` varchar(255) DEFAULT NULL,
  `renewalinvoice` int(10) DEFAULT NULL,
  `contactid` int(19) DEFAULT NULL,
  PRIMARY KEY (`osssoldservicesid`),
  KEY `parent_id` (`parent_id`),
  KEY `serviceid` (`serviceid`),
  KEY `ssalesprocessesid` (`ssalesprocessesid`),
  KEY `renewalinvoice` (`renewalinvoice`),
  KEY `contactid_idx` (`contactid`),
  CONSTRAINT `fk_1_vtiger_osssoldservices` FOREIGN KEY (`osssoldservicesid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_osssoldservices_renew` (
  `osssoldservices_renewid` int(10) NOT NULL AUTO_INCREMENT,
  `osssoldservices_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 (`osssoldservices_renewid`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_osssoldservicescf` (
  `osssoldservicesid` int(10) NOT NULL,
  PRIMARY KEY (`osssoldservicesid`),
  CONSTRAINT `fk_1_vtiger_osssoldservicescf` FOREIGN KEY (`osssoldservicesid`) REFERENCES `vtiger_osssoldservices` (`osssoldservicesid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_osstimecontrol` (
  `osstimecontrolid` int(10) NOT NULL DEFAULT '0',
  `name` varchar(128) DEFAULT NULL,
  `osstimecontrol_no` varchar(255) DEFAULT NULL,
  `osstimecontrol_status` varchar(128) DEFAULT NULL,
  `date_start` date NOT NULL,
  `time_start` varchar(50) DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `time_end` varchar(50) DEFAULT NULL,
  `sum_time` decimal(10,2) DEFAULT '0.00',
  `deleted` int(1) DEFAULT '0',
  `timecontrol_type` varchar(255) DEFAULT NULL,
  `process` int(10) DEFAULT NULL,
  `link` int(10) DEFAULT NULL,
  `subprocess` int(10) DEFAULT NULL,
  `linkextend` int(10) DEFAULT NULL,
  PRIMARY KEY (`osstimecontrolid`),
  KEY `on_update_cascade` (`deleted`),
  KEY `osstimecontrol_status_9` (`osstimecontrol_status`,`deleted`),
  KEY `osstimecontrol_status_6` (`osstimecontrol_status`),
  KEY `subprocess` (`subprocess`),
  KEY `link` (`link`),
  KEY `process` (`process`),
  KEY `linkextend` (`linkextend`),
  CONSTRAINT `vtiger_osstimecontrol` FOREIGN KEY (`osstimecontrolid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_osstimecontrol_status` (
  `osstimecontrol_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `osstimecontrol_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 (`osstimecontrol_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_osstimecontrol_status_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_osstimecontrolcf` (
  `osstimecontrolid` int(10) NOT NULL,
  PRIMARY KEY (`osstimecontrolid`),
  CONSTRAINT `vtiger_osstimecontrolcf` FOREIGN KEY (`osstimecontrolid`) REFERENCES `vtiger_osstimecontrol` (`osstimecontrolid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_othereventduration` (
  `othereventdurationid` int(10) NOT NULL AUTO_INCREMENT,
  `othereventduration` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`othereventdurationid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_othereventduration_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_outsourcedproducts` (
  `outsourcedproductsid` int(10) NOT NULL DEFAULT '0',
  `asset_no` varchar(32) DEFAULT NULL,
  `productname` varchar(255) DEFAULT NULL,
  `datesold` date DEFAULT NULL,
  `dateinservice` date DEFAULT NULL,
  `oproductstatus` varchar(255) DEFAULT NULL,
  `pscategory` varchar(255) DEFAULT '',
  `wherebought` varchar(255) DEFAULT '',
  `prodcount` varchar(255) DEFAULT '',
  `parent_id` int(10) DEFAULT NULL,
  `ssalesprocessesid` int(10) DEFAULT NULL,
  PRIMARY KEY (`outsourcedproductsid`),
  KEY `parent_id` (`parent_id`),
  KEY `ssalesprocessesid` (`ssalesprocessesid`),
  CONSTRAINT `fk_1_vtiger_outsourcedproducts` FOREIGN KEY (`outsourcedproductsid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_outsourcedproductscf` (
  `outsourcedproductsid` int(10) NOT NULL,
  PRIMARY KEY (`outsourcedproductsid`),
  CONSTRAINT `fk_1_vtiger_outsourcedproductscf` FOREIGN KEY (`outsourcedproductsid`) REFERENCES `vtiger_outsourcedproducts` (`outsourcedproductsid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_pago` (
  `pagoid` int(11) NOT NULL AUTO_INCREMENT,
  `pago` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`pagoid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_pais` (
  `paisid` int(11) NOT NULL AUTO_INCREMENT,
  `pais` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`paisid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_paiscliente` (
  `paisclienteid` int(11) NOT NULL AUTO_INCREMENT,
  `paiscliente` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`paisclienteid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_parentezcoreferencia1` (
  `parentezcoreferencia1id` int(11) NOT NULL AUTO_INCREMENT,
  `parentezcoreferencia1` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`parentezcoreferencia1id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_parentezcoreferencia2` (
  `parentezcoreferencia2id` int(11) NOT NULL AUTO_INCREMENT,
  `parentezcoreferencia2` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`parentezcoreferencia2id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_password` (
  `type` varchar(20) NOT NULL,
  `val` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_passwords_config` (
  `pass_length_min` int(3) NOT NULL,
  `pass_length_max` int(3) NOT NULL,
  `pass_allow_chars` varchar(200) NOT NULL,
  `register_changes` tinyint(1) DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_paymentsin` (
  `paymentsinid` int(10) NOT NULL DEFAULT '0',
  `paymentsvalue` decimal(25,3) DEFAULT NULL,
  `paymentsno` varchar(32) DEFAULT NULL,
  `paymentsname` varchar(128) DEFAULT NULL,
  `paymentstitle` text,
  `paymentscurrency` varchar(32) DEFAULT NULL,
  `bank_account` varchar(128) DEFAULT NULL,
  `paymentsin_status` varchar(128) DEFAULT NULL,
  `relatedid` int(10) DEFAULT NULL,
  `nrofactura` varchar(32) DEFAULT '',
  `indemnizacion` bigint(64) DEFAULT '0',
  `valorfactura` bigint(64) DEFAULT '0',
  `ffactura` date DEFAULT NULL,
  `banco` varchar(32) DEFAULT '',
  `fvencimientofactura` date DEFAULT NULL,
  `diasvencidos` int(8) DEFAULT '0',
  `notificado` tinyint(1) DEFAULT '0',
  `fnotificacion` date DEFAULT NULL,
  `ndividendos` int(8) DEFAULT '0',
  `fpagodividendos` date DEFAULT NULL,
  `fcompromiso` date DEFAULT NULL,
  `observaciones` text,
  `valor1cuota` bigint(64) DEFAULT '0',
  `valor2cuota` bigint(64) DEFAULT '0',
  `valor3cuota` bigint(64) DEFAULT '0',
  `f1cuota` date DEFAULT NULL,
  `f2cuota` date DEFAULT NULL,
  `f3cuota` date DEFAULT NULL,
  `1cuotapagada` tinyint(1) DEFAULT '0',
  `2cuotapagada` tinyint(1) DEFAULT '0',
  `3cuotapagada` tinyint(1) DEFAULT '0',
  `nrosiniestro` int(11) unsigned DEFAULT '0',
  `frecinfliq` date DEFAULT NULL,
  `fpagofactura` date DEFAULT NULL,
  `facturapagada` tinyint(1) DEFAULT '0',
  `cliente` int(11) unsigned DEFAULT '0',
  `captador` varchar(59) DEFAULT '',
  `notificacioncobro1` tinyint(1) DEFAULT '0',
  `f1eranotifcacion` date DEFAULT NULL,
  `ciaseguros` varchar(255) DEFAULT '',
  `valor4cuota` bigint(64) DEFAULT '0',
  `f4cuota` date DEFAULT NULL,
  `4cuotapagada` tinyint(1) DEFAULT '0',
  `fvencuota1` date DEFAULT NULL,
  `fvencuota2` date DEFAULT NULL,
  `fvencuota3` date DEFAULT NULL,
  `fvencuota4` date DEFAULT NULL,
  `valor5cuota` bigint(64) DEFAULT '0',
  `valor6cuota` bigint(64) DEFAULT '0',
  `fvencuota5` date DEFAULT NULL,
  `fvencuota6` date DEFAULT NULL,
  `5cuotapagada` tinyint(1) DEFAULT '0',
  `6cuotapagada` tinyint(1) DEFAULT '0',
  `f5cuota` date DEFAULT NULL,
  `f6cuota` date DEFAULT NULL,
  `fprobpagocia` date DEFAULT NULL,
  `numerosiniestrocaso` varchar(32) DEFAULT '',
  `analistacia` varchar(59) DEFAULT '',
  `correoanalista` varchar(100) DEFAULT '',
  `tlfanalista` varchar(30) DEFAULT '',
  `tlfanalista_extra` varchar(100) DEFAULT NULL,
  `obsanalista` text,
  `observacionpago` text,
  `notificacioncobro2` tinyint(1) DEFAULT '0',
  `f2danotificacion` date DEFAULT NULL,
  `recordatorio` tinyint(1) DEFAULT '0',
  `frecordatorio` date DEFAULT NULL,
  `enviomensajes` tinyint(1) DEFAULT '0',
  `fenviomensajes` date DEFAULT NULL,
  `bancopago` varchar(255) DEFAULT '',
  `tipopago` varchar(255) DEFAULT '',
  `deudaactual` bigint(59) DEFAULT '0',
  `gastocobranza` bigint(59) DEFAULT '0',
  `valorcuota` bigint(59) DEFAULT '0',
  `deudatotal` bigint(59) DEFAULT '0',
  `abono` bigint(59) DEFAULT '0',
  `deudarestante` bigint(59) DEFAULT '0',
  `nrocuotas` varchar(255) DEFAULT '',
  `diapago` varchar(255) DEFAULT '',
  `fprimerpago` date DEFAULT NULL,
  `abonopagado` tinyint(1) DEFAULT '0',
  `fabono` date DEFAULT NULL,
  `tpagoabono` varchar(255) DEFAULT '',
  `bdpago` varchar(255) DEFAULT '',
  `deudainicial` bigint(59) DEFAULT '0',
  `tpago1cuota` varchar(255) DEFAULT '',
  `bdpago1cuota` varchar(255) DEFAULT '',
  `tpago2cuota` varchar(255) DEFAULT '',
  `tpago3cuota` varchar(255) DEFAULT '',
  `tpago4cuota` varchar(255) DEFAULT '',
  `tpago5cuota` varchar(255) DEFAULT '',
  `tpago6cuota` varchar(255) DEFAULT '',
  `bdpago2cuota` varchar(255) DEFAULT '',
  `bdpago3cuota` varchar(255) DEFAULT '',
  `bdpago4cuota` varchar(255) DEFAULT '',
  `bdpago5cuuota` varchar(255) DEFAULT '',
  `bdpago6cuota` varchar(255) DEFAULT '',
  `envfactcliente` tinyint(1) DEFAULT '0',
  `codwebpayabono` bigint(12) DEFAULT '0',
  `codwebpaycuota1` bigint(12) DEFAULT '0',
  `codwebpaycuota2` bigint(12) DEFAULT '0',
  `codwebpaycuota3` bigint(12) DEFAULT '0',
  `codwebpaycuota4` bigint(12) DEFAULT '0',
  `codwebpaycuota5` bigint(12) DEFAULT '0',
  `codwebpaycuota6` bigint(12) DEFAULT '0',
  `tarjpagoabono` varchar(255) DEFAULT '',
  `tarjpagocuota1` varchar(255) DEFAULT '',
  `tarjpagocuota2` varchar(255) DEFAULT '',
  `tarjpagocuota3` varchar(255) DEFAULT '',
  `tarjpagocuota4` varchar(255) DEFAULT '',
  `tarjpagocuota5` varchar(255) DEFAULT '',
  `tarjpagocuota6` varchar(255) DEFAULT '',
  `tipocobranza` varchar(255) DEFAULT '',
  `notificacionpagoliberado` tinyint(1) DEFAULT '0',
  `fnotlibpag` date DEFAULT NULL,
  `cobraz` int(11) unsigned DEFAULT '0',
  `prc` int(11) unsigned DEFAULT '0',
  `crearddacobranza` tinyint(1) DEFAULT '0',
  `relddacobranza` int(11) unsigned DEFAULT '0',
  `crearddapagoretenido` tinyint(1) DEFAULT '0',
  `relddapagoretenido` int(11) unsigned DEFAULT '0',
  `crearrecdeuda` tinyint(1) DEFAULT '0',
  `incumplimientoconvenio` tinyint(1) DEFAULT '0',
  `honorariosabogado` bigint(30) DEFAULT '0',
  `estadogc` varchar(255) DEFAULT '',
  `fechagestuno` date DEFAULT NULL,
  `fechagestdos` date DEFAULT NULL,
  `fechagesttres` date DEFAULT NULL,
  `obsgestcobra` text,
  `estado` varchar(255) DEFAULT '',
  `sinacofi` tinyint(1) DEFAULT '0',
  `tipoddacobranza` varchar(255) DEFAULT '',
  `nrocredito` varchar(30) DEFAULT '',
  `asociadoesterno` varchar(200) DEFAULT '',
  PRIMARY KEY (`paymentsinid`),
  KEY `vtiger_paymentsin_nrosiniestro_idx` (`nrosiniestro`),
  KEY `vtiger_paymentsin_cliente_idx` (`cliente`),
  KEY `vtiger_paymentsin_cobraz_idx` (`cobraz`),
  KEY `vtiger_paymentsin_prc_idx` (`prc`),
  KEY `vtiger_paymentsin_relddacobranza_idx` (`relddacobranza`),
  KEY `vtiger_paymentsin_relddapagoretenido_idx` (`relddapagoretenido`),
  CONSTRAINT `fk_1_vtiger_paymentsin` FOREIGN KEY (`paymentsinid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_paymentsin_status` (
  `paymentsin_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `paymentsin_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 (`paymentsin_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_paymentsin_status_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_paymentsincf` (
  `paymentsinid` int(10) NOT NULL,
  PRIMARY KEY (`paymentsinid`),
  CONSTRAINT `fk_1_vtiger_paymentsincf` FOREIGN KEY (`paymentsinid`) REFERENCES `vtiger_paymentsin` (`paymentsinid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_paymentsout` (
  `paymentsoutid` int(10) NOT NULL DEFAULT '0',
  `paymentsvalue` decimal(25,3) DEFAULT NULL,
  `paymentsno` varchar(32) DEFAULT NULL,
  `paymentsname` varchar(128) DEFAULT NULL,
  `paymentstitle` varchar(128) DEFAULT NULL,
  `paymentscurrency` varchar(32) DEFAULT NULL,
  `bank_account` varchar(128) DEFAULT NULL,
  `paymentsout_status` varchar(128) DEFAULT NULL,
  `relatedid` int(10) DEFAULT NULL,
  `parentid` int(10) DEFAULT NULL,
  PRIMARY KEY (`paymentsoutid`),
  CONSTRAINT `fk_1_vtiger_paymentsout` FOREIGN KEY (`paymentsoutid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_paymentsout_status` (
  `paymentsout_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `paymentsout_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 (`paymentsout_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_paymentsout_status_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_paymentsoutcf` (
  `paymentsoutid` int(10) NOT NULL,
  PRIMARY KEY (`paymentsoutid`),
  CONSTRAINT `fk_1_vtiger_paymentsoutcf` FOREIGN KEY (`paymentsoutid`) REFERENCES `vtiger_paymentsout` (`paymentsoutid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_pbxmanager` (
  `pbxmanagerid` int(10) NOT NULL AUTO_INCREMENT,
  `direction` varchar(10) DEFAULT NULL,
  `callstatus` varchar(20) DEFAULT NULL,
  `starttime` datetime DEFAULT NULL,
  `endtime` datetime DEFAULT NULL,
  `totalduration` int(10) DEFAULT NULL,
  `billduration` int(10) DEFAULT NULL,
  `recordingurl` varchar(200) DEFAULT NULL,
  `sourceuuid` varchar(100) DEFAULT NULL,
  `gateway` varchar(20) DEFAULT NULL,
  `customer` int(10) DEFAULT NULL,
  `user` varchar(100) DEFAULT NULL,
  `customernumber` varchar(100) DEFAULT NULL,
  `customertype` varchar(100) DEFAULT NULL,
  `customernumber_extra` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`pbxmanagerid`),
  KEY `index_sourceuuid` (`sourceuuid`),
  KEY `index_pbxmanager_id` (`pbxmanagerid`),
  CONSTRAINT `vtiger_pbxmanager_ibfk_1` FOREIGN KEY (`pbxmanagerid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_pbxmanager_gateway` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `gateway` varchar(20) DEFAULT NULL,
  `parameters` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_pbxmanager_phonelookup` (
  `crmid` int(10) DEFAULT NULL,
  `setype` varchar(30) DEFAULT NULL,
  `fnumber` varchar(100) DEFAULT NULL,
  `rnumber` varchar(100) DEFAULT NULL,
  `fieldname` varchar(50) DEFAULT NULL,
  UNIQUE KEY `unique_key` (`crmid`,`setype`,`fieldname`),
  KEY `index_phone_number` (`fnumber`,`rnumber`),
  CONSTRAINT `vtiger_pbxmanager_phonelookup_ibfk_1` FOREIGN KEY (`crmid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_pbxmanagercf` (
  `pbxmanagerid` int(10) NOT NULL,
  PRIMARY KEY (`pbxmanagerid`),
  CONSTRAINT `vtiger_pbxmanagercf_ibfk_1` FOREIGN KEY (`pbxmanagerid`) REFERENCES `vtiger_pbxmanager` (`pbxmanagerid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_pertenecealgrupo` (
  `pertenecealgrupoid` int(11) NOT NULL AUTO_INCREMENT,
  `pertenecealgrupo` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`pertenecealgrupoid`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_picklist` (
  `picklistid` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(200) NOT NULL,
  PRIMARY KEY (`picklistid`),
  UNIQUE KEY `picklist_name_idx` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=148 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_picklist_dependency` (
  `id` int(10) NOT NULL,
  `tabid` smallint(5) NOT NULL,
  `sourcefield` varchar(255) DEFAULT NULL,
  `targetfield` varchar(255) DEFAULT NULL,
  `sourcevalue` varchar(100) DEFAULT NULL,
  `targetvalues` text,
  `criteria` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_picklist_dependency_copy` (
  `id` int(10) NOT NULL,
  `tabid` smallint(5) NOT NULL,
  `sourcefield` varchar(255) DEFAULT NULL,
  `targetfield` varchar(255) DEFAULT NULL,
  `sourcevalue` varchar(100) DEFAULT NULL,
  `targetvalues` mediumtext,
  `criteria` mediumtext,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
CREATE TABLE `vtiger_picklist_dependency_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_picklistvalues_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_planaslegal` (
  `planaslegalid` int(11) NOT NULL AUTO_INCREMENT,
  `planaslegal` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` int(10) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`planaslegalid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_plazo` (
  `plazoid` int(11) NOT NULL AUTO_INCREMENT,
  `plazo` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`plazoid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_plazopa` (
  `plazopaid` int(11) NOT NULL AUTO_INCREMENT,
  `plazopa` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`plazopaid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_portal` (
  `portalid` int(10) NOT NULL AUTO_INCREMENT,
  `portalname` varchar(200) NOT NULL,
  `portalurl` varchar(255) NOT NULL,
  `sequence` int(3) NOT NULL,
  `setdefault` int(3) NOT NULL DEFAULT '0',
  `createdtime` datetime DEFAULT NULL,
  PRIMARY KEY (`portalid`),
  KEY `portal_portalname_idx` (`portalname`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_preaprobacioncredi` (
  `preaprobacioncrediid` int(11) NOT NULL DEFAULT '0',
  `preaprobacioncredi` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `anovehiculo` varchar(255) DEFAULT '',
  `cae` decimal(5,2) DEFAULT NULL,
  `comisionporciento` decimal(5,2) DEFAULT NULL,
  `preaprobado` tinyint(1) DEFAULT '0',
  `plazopa` varchar(255) DEFAULT '',
  `valorpie` varchar(255) DEFAULT '',
  `apellidoss` varchar(64) DEFAULT '',
  `nombres` varchar(64) DEFAULT '',
  `tasapiso` decimal(5,2) DEFAULT NULL,
  `tasatecho` decimal(5,2) DEFAULT NULL,
  `obssistema` text,
  `obsasesor` text,
  `edad` int(8) DEFAULT '0',
  `telefono_extra` varchar(100) DEFAULT NULL,
  `movil` varchar(30) DEFAULT '',
  `movil_extra` varchar(100) DEFAULT NULL,
  `correo` varchar(100) DEFAULT '',
  `propiedad` varchar(255) DEFAULT '',
  `nroprotesto` int(8) DEFAULT '0',
  `estadopreaprobacion` varchar(255) DEFAULT '',
  `antlaboral` int(8) DEFAULT '0',
  `checkmorosidad` tinyint(1) DEFAULT '0',
  `obssupervisor` text,
  `valorvehiculo` decimal(65,8) DEFAULT NULL,
  `valorpieneto` decimal(65,8) DEFAULT NULL,
  `rentaliquida` decimal(65,8) DEFAULT NULL,
  `lineacredito` decimal(65,8) DEFAULT NULL,
  `montototalprotesto` decimal(65,8) DEFAULT NULL,
  `montoafinanciar` decimal(65,8) DEFAULT NULL,
  `valorcuota` decimal(65,8) DEFAULT NULL,
  `ctc` decimal(65,8) DEFAULT NULL,
  `comision` decimal(65,8) DEFAULT NULL,
  `alzamientoprenda` decimal(65,8) DEFAULT NULL,
  `constitucionprenda` decimal(65,8) DEFAULT NULL,
  `legalizacionpagare` decimal(65,8) DEFAULT NULL,
  `gastosadministrativos` decimal(65,8) DEFAULT NULL,
  `retirodocumentos` decimal(65,8) DEFAULT NULL,
  `segurocesantia` decimal(65,8) DEFAULT NULL,
  `impuestopagare` decimal(5,2) DEFAULT NULL,
  `montopagare` decimal(65,8) DEFAULT NULL,
  PRIMARY KEY (`preaprobacioncrediid`),
  CONSTRAINT `fk_1_vtiger_preaprobacioncredipreaprobacioncrediid` FOREIGN KEY (`preaprobacioncrediid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_preaprobacioncredicf` (
  `preaprobacioncrediid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`preaprobacioncrediid`),
  CONSTRAINT `fk_1_vtiger_preaprobacioncredicfpreaprobacioncrediid` FOREIGN KEY (`preaprobacioncrediid`) REFERENCES `vtiger_preaprobacioncredi` (`preaprobacioncrediid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_prendaauto1` (
  `prendaauto1id` int(11) NOT NULL AUTO_INCREMENT,
  `prendaauto1` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`prendaauto1id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_prendaauto2` (
  `prendaauto2id` int(11) NOT NULL AUTO_INCREMENT,
  `prendaauto2` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`prendaauto2id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_prevision` (
  `previsionid` int(11) NOT NULL AUTO_INCREMENT,
  `prevision` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`previsionid`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_pricebook` (
  `pricebookid` int(10) NOT NULL DEFAULT '0',
  `pricebook_no` varchar(100) NOT NULL,
  `bookname` varchar(100) DEFAULT NULL,
  `active` smallint(1) DEFAULT NULL,
  `currency_id` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`pricebookid`),
  CONSTRAINT `fk_1_vtiger_pricebook` FOREIGN KEY (`pricebookid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_pricebookcf` (
  `pricebookid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`pricebookid`),
  CONSTRAINT `fk_1_vtiger_pricebookcf` FOREIGN KEY (`pricebookid`) REFERENCES `vtiger_pricebook` (`pricebookid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_pricebookproductrel` (
  `pricebookid` int(10) NOT NULL,
  `productid` int(10) NOT NULL,
  `listprice` decimal(28,8) DEFAULT NULL,
  `usedcurrency` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`pricebookid`,`productid`),
  KEY `pricebookproductrel_pricebookid_idx` (`pricebookid`),
  KEY `pricebookproductrel_productid_idx` (`productid`),
  CONSTRAINT `fk_1_vtiger_pricebookproductrel` FOREIGN KEY (`pricebookid`) REFERENCES `vtiger_pricebook` (`pricebookid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_priority` (
  `priorityid` int(10) NOT NULL AUTO_INCREMENT,
  `priority` varchar(200) NOT NULL,
  `sortorderid` int(10) NOT NULL DEFAULT '0',
  `presence` int(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`priorityid`),
  UNIQUE KEY `priority_priority_idx` (`priority`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_productcf` (
  `productid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`productid`),
  CONSTRAINT `fk_1_vtiger_productcf` FOREIGN KEY (`productid`) REFERENCES `vtiger_products` (`productid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_productcurrencyrel` (
  `productid` int(10) NOT NULL,
  `currencyid` int(10) NOT NULL,
  `converted_price` decimal(28,8) DEFAULT NULL,
  `actual_price` decimal(28,8) DEFAULT NULL,
  KEY `productid` (`productid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_products` (
  `productid` int(10) NOT NULL,
  `product_no` varchar(100) NOT NULL,
  `productname` varchar(100) DEFAULT NULL,
  `productcode` varchar(40) DEFAULT NULL,
  `pscategory` varchar(200) DEFAULT NULL,
  `manufacturer` varchar(200) DEFAULT NULL,
  `qty_per_unit` decimal(11,2) DEFAULT '0.00',
  `unit_price` decimal(25,8) DEFAULT NULL,
  `weight` decimal(11,3) DEFAULT NULL,
  `pack_size` int(10) DEFAULT NULL,
  `sales_start_date` date DEFAULT NULL,
  `sales_end_date` date DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `expiry_date` date DEFAULT NULL,
  `cost_factor` int(10) DEFAULT NULL,
  `commissionrate` decimal(7,3) DEFAULT NULL,
  `commissionmethod` varchar(50) DEFAULT NULL,
  `discontinued` tinyint(1) NOT NULL DEFAULT '0',
  `usageunit` varchar(200) DEFAULT NULL,
  `reorderlevel` int(10) DEFAULT NULL,
  `website` varchar(100) DEFAULT NULL,
  `mfr_part_no` varchar(200) DEFAULT NULL,
  `vendor_part_no` varchar(200) DEFAULT NULL,
  `serialno` varchar(200) DEFAULT NULL,
  `qtyinstock` decimal(25,3) DEFAULT NULL,
  `productsheet` varchar(200) DEFAULT NULL,
  `qtyindemand` int(10) DEFAULT NULL,
  `glacct` varchar(200) DEFAULT NULL,
  `vendor_id` int(10) DEFAULT NULL,
  `imagename` text,
  `currency_id` int(10) NOT NULL DEFAULT '1',
  `taxes` varchar(50) DEFAULT NULL,
  `ean` varchar(30) DEFAULT NULL,
  `subunit` varchar(255) DEFAULT '',
  `renewable` tinyint(1) DEFAULT '0',
  `category_multipicklist` text,
  PRIMARY KEY (`productid`),
  CONSTRAINT `fk_1_vtiger_products` FOREIGN KEY (`productid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_profile` (
  `profileid` int(10) NOT NULL AUTO_INCREMENT,
  `profilename` varchar(50) NOT NULL,
  `description` text,
  `directly_related_to_role` int(1) DEFAULT '0',
  PRIMARY KEY (`profileid`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_profile2field` (
  `profileid` int(10) NOT NULL,
  `tabid` smallint(5) DEFAULT NULL,
  `fieldid` int(10) NOT NULL,
  `visible` int(10) DEFAULT NULL,
  `readonly` int(10) DEFAULT NULL,
  PRIMARY KEY (`profileid`,`fieldid`),
  KEY `profile2field_profileid_tabid_fieldname_idx` (`profileid`,`tabid`),
  KEY `profile2field_tabid_profileid_idx` (`tabid`,`profileid`),
  KEY `profile2field_visible_profileid_idx` (`visible`,`profileid`),
  CONSTRAINT `vtiger_profile2field_ibfk_1` FOREIGN KEY (`profileid`) REFERENCES `vtiger_profile` (`profileid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_profile2globalpermissions` (
  `profileid` int(10) NOT NULL,
  `globalactionid` int(10) NOT NULL,
  `globalactionpermission` int(10) DEFAULT NULL,
  PRIMARY KEY (`profileid`,`globalactionid`),
  KEY `idx_profile2globalpermissions` (`profileid`,`globalactionid`),
  CONSTRAINT `fk_1_vtiger_profile2globalpermissions` FOREIGN KEY (`profileid`) REFERENCES `vtiger_profile` (`profileid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_profile2standardpermissions` (
  `profileid` smallint(5) unsigned NOT NULL,
  `tabid` smallint(5) unsigned NOT NULL,
  `operation` smallint(5) unsigned NOT NULL,
  `permissions` tinyint(1) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`profileid`,`tabid`,`operation`),
  KEY `profile2standardpermissions_profileid_tabid_operation_idx` (`profileid`,`tabid`,`operation`),
  KEY `profileid` (`profileid`,`tabid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_profile2tab` (
  `profileid` int(10) DEFAULT NULL,
  `tabid` smallint(5) DEFAULT NULL,
  `permissions` int(10) NOT NULL DEFAULT '0',
  KEY `profile2tab_profileid_tabid_idx` (`profileid`,`tabid`),
  CONSTRAINT `vtiger_profile2tab_ibfk_1` FOREIGN KEY (`profileid`) REFERENCES `vtiger_profile` (`profileid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_profile2utility` (
  `profileid` int(10) NOT NULL,
  `tabid` smallint(5) NOT NULL,
  `activityid` int(10) NOT NULL,
  `permission` int(1) DEFAULT NULL,
  PRIMARY KEY (`profileid`,`tabid`,`activityid`),
  KEY `profile2utility_tabid_activityid_idx` (`tabid`,`activityid`),
  KEY `profile2utility_profileid` (`profileid`),
  CONSTRAINT `vtiger_profile2utility_ibfk_1` FOREIGN KEY (`profileid`) REFERENCES `vtiger_profile` (`profileid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_progress` (
  `progressid` int(10) NOT NULL AUTO_INCREMENT,
  `progress` 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 (`progressid`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_progress_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_project` (
  `projectid` int(10) NOT NULL,
  `projectname` varchar(255) DEFAULT NULL,
  `project_no` varchar(100) DEFAULT NULL,
  `startdate` date DEFAULT NULL,
  `targetenddate` date DEFAULT NULL,
  `actualenddate` date DEFAULT NULL,
  `targetbudget` varchar(255) DEFAULT NULL,
  `projecturl` varchar(255) DEFAULT NULL,
  `projectstatus` varchar(100) DEFAULT NULL,
  `projectpriority` varchar(100) DEFAULT NULL,
  `projecttype` varchar(100) DEFAULT NULL,
  `progress` varchar(100) DEFAULT NULL,
  `linktoaccountscontacts` int(10) DEFAULT NULL,
  `sum_time` decimal(10,2) DEFAULT '0.00',
  `servicecontractsid` int(10) DEFAULT NULL,
  `ssalesprocessesid` int(10) DEFAULT NULL,
  `parentid` int(10) DEFAULT NULL,
  PRIMARY KEY (`projectid`),
  KEY `servicecontractsid` (`servicecontractsid`),
  KEY `linktoaccountscontacts` (`linktoaccountscontacts`),
  KEY `projectname` (`projectname`),
  KEY `ssalesprocessesid` (`ssalesprocessesid`),
  KEY `project_parentid_idx` (`parentid`),
  KEY `project_no` (`project_no`),
  CONSTRAINT `vtiger_project_ibfk_1` FOREIGN KEY (`projectid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projectcf` (
  `projectid` int(10) NOT NULL,
  PRIMARY KEY (`projectid`),
  CONSTRAINT `vtiger_projectcf_ibfk_1` FOREIGN KEY (`projectid`) REFERENCES `vtiger_project` (`projectid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projectmilestone` (
  `projectmilestoneid` int(10) NOT NULL,
  `projectmilestonename` varchar(255) DEFAULT NULL,
  `projectmilestone_no` varchar(100) DEFAULT NULL,
  `projectmilestonedate` varchar(255) DEFAULT NULL,
  `projectid` int(10) DEFAULT NULL,
  `projectmilestonetype` varchar(100) DEFAULT NULL,
  `projectmilestone_priority` varchar(255) DEFAULT NULL,
  `projectmilestone_progress` varchar(10) DEFAULT NULL,
  `sum_time` decimal(10,2) DEFAULT '0.00',
  PRIMARY KEY (`projectmilestoneid`),
  KEY `projectid` (`projectid`),
  CONSTRAINT `vtiger_projectmilestone_ibfk_1` FOREIGN KEY (`projectmilestoneid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projectmilestone_priority` (
  `projectmilestone_priorityid` int(10) NOT NULL AUTO_INCREMENT,
  `projectmilestone_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 (`projectmilestone_priorityid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projectmilestone_priority_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projectmilestonecf` (
  `projectmilestoneid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`projectmilestoneid`),
  CONSTRAINT `vtiger_projectmilestonecf_ibfk_1` FOREIGN KEY (`projectmilestoneid`) REFERENCES `vtiger_projectmilestone` (`projectmilestoneid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projectmilestonetype` (
  `projectmilestonetypeid` int(10) NOT NULL AUTO_INCREMENT,
  `projectmilestonetype` 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 (`projectmilestonetypeid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projectmilestonetype_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projectpriority` (
  `projectpriorityid` int(10) NOT NULL AUTO_INCREMENT,
  `projectpriority` 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 (`projectpriorityid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projectpriority_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projectstatus` (
  `projectstatusid` int(10) NOT NULL AUTO_INCREMENT,
  `projectstatus` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT '1',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT '0',
  `color` varchar(25) DEFAULT '#E6FAD8',
  PRIMARY KEY (`projectstatusid`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projectstatus_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projecttask` (
  `projecttaskid` int(10) NOT NULL,
  `projecttaskname` varchar(255) DEFAULT NULL,
  `projecttask_no` varchar(100) DEFAULT NULL,
  `projecttasktype` varchar(100) DEFAULT NULL,
  `projecttaskpriority` varchar(100) DEFAULT NULL,
  `projecttaskprogress` varchar(100) DEFAULT NULL,
  `startdate` date DEFAULT NULL,
  `enddate` date DEFAULT NULL,
  `projectid` int(10) DEFAULT NULL,
  `projecttasknumber` int(10) DEFAULT NULL,
  `projecttaskstatus` varchar(100) DEFAULT NULL,
  `sum_time` decimal(10,2) DEFAULT '0.00',
  `parentid` int(10) DEFAULT NULL,
  `projectmilestoneid` int(10) DEFAULT NULL,
  `targetenddate` date DEFAULT NULL,
  `estimated_work_time` decimal(8,2) DEFAULT NULL,
  PRIMARY KEY (`projecttaskid`),
  KEY `parentid` (`parentid`),
  KEY `projectmilestoneid` (`projectmilestoneid`),
  KEY `projectid` (`projectid`),
  KEY `projecttaskname` (`projecttaskname`),
  CONSTRAINT `vtiger_projecttask_ibfk_1` FOREIGN KEY (`projecttaskid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projecttaskcf` (
  `projecttaskid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`projecttaskid`),
  CONSTRAINT `vtiger_projecttaskcf_ibfk_1` FOREIGN KEY (`projecttaskid`) REFERENCES `vtiger_projecttask` (`projecttaskid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projecttaskpriority` (
  `projecttaskpriorityid` int(10) NOT NULL AUTO_INCREMENT,
  `projecttaskpriority` 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 (`projecttaskpriorityid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projecttaskpriority_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projecttaskprogress` (
  `projecttaskprogressid` int(10) NOT NULL AUTO_INCREMENT,
  `projecttaskprogress` 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 (`projecttaskprogressid`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projecttaskprogress_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projecttaskstatus` (
  `projecttaskstatusid` int(10) NOT NULL AUTO_INCREMENT,
  `projecttaskstatus` 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 (`projecttaskstatusid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projecttaskstatus_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projecttasktype` (
  `projecttasktypeid` int(10) NOT NULL AUTO_INCREMENT,
  `projecttasktype` 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 (`projecttasktypeid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projecttasktype_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projecttype` (
  `projecttypeid` int(10) NOT NULL AUTO_INCREMENT,
  `projecttype` 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 (`projecttypeid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_projecttype_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_propiedad` (
  `propiedadid` int(11) NOT NULL AUTO_INCREMENT,
  `propiedad` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`propiedadid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_proviene` (
  `provieneid` int(11) NOT NULL AUTO_INCREMENT,
  `proviene` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`provieneid`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_provienede` (
  `provienedeid` int(11) NOT NULL AUTO_INCREMENT,
  `provienede` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`provienedeid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_provincia` (
  `provinciaid` int(11) NOT NULL AUTO_INCREMENT,
  `provincia` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`provinciaid`)
) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_provinciabi1` (
  `provinciabi1id` int(11) NOT NULL AUTO_INCREMENT,
  `provinciabi1` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`provinciabi1id`)
) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_provinciabi2` (
  `provinciabi2id` int(11) NOT NULL AUTO_INCREMENT,
  `provinciabi2` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`provinciabi2id`)
) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_provinciacli` (
  `provinciacliid` int(11) NOT NULL AUTO_INCREMENT,
  `provinciacli` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`provinciacliid`)
) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_provinciadelcaso` (
  `provinciadelcasoid` int(11) NOT NULL AUTO_INCREMENT,
  `provinciadelcaso` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`provinciadelcasoid`)
) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_provinciadelcliente` (
  `provinciadelclienteid` int(11) NOT NULL AUTO_INCREMENT,
  `provinciadelcliente` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`provinciadelclienteid`)
) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_provinciaempleador` (
  `provinciaempleadorid` int(11) NOT NULL AUTO_INCREMENT,
  `provinciaempleador` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`provinciaempleadorid`)
) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_pruebademandacomercial` (
  `pruebademandacomercialid` int(11) NOT NULL,
  `pruebaddacom` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `rut` varchar(15) DEFAULT '',
  `nombre` varchar(100) DEFAULT '',
  PRIMARY KEY (`pruebademandacomercialid`),
  CONSTRAINT `fk_1_vtiger_pruebademandacomercialpruebademandacomercialid` FOREIGN KEY (`pruebademandacomercialid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_pruebademandacomercialcf` (
  `pruebademandacomercialid` int(11) NOT NULL,
  PRIMARY KEY (`pruebademandacomercialid`),
  CONSTRAINT `fk_1_vtiger_pruebademandacomercialcfpruebademandacomercialid` FOREIGN KEY (`pruebademandacomercialid`) REFERENCES `vtiger_pruebademandacomercial` (`pruebademandacomercialid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_pruebadocumentos` (
  `pruebadocumentosid` int(11) NOT NULL,
  `id` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `reldoc` int(11) unsigned DEFAULT '0',
  PRIMARY KEY (`pruebadocumentosid`),
  KEY `vtiger_pruebadocumentos_reldoc_idx` (`reldoc`),
  CONSTRAINT `fk_1_vtiger_pruebadocumentospruebadocumentosid` FOREIGN KEY (`pruebadocumentosid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_pruebadocumentoscf` (
  `pruebadocumentosid` int(11) NOT NULL,
  PRIMARY KEY (`pruebadocumentosid`),
  CONSTRAINT `fk_1_vtiger_pruebadocumentoscfpruebadocumentosid` FOREIGN KEY (`pruebadocumentosid`) REFERENCES `vtiger_pruebadocumentos` (`pruebadocumentosid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_publicholiday` (
  `publicholidayid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id of public holiday',
  `holidaydate` date NOT NULL COMMENT 'date of holiday',
  `holidayname` varchar(255) NOT NULL COMMENT 'name of holiday',
  `holidaytype` varchar(25) DEFAULT NULL COMMENT 'type of holiday',
  PRIMARY KEY (`publicholidayid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_quiendenuncio` (
  `quiendenuncioid` int(11) NOT NULL AUTO_INCREMENT,
  `quiendenuncio` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`quiendenuncioid`)
) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_quienenvioppto` (
  `quienenviopptoid` int(11) NOT NULL AUTO_INCREMENT,
  `quienenvioppto` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`quienenviopptoid`)
) ENGINE=InnoDB AUTO_INCREMENT=247 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_rangohorpre` (
  `rangohorpreid` int(11) NOT NULL AUTO_INCREMENT,
  `rangohorpre` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`rangohorpreid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_razongestionarprogreso` (
  `razongestionarprogresoid` int(11) NOT NULL AUTO_INCREMENT,
  `razongestionarprogreso` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`razongestionarprogresoid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_razonnoaplica` (
  `razonnoaplicaid` int(11) NOT NULL AUTO_INCREMENT,
  `razonnoaplica` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  `color` varchar(25) DEFAULT NULL,
  PRIMARY KEY (`razonnoaplicaid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_realization_process` (
  `module_id` int(10) NOT NULL,
  `status_indicate_closing` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_reconocimientodeuda` (
  `reconocimientodeudaid` int(11) NOT NULL,
  `id` int(11) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `rut` varchar(20) DEFAULT '',
  `rol` varchar(30) DEFAULT '',
  `caratula` varchar(101) DEFAULT '',
  `tribunalcompetente` varchar(255) DEFAULT '',
  `tribunalradicado` varchar(255) DEFAULT '',
  `estadodda` varchar(255) DEFAULT '',
  `bienesembargados` varchar(255) DEFAULT '',
  `caratuladc` varchar(101) DEFAULT '',
  `roldc` varchar(40) DEFAULT '',
  `estadoddadc` varchar(255) DEFAULT '',
  `resultadoaudiencia` varchar(255) DEFAULT '',
  `generargestprep` tinyint(1) DEFAULT '0',
  `generarcumpleord` tinyint(1) DEFAULT '0',
  `genart44` tinyint(1) DEFAULT '0',
  `generarformato` tinyint(1) DEFAULT '0',
  `generardemanda` 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` int(3) DEFAULT '0',
  `estadobusqueda` varchar(255) DEFAULT '',
  `not44` int(3) DEFAULT '0',
  `estadonot44` varchar(255) DEFAULT '',
  `notporcedula` int(3) DEFAULT '0',
  `estadonotcedula` varchar(255) DEFAULT '',
  `notpersonal` int(3) DEFAULT '0',
  `estadonotpersonal` varchar(255) DEFAULT '',
  `embargos` int(3) DEFAULT '0',
  `estadoembargo` varchar(255) DEFAULT '',
  `preciobusquedas` bigint(20) DEFAULT '0',
  `precionotcedula` bigint(20) DEFAULT '0',
  `precionot44` bigint(20) DEFAULT '0',
  `precioembargo` bigint(20) DEFAULT '0',
  `precionotpersonal` bigint(20) DEFAULT '0',
  `totalapagar` bigint(30) DEFAULT '0',
  `pagohistorico` bigint(30) DEFAULT '0',
  `estadocobranza` varchar(30) DEFAULT '',
  `indem` bigint(35) DEFAULT '0',
  `ciudadnotificacion` varchar(30) DEFAULT '',
  `direcnot` varchar(30) DEFAULT '',
  `montofact` bigint(30) DEFAULT '0',
  `correo` varchar(30) DEFAULT '',
  `telefono` varchar(30) DEFAULT '',
  `idcobranza` varchar(30) DEFAULT '',
  `relacioncobranza` int(11) unsigned DEFAULT '0',
  `pagar` tinyint(1) DEFAULT '0',
  `rolrecursoqueja` varchar(40) DEFAULT '',
  `claseapelacion` varchar(255) DEFAULT '',
  `rolapelacion` varchar(40) DEFAULT '',
  `clasecasacion` varchar(255) DEFAULT '',
  `rolrecursocasacion` varchar(40) DEFAULT '',
  `rolrecursohecho` varchar(40) DEFAULT '',
  `formatoica` tinyint(1) DEFAULT '0',
  `fechaaudienciaconfe` date DEFAULT NULL,
  `nrofacturasus` varchar(20) DEFAULT '',
  `nrofacturaasesoria` varchar(20) DEFAULT '',
  `fechafacturasus` date DEFAULT NULL,
  `fechafacturaasesoria` date DEFAULT NULL,
  `fechavencimientofacturasus` date DEFAULT NULL,
  `fechavencimientofacturaas` date DEFAULT NULL,
  `totaldeudasus` bigint(30) DEFAULT '0',
  `totaldeudaas` bigint(40) DEFAULT '0',
  `deudatotal` bigint(40) DEFAULT '0',
  `bienesembargadosdc` varchar(255) DEFAULT '',
  `ddasinopsusas` tinyint(1) DEFAULT '0',
  `ddaconopsussas` tinyint(1) DEFAULT '0',
  `generargestprepsusas` tinyint(1) DEFAULT '0',
  `demandado` int(11) unsigned DEFAULT '0',
  `nrocaso` int(11) unsigned DEFAULT '0',
  `comuna` varchar(255) DEFAULT '',
  `tribunalradicadodc` varchar(255) DEFAULT '',
  `cortecompetente` varchar(255) DEFAULT '',
  `tribunalcompetentedc` varchar(255) DEFAULT '',
  `listaprueba` varchar(255) DEFAULT '',
  `fechaaudpend` varchar(255) DEFAULT '',
  PRIMARY KEY (`reconocimientodeudaid`),
  KEY `vtiger_reconocimientodeuda_relacioncobranza_idx` (`relacioncobranza`),
  KEY `vtiger_reconocimientodeuda_demandado_idx` (`demandado`),
  KEY `vtiger_reconocimientodeuda_nrocaso_idx` (`nrocaso`),
  CONSTRAINT `fk_1_vtiger_reconocimientodeudareconocimientodeudaid` FOREIGN KEY (`reconocimientodeudaid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_reconocimientodeuda_inventory` (
  `id` int(11) DEFAULT NULL,
  `seq` int(10) DEFAULT NULL,
  KEY `reconocimientodeuda_inventory_idx` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_reconocimientodeuda_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_reconocimientodeuda_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_reconocimientodeudacf` (
  `reconocimientodeudaid` int(11) NOT NULL,
  PRIMARY KEY (`reconocimientodeudaid`),
  CONSTRAINT `fk_1_vtiger_reconocimientodeudacfreconocimientodeudaid` FOREIGN KEY (`reconocimientodeudaid`) REFERENCES `vtiger_reconocimientodeuda` (`reconocimientodeudaid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_recurring_frequency` (
  `recurring_frequency_id` int(10) DEFAULT NULL,
  `recurring_frequency` varchar(200) DEFAULT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_recurring_frequency_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_region` (
  `regionid` int(11) NOT NULL AUTO_INCREMENT,
  `region` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`regionid`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_regionbi1` (
  `regionbi1id` int(11) NOT NULL AUTO_INCREMENT,
  `regionbi1` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`regionbi1id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_regionbi2` (
  `regionbi2id` int(11) NOT NULL AUTO_INCREMENT,
  `regionbi2` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`regionbi2id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_regioncli` (
  `regioncliid` int(11) NOT NULL AUTO_INCREMENT,
  `regioncli` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`regioncliid`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_regiondelcaso` (
  `regiondelcasoid` int(11) NOT NULL AUTO_INCREMENT,
  `regiondelcaso` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`regiondelcasoid`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_regiondelcliente` (
  `regiondelclienteid` int(11) NOT NULL AUTO_INCREMENT,
  `regiondelcliente` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`regiondelclienteid`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_regionempleador` (
  `regionempleadorid` int(11) NOT NULL AUTO_INCREMENT,
  `regionempleador` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`regionempleadorid`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_rel_mod` (
  `rel_modid` int(10) NOT NULL AUTO_INCREMENT,
  `rel_mod` 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 (`rel_modid`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_rel_mod_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_relatedlists` (
  `relation_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `tabid` smallint(5) unsigned NOT NULL,
  `related_tabid` smallint(5) unsigned NOT NULL,
  `name` varchar(50) DEFAULT NULL,
  `sequence` tinyint(3) unsigned NOT NULL,
  `label` varchar(50) NOT NULL,
  `presence` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `actions` varchar(50) NOT NULL DEFAULT '',
  `favorites` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `creator_detail` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `relation_comment` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `view_type` varchar(100) NOT NULL DEFAULT 'RelatedTab',
  PRIMARY KEY (`relation_id`),
  KEY `tabid` (`tabid`),
  KEY `related_tabid` (`related_tabid`),
  KEY `tabid_2` (`tabid`,`related_tabid`),
  KEY `tabid_3` (`tabid`,`related_tabid`,`label`),
  KEY `tabid_4` (`tabid`,`related_tabid`,`presence`)
) ENGINE=InnoDB AUTO_INCREMENT=743 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_relatedlists_fields` (
  `relation_id` int(10) DEFAULT NULL,
  `fieldid` int(10) DEFAULT NULL,
  `fieldname` varchar(30) DEFAULT NULL,
  `sequence` int(10) DEFAULT NULL,
  KEY `relation_id` (`relation_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_relcriteria` (
  `queryid` 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(256) DEFAULT 'and',
  PRIMARY KEY (`queryid`,`columnindex`),
  KEY `relcriteria_queryid_idx` (`queryid`),
  CONSTRAINT `fk_1_vtiger_relcriteria` FOREIGN KEY (`queryid`) REFERENCES `vtiger_selectquery` (`queryid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_relcriteria_grouping` (
  `groupid` int(10) NOT NULL,
  `queryid` int(10) NOT NULL,
  `group_condition` varchar(256) DEFAULT NULL,
  `condition_expression` text,
  PRIMARY KEY (`groupid`,`queryid`),
  KEY `queryid` (`queryid`),
  CONSTRAINT `vtiger_relcriteria_grouping_ibfk_1` FOREIGN KEY (`queryid`) REFERENCES `vtiger_relcriteria` (`queryid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_reminder_interval` (
  `reminder_intervalid` int(10) NOT NULL AUTO_INCREMENT,
  `reminder_interval` varchar(200) NOT NULL,
  `sortorderid` int(10) NOT NULL,
  `presence` int(1) NOT NULL,
  PRIMARY KEY (`reminder_intervalid`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_reminder_interval_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_report` (
  `reportid` int(10) NOT NULL,
  `folderid` int(10) NOT NULL,
  `reportname` varchar(100) DEFAULT '',
  `description` varchar(250) DEFAULT '',
  `reporttype` varchar(50) DEFAULT '',
  `queryid` int(10) NOT NULL DEFAULT '0',
  `state` varchar(50) DEFAULT 'SAVED',
  `customizable` int(1) DEFAULT '1',
  `category` int(10) DEFAULT '1',
  `owner` int(10) DEFAULT '1',
  `sharingtype` varchar(200) DEFAULT 'Private',
  PRIMARY KEY (`reportid`),
  KEY `report_queryid_idx` (`queryid`),
  KEY `report_folderid_idx` (`folderid`),
  CONSTRAINT `fk_2_vtiger_report` FOREIGN KEY (`queryid`) REFERENCES `vtiger_selectquery` (`queryid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_reportdatefilter` (
  `datefilterid` int(10) NOT NULL,
  `datecolumnname` varchar(250) DEFAULT '',
  `datefilter` varchar(250) DEFAULT '',
  `startdate` date DEFAULT NULL,
  `enddate` date DEFAULT NULL,
  PRIMARY KEY (`datefilterid`),
  KEY `reportdatefilter_datefilterid_idx` (`datefilterid`),
  CONSTRAINT `fk_1_vtiger_reportdatefilter` FOREIGN KEY (`datefilterid`) REFERENCES `vtiger_report` (`reportid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_reportfilters` (
  `filterid` int(10) NOT NULL,
  `name` varchar(200) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_reportfolder` (
  `folderid` int(10) NOT NULL AUTO_INCREMENT,
  `foldername` varchar(100) NOT NULL DEFAULT '',
  `description` varchar(250) DEFAULT '',
  `state` varchar(50) DEFAULT 'SAVED',
  PRIMARY KEY (`folderid`)
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_reportgroupbycolumn` (
  `reportid` int(10) DEFAULT NULL,
  `sortid` int(10) DEFAULT NULL,
  `sortcolname` varchar(250) DEFAULT NULL,
  `dategroupbycriteria` varchar(250) DEFAULT NULL,
  KEY `fk_1_vtiger_reportgroupbycolumn` (`reportid`),
  CONSTRAINT `fk_1_vtiger_reportgroupbycolumn` FOREIGN KEY (`reportid`) REFERENCES `vtiger_report` (`reportid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_reportmodules` (
  `reportmodulesid` int(10) NOT NULL,
  `primarymodule` varchar(50) NOT NULL DEFAULT '',
  `secondarymodules` varchar(250) DEFAULT '',
  PRIMARY KEY (`reportmodulesid`),
  CONSTRAINT `fk_1_vtiger_reportmodules` FOREIGN KEY (`reportmodulesid`) REFERENCES `vtiger_report` (`reportid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_reportsharing` (
  `reportid` int(10) NOT NULL,
  `shareid` int(10) NOT NULL,
  `setype` varchar(200) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_reportsortcol` (
  `sortcolid` int(10) NOT NULL,
  `reportid` int(10) NOT NULL,
  `columnname` varchar(250) DEFAULT '',
  `sortorder` varchar(250) DEFAULT 'Asc',
  PRIMARY KEY (`sortcolid`,`reportid`),
  KEY `fk_1_vtiger_reportsortcol` (`reportid`),
  CONSTRAINT `fk_1_vtiger_reportsortcol` FOREIGN KEY (`reportid`) REFERENCES `vtiger_report` (`reportid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_reportsummary` (
  `reportsummaryid` int(10) NOT NULL,
  `summarytype` int(10) NOT NULL,
  `columnname` varchar(250) NOT NULL DEFAULT '',
  PRIMARY KEY (`reportsummaryid`,`summarytype`,`columnname`),
  KEY `reportsummary_reportsummaryid_idx` (`reportsummaryid`),
  CONSTRAINT `fk_1_vtiger_reportsummary` FOREIGN KEY (`reportsummaryid`) REFERENCES `vtiger_report` (`reportid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_reporttype` (
  `reportid` int(10) NOT NULL,
  `data` text,
  PRIMARY KEY (`reportid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_reservations` (
  `reservationsid` int(10) NOT NULL DEFAULT '0',
  `title` varchar(128) DEFAULT NULL,
  `reservations_no` varchar(255) DEFAULT NULL,
  `reservations_status` varchar(128) DEFAULT NULL,
  `date_start` date NOT NULL,
  `time_start` varchar(50) DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `time_end` varchar(50) DEFAULT NULL,
  `sum_time` decimal(10,2) DEFAULT '0.00',
  `link` int(10) DEFAULT '0',
  `process` int(10) DEFAULT '0',
  `deleted` int(1) DEFAULT '0',
  `type` varchar(128) DEFAULT NULL,
  `subprocess` int(10) DEFAULT '0',
  `linkextend` int(10) DEFAULT NULL,
  PRIMARY KEY (`reservationsid`),
  KEY `process` (`process`),
  KEY `link` (`link`),
  KEY `subprocess` (`subprocess`),
  KEY `linkextend` (`linkextend`),
  KEY `deleted` (`deleted`),
  CONSTRAINT `vtiger_reservations` FOREIGN KEY (`reservationsid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_reservations_inventory` (
  `id` int(11) DEFAULT NULL,
  `seq` int(10) DEFAULT NULL,
  KEY `reservations_inventory_idx` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_reservations_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_reservations_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_reservations_status` (
  `reservations_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `reservations_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 (`reservations_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_reservations_status_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_reservationscf` (
  `reservationsid` int(10) NOT NULL,
  PRIMARY KEY (`reservationsid`),
  CONSTRAINT `vtiger_reservationscf` FOREIGN KEY (`reservationsid`) REFERENCES `vtiger_reservations` (`reservationsid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_resultadoaudiencia` (
  `resultadoaudienciaid` int(11) NOT NULL AUTO_INCREMENT,
  `resultadoaudiencia` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`resultadoaudienciaid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_resultgestion` (
  `resultgestionid` int(11) NOT NULL AUTO_INCREMENT,
  `resultgestion` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`resultgestionid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_retencionventas` (
  `retencionventasid` int(11) NOT NULL AUTO_INCREMENT,
  `retencionventas` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`retencionventasid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_role` (
  `roleid` varchar(255) NOT NULL,
  `rolename` varchar(200) DEFAULT NULL,
  `parentrole` varchar(255) DEFAULT NULL,
  `depth` smallint(5) unsigned NOT NULL DEFAULT '0',
  `allowassignedrecordsto` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `changeowner` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `searchunpriv` text,
  `clendarallorecords` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `listrelatedrecord` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `previewrelatedrecord` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `editrelatedrecord` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `permissionsrelatedfield` varchar(10) NOT NULL DEFAULT '0',
  `globalsearchadv` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `assignedmultiowner` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `auto_assign` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`roleid`),
  KEY `parentrole` (`parentrole`),
  KEY `parentrole_2` (`parentrole`,`depth`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_role2picklist` (
  `roleid` varchar(255) NOT NULL,
  `picklistvalueid` int(10) NOT NULL,
  `picklistid` int(10) NOT NULL,
  `sortid` int(10) DEFAULT NULL,
  PRIMARY KEY (`roleid`,`picklistvalueid`,`picklistid`),
  KEY `role2picklist_roleid_picklistid_idx` (`roleid`,`picklistid`,`picklistvalueid`),
  KEY `fk_2_vtiger_role2picklist` (`picklistid`),
  CONSTRAINT `fk_1_vtiger_role2picklist` FOREIGN KEY (`roleid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE,
  CONSTRAINT `fk_2_vtiger_role2picklist` FOREIGN KEY (`picklistid`) REFERENCES `vtiger_picklist` (`picklistid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_role2profile` (
  `roleid` varchar(255) NOT NULL,
  `profileid` int(10) NOT NULL,
  PRIMARY KEY (`roleid`,`profileid`),
  KEY `role2profile_roleid_profileid_idx` (`roleid`,`profileid`),
  KEY `roleid` (`roleid`),
  KEY `profileid` (`profileid`),
  CONSTRAINT `vtiger_role2profile_ibfk_1` FOREIGN KEY (`roleid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE,
  CONSTRAINT `vtiger_role2profile_ibfk_2` FOREIGN KEY (`profileid`) REFERENCES `vtiger_profile` (`profileid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_role_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_rowheight` (
  `rowheightid` int(10) NOT NULL AUTO_INCREMENT,
  `rowheight` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`rowheightid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_rowheight_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_rss` (
  `rssid` int(10) NOT NULL AUTO_INCREMENT,
  `rssurl` varchar(200) NOT NULL DEFAULT '',
  `rsstitle` varchar(200) DEFAULT NULL,
  `rsstype` int(10) DEFAULT '0',
  `starred` int(1) DEFAULT '0',
  PRIMARY KEY (`rssid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_rutciaseguros` (
  `rutciasegurosid` int(11) NOT NULL AUTO_INCREMENT,
  `rutciaseguros` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`rutciasegurosid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_rutcomp` (
  `rutcompid` int(11) NOT NULL AUTO_INCREMENT,
  `rutcomp` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`rutcompid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_salesmanattachmentsrel` (
  `smid` int(10) NOT NULL DEFAULT '0',
  `attachmentsid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`smid`,`attachmentsid`),
  KEY `salesmanattachmentsrel_smid_idx` (`smid`),
  KEY `salesmanattachmentsrel_attachmentsid_idx` (`attachmentsid`),
  CONSTRAINT `fk_2_vtiger_salesmanattachmentsrel` FOREIGN KEY (`attachmentsid`) REFERENCES `vtiger_attachments` (`attachmentsid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_salesmanticketrel` (
  `smid` int(10) NOT NULL DEFAULT '0',
  `id` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`smid`,`id`),
  KEY `salesmanticketrel_smid_idx` (`smid`),
  KEY `salesmanticketrel_id_idx` (`id`),
  CONSTRAINT `fk_2_vtiger_salesmanticketrel` FOREIGN KEY (`smid`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_salutationtype` (
  `salutationtypeid` int(10) NOT NULL AUTO_INCREMENT,
  `salutationtype` 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 (`salutationtypeid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_salutationtype_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_scalculations_status` (
  `scalculations_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `scalculations_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 (`scalculations_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_scheduled_reports` (
  `reportid` int(10) NOT NULL,
  `recipients` text,
  `schedule` text,
  `format` varchar(10) DEFAULT NULL,
  `next_trigger_time` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`reportid`),
  CONSTRAINT `vtiger_scheduled_reports_ibfk_1` FOREIGN KEY (`reportid`) REFERENCES `vtiger_report` (`reportid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_schedulereports` (
  `reportid` int(10) DEFAULT NULL,
  `scheduleid` int(3) DEFAULT NULL,
  `recipients` text,
  `schdate` varchar(20) DEFAULT NULL,
  `schtime` time DEFAULT NULL,
  `schdayoftheweek` varchar(100) DEFAULT NULL,
  `schdayofthemonth` varchar(100) DEFAULT NULL,
  `schannualdates` varchar(500) DEFAULT NULL,
  `specificemails` varchar(500) DEFAULT NULL,
  `next_trigger_time` timestamp NULL DEFAULT NULL,
  `filetype` varchar(20) DEFAULT NULL,
  KEY `reportid` (`reportid`),
  CONSTRAINT `vtiger_schedulereports_ibfk_1` FOREIGN KEY (`reportid`) REFERENCES `vtiger_report` (`reportid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_seattachmentsrel` (
  `crmid` int(10) NOT NULL DEFAULT '0',
  `attachmentsid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`crmid`,`attachmentsid`),
  KEY `seattachmentsrel_attachmentsid_idx` (`attachmentsid`),
  KEY `seattachmentsrel_crmid_idx` (`crmid`),
  KEY `seattachmentsrel_attachmentsid_crmid_idx` (`attachmentsid`,`crmid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_selectcolumn` (
  `queryid` int(10) NOT NULL,
  `columnindex` int(10) NOT NULL DEFAULT '0',
  `columnname` varchar(250) DEFAULT '',
  PRIMARY KEY (`queryid`,`columnindex`),
  KEY `selectcolumn_queryid_idx` (`queryid`),
  CONSTRAINT `fk_1_vtiger_selectcolumn` FOREIGN KEY (`queryid`) REFERENCES `vtiger_selectquery` (`queryid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_selectquery` (
  `queryid` int(10) NOT NULL,
  `startindex` int(10) DEFAULT '0',
  `numofobjects` int(10) DEFAULT '0',
  PRIMARY KEY (`queryid`),
  KEY `selectquery_queryid_idx` (`queryid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_selectquery_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_senotesrel` (
  `crmid` int(10) NOT NULL DEFAULT '0',
  `notesid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`crmid`,`notesid`),
  KEY `senotesrel_notesid_idx` (`notesid`),
  KEY `senotesrel_crmid_idx` (`crmid`),
  CONSTRAINT `fk_2_vtiger_senotesrel` FOREIGN KEY (`notesid`) REFERENCES `vtiger_notes` (`notesid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_seproductsrel` (
  `crmid` int(10) NOT NULL DEFAULT '0',
  `productid` int(10) NOT NULL DEFAULT '0',
  `setype` varchar(30) NOT NULL,
  `rel_created_user` int(10) NOT NULL,
  `rel_created_time` datetime NOT NULL,
  `rel_comment` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`crmid`,`productid`),
  KEY `seproductsrel_productid_idx` (`productid`),
  KEY `seproductrel_crmid_idx` (`crmid`),
  CONSTRAINT `fk_2_vtiger_seproductsrel` FOREIGN KEY (`productid`) REFERENCES `vtiger_products` (`productid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_service` (
  `serviceid` int(10) NOT NULL,
  `service_no` varchar(100) NOT NULL,
  `servicename` varchar(255) NOT NULL,
  `pscategory` varchar(200) DEFAULT NULL,
  `qty_per_unit` decimal(11,2) DEFAULT '0.00',
  `unit_price` decimal(25,8) DEFAULT NULL,
  `sales_start_date` date DEFAULT NULL,
  `sales_end_date` date DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `expiry_date` date DEFAULT NULL,
  `discontinued` tinyint(1) NOT NULL DEFAULT '0',
  `service_usageunit` varchar(200) DEFAULT NULL,
  `website` varchar(100) DEFAULT NULL,
  `currency_id` int(10) NOT NULL DEFAULT '1',
  `commissionrate` decimal(7,3) DEFAULT NULL,
  `renewable` tinyint(1) DEFAULT '0',
  `taxes` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`serviceid`),
  CONSTRAINT `fk_1_vtiger_service` FOREIGN KEY (`serviceid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_service_usageunit` (
  `service_usageunitid` int(10) NOT NULL AUTO_INCREMENT,
  `service_usageunit` 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 (`service_usageunitid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_service_usageunit_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_servicecf` (
  `serviceid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`serviceid`),
  CONSTRAINT `vtiger_servicecf_ibfk_1` FOREIGN KEY (`serviceid`) REFERENCES `vtiger_service` (`serviceid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_servicecontracts` (
  `servicecontractsid` int(10) NOT NULL,
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `sc_related_to` int(10) DEFAULT NULL,
  `tracking_unit` varchar(100) DEFAULT NULL,
  `total_units` decimal(5,2) DEFAULT NULL,
  `used_units` decimal(5,2) DEFAULT NULL,
  `subject` varchar(100) DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `planned_duration` varchar(256) DEFAULT NULL,
  `actual_duration` varchar(256) DEFAULT NULL,
  `contract_status` varchar(200) DEFAULT NULL,
  `priority` varchar(200) DEFAULT NULL,
  `contract_type` varchar(200) DEFAULT NULL,
  `progress` decimal(5,2) DEFAULT NULL,
  `contract_no` varchar(100) DEFAULT NULL,
  `sum_time` decimal(10,2) DEFAULT '0.00',
  PRIMARY KEY (`servicecontractsid`),
  KEY `sc_related_to` (`sc_related_to`),
  CONSTRAINT `vtiger_servicecontracts_ibfk_1` FOREIGN KEY (`servicecontractsid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_servicecontractscf` (
  `servicecontractsid` int(10) NOT NULL,
  PRIMARY KEY (`servicecontractsid`),
  CONSTRAINT `vtiger_servicecontractscf_ibfk_1` FOREIGN KEY (`servicecontractsid`) REFERENCES `vtiger_servicecontracts` (`servicecontractsid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_seticketsrel` (
  `crmid` int(10) NOT NULL DEFAULT '0',
  `ticketid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`crmid`,`ticketid`),
  KEY `seticketsrel_crmid_idx` (`crmid`),
  KEY `seticketsrel_ticketid_idx` (`ticketid`),
  CONSTRAINT `fk_2_vtiger_seticketsrel` FOREIGN KEY (`ticketid`) REFERENCES `vtiger_troubletickets` (`ticketid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_settings_blocks` (
  `blockid` int(10) NOT NULL,
  `label` varchar(250) DEFAULT NULL,
  `sequence` int(10) DEFAULT NULL,
  `icon` varchar(255) DEFAULT NULL,
  `type` tinyint(1) DEFAULT NULL,
  `linkto` text,
  `admin_access` text,
  PRIMARY KEY (`blockid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_settings_blocks_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_settings_field` (
  `fieldid` int(10) NOT NULL AUTO_INCREMENT,
  `blockid` int(10) DEFAULT NULL,
  `name` varchar(250) DEFAULT NULL,
  `iconpath` varchar(300) DEFAULT NULL,
  `description` varchar(250) DEFAULT NULL,
  `linkto` text,
  `sequence` int(10) DEFAULT NULL,
  `active` int(10) DEFAULT '0',
  `pinned` int(1) DEFAULT '0',
  `admin_access` text,
  PRIMARY KEY (`fieldid`),
  KEY `fk_1_vtiger_settings_field` (`blockid`),
  CONSTRAINT `fk_1_vtiger_settings_field` FOREIGN KEY (`blockid`) REFERENCES `vtiger_settings_blocks` (`blockid`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_sharedcalendar` (
  `userid` int(10) NOT NULL,
  `sharedid` int(10) NOT NULL,
  PRIMARY KEY (`userid`,`sharedid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_shorturls` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `uid` varchar(50) DEFAULT NULL,
  `handler_path` varchar(400) DEFAULT NULL,
  `handler_class` varchar(100) DEFAULT NULL,
  `handler_function` varchar(100) DEFAULT NULL,
  `handler_data` varchar(255) DEFAULT NULL,
  `onetime` int(5) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `uid` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_siniestro` (
  `siniestroid` int(11) NOT NULL DEFAULT '0',
  `siniestro` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `estado` varchar(255) DEFAULT '',
  `estado_` varchar(255) DEFAULT NULL,
  `banco` varchar(255) DEFAULT '',
  `campana` varchar(255) DEFAULT '',
  `presrecevaluador` tinyint(1) DEFAULT '0',
  `contratofirmado` tinyint(1) DEFAULT '0',
  `frecepcionpresupuestoeval` date DEFAULT NULL,
  `fcontratofirmado` date DEFAULT NULL,
  `presupuestorevisado` tinyint(1) DEFAULT '0',
  `comentariocontrato` text,
  `frevpresupuesto` date DEFAULT NULL,
  `doctosendec` tinyint(1) DEFAULT '0',
  `obscaso` text,
  `direccionsiniestro` text,
  `comunacaso` varchar(255) DEFAULT '',
  `ciudadcaso` varchar(255) DEFAULT '',
  `mts2` decimal(11,2) DEFAULT NULL,
  `tipopropiedad` varchar(255) DEFAULT '',
  `tiposiniestro` varchar(255) DEFAULT '',
  `nropoliza` varchar(16) DEFAULT '',
  `fsismo` varchar(255) DEFAULT '',
  `nrosiniestro` varchar(16) DEFAULT '',
  `ciaseguros` varchar(255) DEFAULT '',
  `ffiltracionotro` date DEFAULT NULL,
  `quiendenuncio` varchar(255) DEFAULT '',
  `formadenuncia` varchar(255) DEFAULT '',
  `nrodeatencion` varchar(16) DEFAULT '',
  `tlfcontacto` varchar(255) DEFAULT '',
  `entliquidadora` varchar(255) DEFAULT '',
  `infliqimpugnado` tinyint(1) DEFAULT '0',
  `fdenuncio` date DEFAULT NULL,
  `fimpugnacion` date DEFAULT NULL,
  `fasignacionliq` date DEFAULT NULL,
  `respimpugnacion` tinyint(1) DEFAULT '0',
  `fvisita` date DEFAULT NULL,
  `frespimpugnacion` date DEFAULT NULL,
  `actarecibida` tinyint(1) DEFAULT '0',
  `nombreinspector` varchar(32) DEFAULT '',
  `factarecibida` date DEFAULT NULL,
  `nombreanalista` varchar(32) DEFAULT '',
  `fpresupuesto` date DEFAULT NULL,
  `emailanalista` varchar(100) DEFAULT '',
  `evalasignado` varchar(255) DEFAULT '',
  `fpreinforme` date DEFAULT NULL,
  `observacion` text,
  `frecinfliq` date DEFAULT NULL,
  `freinspeccion` date DEFAULT NULL,
  `nrocarpeta` varchar(16) DEFAULT '',
  `evalreinspeccion` varchar(255) DEFAULT '',
  `reinspeccion` tinyint(1) DEFAULT '0',
  `fprorroga` date DEFAULT NULL,
  `declaracionjurada` tinyint(1) DEFAULT '0',
  `venprorroga` date DEFAULT NULL,
  `envdecjurada` date DEFAULT NULL,
  `prorrogado` tinyint(1) DEFAULT '0',
  `perdidareclamada` decimal(19,2) DEFAULT NULL,
  `nrofactura` varchar(16) DEFAULT '',
  `perdidadeterminada` decimal(19,2) DEFAULT NULL,
  `ffactura` date DEFAULT NULL,
  `deducibleafecto` decimal(19,2) DEFAULT NULL,
  `perdidaindemnizable` decimal(19,2) DEFAULT NULL,
  `fpagofactura` date DEFAULT NULL,
  `fprobpagocia` date DEFAULT NULL,
  `fprobablepago` date DEFAULT NULL,
  `observaciones` text,
  `facturapagada` tinyint(1) DEFAULT '0',
  `comprobantepagoenviado` tinyint(1) DEFAULT '0',
  `fcomprobanteenviado` date DEFAULT NULL,
  `facturarinforme` tinyint(1) DEFAULT '0',
  `informefacturado` tinyint(1) DEFAULT '0',
  `nvaperdidadet` decimal(19,2) DEFAULT NULL,
  `nvaperdidaindemnizable` decimal(19,2) DEFAULT NULL,
  `faddendumrebaja` date DEFAULT NULL,
  `facturaraddendum1` tinyint(1) DEFAULT '0',
  `addendum1facturado` tinyint(1) DEFAULT '0',
  `nrofacturaaddedum1` bigint(16) DEFAULT '0',
  `ffacturaaddendum1` date DEFAULT NULL,
  `frecepaddendum1` date DEFAULT NULL,
  `fimpugaddendum1` date DEFAULT NULL,
  `frespimpugaddendum1` date DEFAULT NULL,
  `obsimpugaddendum1` text,
  `frecepaddendum2` date DEFAULT NULL,
  `facturaraddendum2` tinyint(1) DEFAULT '0',
  `addendum2facturado` tinyint(1) DEFAULT '0',
  `nrofacturaaddendum2` bigint(16) DEFAULT '0',
  `montofacturaaddendum2` bigint(16) DEFAULT '0',
  `ffacturaaddendum2` date DEFAULT NULL,
  `solucion` text,
  `cartaenviopresupuesto` tinyint(1) DEFAULT '0',
  `cartarecepinfliq` tinyint(1) DEFAULT '0',
  `captador` varchar(255) DEFAULT '',
  `quienenvioppto` varchar(255) DEFAULT '',
  `comunadelcaso` varchar(255) DEFAULT '',
  `provinciadelcaso` varchar(255) DEFAULT '',
  `regiondelcaso` varchar(255) DEFAULT '',
  `montopresupuesto` bigint(64) DEFAULT '0',
  `valorfactura` bigint(64) DEFAULT '0',
  `montofacturaaddendum1` bigint(64) DEFAULT '0',
  `valorufestimado` bigint(64) DEFAULT '0',
  `nombrecliente` int(11) unsigned DEFAULT '0',
  `fedoprogreso` date DEFAULT NULL,
  `fedoliqasig` date DEFAULT NULL,
  `fedovisprog` date DEFAULT NULL,
  `fedovisreal` date DEFAULT NULL,
  `fedoesperando` date DEFAULT NULL,
  `edocomercialasesor` varchar(255) DEFAULT '',
  `montoesperado` decimal(22,8) DEFAULT NULL,
  `montoesperadofirma` decimal(22,8) DEFAULT NULL,
  `montoesperadovisita` decimal(22,8) DEFAULT NULL,
  `firmapagada` tinyint(1) DEFAULT '0',
  `convisitapagada` tinyint(1) DEFAULT '0',
  `fpagofirma` date DEFAULT NULL,
  `fpagovisitaasesor` date DEFAULT NULL,
  `montototalrecibido` decimal(22,8) DEFAULT NULL,
  `obsdelsistema` text,
  `descontado` tinyint(1) DEFAULT '0',
  `fdescuento` date DEFAULT NULL,
  `indemnizacion` bigint(64) DEFAULT '0',
  `valoruf` decimal(62,2) DEFAULT NULL,
  `rechazocia` tinyint(1) DEFAULT '0',
  `montoaddendum1` decimal(65,2) DEFAULT NULL,
  `montoaddendum2` decimal(22,2) DEFAULT NULL,
  `pertenecealgrupo` varchar(255) DEFAULT '',
  `rechazoliqcob` tinyint(1) DEFAULT '0',
  `clasificadodemanda` tinyint(1) DEFAULT '0',
  `fclasificaciondemanda` date DEFAULT NULL,
  `gestionardemanda` tinyint(1) DEFAULT '0',
  `fgestionardemanda` date DEFAULT NULL,
  `bancopago` varchar(255) DEFAULT '',
  `tipopago` varchar(255) DEFAULT '',
  `cartaresolucion` tinyint(1) DEFAULT '0',
  `freccartares` date DEFAULT NULL,
  `conpago` tinyint(1) DEFAULT '0',
  `tipoinspeccion` varchar(255) DEFAULT '',
  `cargofijo` tinyint(1) DEFAULT '0',
  `facurarcf` tinyint(1) DEFAULT '0',
  `descuentocf` tinyint(1) DEFAULT '0',
  `facturadocf` tinyint(1) DEFAULT '0',
  `fpreinsp` date DEFAULT NULL,
  `evalpreinsp` varchar(255) DEFAULT '',
  `preinsprealizada` tinyint(1) DEFAULT '0',
  `presupuestopreinsprecibido` tinyint(1) DEFAULT '0',
  `fpresrecpreinsp` date DEFAULT NULL,
  `prespreinsprevisado` tinyint(1) DEFAULT '0',
  `frevpresupuestopreinsp` date DEFAULT NULL,
  `inicoberpoliza` date DEFAULT NULL,
  `fincoberpoliza` date DEFAULT NULL,
  `rutciaseguros` varchar(255) DEFAULT '',
  `direccionciaseguros` varchar(255) DEFAULT '',
  `nreprelegal` varchar(255) DEFAULT '',
  `antigpropiedad` varchar(255) DEFAULT '',
  `enviocertinsp` tinyint(1) DEFAULT '0',
  `fentregacarta` date DEFAULT NULL,
  `fconocimientodanos` date DEFAULT NULL,
  `cobertura` varchar(255) DEFAULT '',
  `pago` varchar(255) DEFAULT '',
  `deducible` varchar(255) DEFAULT '',
  `fueraplazo` tinyint(1) DEFAULT '0',
  `nexocausal` tinyint(1) DEFAULT '0',
  `sindano` tinyint(1) DEFAULT '0',
  `obsanalisis` text,
  `gestionprevia` tinyint(1) DEFAULT '0',
  `cobertura2` varchar(255) DEFAULT '',
  `deducible2` varchar(255) DEFAULT '',
  `causalesmixtas` varchar(255) DEFAULT '',
  `objsincobmix` text,
  `objconcob` text,
  `objsincobpur` text,
  `indemaddendum1` bigint(24) DEFAULT '0',
  `facturaaddendumpagada1` tinyint(1) DEFAULT '0',
  `fvenfacturaaddendum1` date DEFAULT NULL,
  `fpagofacturaaddendum1` date DEFAULT NULL,
  `bancopagoaddendum1` varchar(255) DEFAULT '',
  `tipopagoaddendum1` varchar(255) DEFAULT '',
  `asesorseguros` tinyint(1) DEFAULT '0',
  `fsismo_nuevo` varchar(255) DEFAULT '',
  `obspreinforme` text,
  `lugarsismo` varchar(255) DEFAULT '',
  `cobertura3` varchar(255) DEFAULT '',
  `deducible3` varchar(255) DEFAULT '',
  `causalesmixtas2` varchar(255) DEFAULT '',
  `objsincobmix2` text,
  `objconcob2` text,
  `objsincobpur2` text,
  `obsinformefin` text,
  `foliocontrato` int(6) DEFAULT '0',
  `captadorfree` varchar(255) DEFAULT '',
  `pagofreelance` tinyint(1) DEFAULT '0',
  `gestcorredorreccob` tinyint(1) DEFAULT '0',
  `gestcorredorotros` tinyint(1) DEFAULT '0',
  `mandtomconfir` tinyint(1) DEFAULT '0',
  `corr_seg` varchar(255) DEFAULT '',
  `gest_ext` varchar(255) DEFAULT '',
  `imp_comp` tinyint(1) DEFAULT '0',
  `fecha_rec_imp_comp` date DEFAULT NULL,
  `resp_imp_comp` tinyint(1) DEFAULT '0',
  `fech_resp_imp_comp` date DEFAULT NULL,
  `tip_rec` varchar(255) DEFAULT '',
  `obs_ase_leg` varchar(25) DEFAULT '',
  `est_liq` varchar(255) DEFAULT '',
  `cau_as_le` text,
  `noaplicacobroseguro` tinyint(1) DEFAULT '0',
  `crearddacom` tinyint(1) DEFAULT '0',
  `crearddacober` tinyint(1) DEFAULT '0',
  `perdrecuperableuf` decimal(8,2) DEFAULT NULL,
  `perdrecuperablepesos` int(10) DEFAULT '0',
  `plazoinfliq` date DEFAULT NULL,
  `desctoas` tinyint(1) DEFAULT '0',
  `tipodesctoas` varchar(30) DEFAULT '',
  `idsiniestroreporte` int(15) DEFAULT NULL,
  `idclientereporte` int(15) DEFAULT NULL,
  `idgestddareporte` int(15) DEFAULT NULL,
  `razonnoaplica` varchar(255) DEFAULT '',
  `comisionpagada` tinyint(1) DEFAULT '0',
  `fechapagocomision` date DEFAULT NULL,
  `valorplan` varchar(255) DEFAULT '',
  `interesadodda` tinyint(1) DEFAULT '0',
  `indadddos` bigint(30) DEFAULT '0',
  `fechaimpgadddos` date DEFAULT NULL,
  `obsimpgadddos` varchar(120) DEFAULT '',
  `fecharespuestaimpudos` date DEFAULT NULL,
  `factadddospag` tinyint(1) DEFAULT '0',
  `fechavenfactadddos` date DEFAULT NULL,
  `fechapagfactadddos` date DEFAULT NULL,
  `bancopagoadddos` varchar(60) DEFAULT '',
  `tipodepagoadddos` varchar(60) DEFAULT '',
  `contratofirmado2` tinyint(1) DEFAULT '0',
  `contratofirmado3` tinyint(1) NOT NULL DEFAULT '0',
  `hora_preinspeccion` time DEFAULT NULL,
  `hravisita` time DEFAULT NULL,
  `correorecpre` tinyint(1) DEFAULT '0',
  `correorecvisliq` tinyint(1) DEFAULT '0',
  `ddaingresada` tinyint(1) DEFAULT '0',
  `docenplataforma` tinyint(1) DEFAULT '0',
  `comentcontrato` text,
  `abonopagado` tinyint(1) DEFAULT '0',
  `fechaintento1` date DEFAULT NULL,
  `fechaintento2` date DEFAULT NULL,
  `fechaintento3` date DEFAULT NULL,
  `comentariabono` text,
  `mandatoenplata` tinyint(1) DEFAULT '0',
  `fechamandayotrosfirma` date DEFAULT NULL,
  `fonoanalista` varchar(25) DEFAULT '',
  `estado_pf` tinyint(1) DEFAULT '0',
  `descargadoc` varchar(255) DEFAULT '',
  `rut` varchar(30) DEFAULT '',
  `nuevocriterioct` tinyint(1) DEFAULT '0',
  `porcentajepago` int(3) DEFAULT '0',
  `ddaliquidador` tinyint(1) DEFAULT '0',
  `crearvtadda` tinyint(1) DEFAULT '0',
  `comentaripre` text,
  `fechaavisopre` date DEFAULT NULL,
  `fechaavisopretres` date DEFAULT NULL,
  `fechaavisovisita` date DEFAULT NULL,
  `fechaavisotres` date DEFAULT NULL,
  `solcontact` varchar(255) DEFAULT '',
  `estadollamadauno` varchar(255) DEFAULT '',
  `estadollamadados` varchar(255) DEFAULT '',
  `estadollamadatres` varchar(255) DEFAULT '',
  `fechallamadauno` date DEFAULT NULL,
  `fechallamadados` date DEFAULT NULL,
  `fechallamadatres` date DEFAULT NULL,
  `obsllamada` text,
  `contactowsp` tinyint(1) DEFAULT '0',
  `enviocorreoregllamada` tinyint(1) DEFAULT '0',
  `diavolverallamar` date DEFAULT NULL,
  `horavolverllamar` time DEFAULT NULL,
  `fechacontactowsp` date DEFAULT NULL,
  `nroreprogramacion` varchar(255) DEFAULT '',
  `estadoreprogramacion` varchar(255) DEFAULT '',
  `fechapreinsp` date DEFAULT NULL,
  `evapre` varchar(255) DEFAULT '',
  `ex_captador` varchar(100) DEFAULT '',
  `arrendatario` varchar(100) DEFAULT '',
  `reprogramadosos` tinyint(1) DEFAULT '0',
  `estadossos` varchar(255) DEFAULT '',
  `retencionventas` varchar(255) DEFAULT '',
  `reas` int(1) NOT NULL DEFAULT '0',
  `estadoprogreso` varchar(255) DEFAULT '',
  `mandatofirmado` tinyint(1) DEFAULT '0',
  `descargarmandato` varchar(255) DEFAULT '',
  `tomadeconocimiento` tinyint(1) DEFAULT '0',
  `descargartomadeconocimiento` varchar(255) DEFAULT '',
  `declaracionjuradafirmada` tinyint(1) DEFAULT '0',
  `descargardeclaracionjurada` varchar(255) DEFAULT '',
  `certificadodeinspeccionfirmado` tinyint(1) DEFAULT '0',
  `descargarcertificadoinspeccion` varchar(255) DEFAULT '',
  `ftomadeconocimiento` date DEFAULT NULL,
  `estado_pf_tc` tinyint(1) DEFAULT '0',
  `fechacertificadoinspeccion` date DEFAULT NULL,
  `fechadecalracionjurada` date DEFAULT NULL,
  `fechamandatofirmado` date DEFAULT NULL,
  `obscasoesp` text,
  `volverallamar` tinyint(1) DEFAULT '0',
  `fechavolverallamar` date DEFAULT NULL,
  `obsvolverallamar` text,
  `id_fact_relBase_sus` varchar(200) DEFAULT '0',
  `estado_factura_sii` varchar(200) NOT NULL,
  `fecha_siniestro` date DEFAULT NULL,
  `id_fact_relBase_hono` varchar(200) NOT NULL DEFAULT '0',
  `razongestionarprogreso` varchar(255) DEFAULT '',
  `ffacturapagada` tinyint(1) DEFAULT '0',
  `nombrearrendatario` varchar(200) DEFAULT '',
  `telefonoarrendatario` varchar(200) DEFAULT '',
  `conarrendatario` tinyint(1) DEFAULT '0',
  `id_fact_relbase_hono_adendum` varchar(100) DEFAULT '0',
  `latitud_sini` varchar(100) DEFAULT '',
  `longitud_sini` varchar(100) DEFAULT '',
  `georeferenciado_estado` tinyint(1) DEFAULT '0',
  `nronotacredito` varchar(30) DEFAULT '',
  `evasig_pre_ins_ins` varchar(100) DEFAULT '',
  `hravisita_pre_ins_ins` time DEFAULT NULL,
  `nom_isnpec_pre_ins_ins` varchar(100) DEFAULT '',
  `obs_pre_ins_ins` varchar(100) DEFAULT '',
  `faviso_pre_ins_ins` date DEFAULT NULL,
  `favisovisita3dias_pre_ins_ins` date DEFAULT NULL,
  `progra_pre_ins_ins` tinyint(1) DEFAULT '0',
  `fvisita_pre_ins_ins` date DEFAULT NULL,
  `facta_pre_ins_ins` date DEFAULT NULL,
  `coor_completa` varchar(200) DEFAULT '',
  `confirmapreinspeccion` tinyint(1) DEFAULT '0',
  `confirmainspeccion` tinyint(1) DEFAULT '0',
  `mark_provisoria` int(11) NOT NULL,
  `clienteinformado` tinyint(1) DEFAULT '0',
  `fechaclinfo` date DEFAULT NULL,
  `obsclinformado` text,
  `solparagestionarprogreso` varchar(255) DEFAULT '',
  `rangohorpre` varchar(255) DEFAULT '',
  `diasdisppre` text,
  `fonoinspector` varchar(50) DEFAULT '',
  `mailinspector` varchar(50) DEFAULT '',
  `asociadoesterno` varchar(255) DEFAULT '',
  `canalcaptacion` varchar(255) DEFAULT '',
  `creadaaslegal` tinyint(1) DEFAULT '0',
  `docugenfirmado` tinyint(1) DEFAULT '0',
  `descargardg` varchar(255) DEFAULT '',
  PRIMARY KEY (`siniestroid`),
  KEY `vtiger_siniestro_nombrecliente_idx` (`nombrecliente`),
  CONSTRAINT `fk_1_vtiger_siniestrosiniestroid` FOREIGN KEY (`siniestroid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_siniestro_inventory` (
  `id` int(11) DEFAULT NULL,
  `seq` int(10) DEFAULT NULL,
  KEY `siniestro_inventory_idx` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_siniestro_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_siniestro_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_siniestro_pp` (
  `siniestroid` int(11) NOT NULL DEFAULT '0',
  `siniestro` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `estado` varchar(255) DEFAULT '',
  `estado_` varchar(255) DEFAULT NULL,
  `banco` varchar(255) DEFAULT '',
  `campana` varchar(255) DEFAULT '',
  `presrecevaluador` tinyint(1) DEFAULT '0',
  `contratofirmado` tinyint(1) DEFAULT '0',
  `frecepcionpresupuestoeval` date DEFAULT NULL,
  `fcontratofirmado` date DEFAULT NULL,
  `presupuestorevisado` tinyint(1) DEFAULT '0',
  `comentariocontrato` text,
  `frevpresupuesto` date DEFAULT NULL,
  `doctosendec` tinyint(1) DEFAULT '0',
  `obscaso` text,
  `direccionsiniestro` text,
  `comunacaso` varchar(255) DEFAULT '',
  `ciudadcaso` varchar(255) DEFAULT '',
  `mts2` decimal(11,2) DEFAULT NULL,
  `tipopropiedad` varchar(255) DEFAULT '',
  `tiposiniestro` varchar(255) DEFAULT '',
  `nropoliza` varchar(16) DEFAULT '',
  `fsismo` varchar(255) DEFAULT '',
  `nrosiniestro` varchar(16) DEFAULT '',
  `ciaseguros` varchar(255) DEFAULT '',
  `ffiltracionotro` date DEFAULT NULL,
  `quiendenuncio` varchar(255) DEFAULT '',
  `formadenuncia` varchar(255) DEFAULT '',
  `nrodeatencion` varchar(16) DEFAULT '',
  `tlfcontacto` varchar(255) DEFAULT '',
  `entliquidadora` varchar(255) DEFAULT '',
  `infliqimpugnado` tinyint(1) DEFAULT '0',
  `fdenuncio` date DEFAULT NULL,
  `fimpugnacion` date DEFAULT NULL,
  `fasignacionliq` date DEFAULT NULL,
  `respimpugnacion` tinyint(1) DEFAULT '0',
  `fvisita` date DEFAULT NULL,
  `frespimpugnacion` date DEFAULT NULL,
  `actarecibida` tinyint(1) DEFAULT '0',
  `nombreinspector` varchar(32) DEFAULT '',
  `factarecibida` date DEFAULT NULL,
  `nombreanalista` varchar(32) DEFAULT '',
  `fpresupuesto` date DEFAULT NULL,
  `emailanalista` varchar(100) DEFAULT '',
  `evalasignado` varchar(255) DEFAULT '',
  `fpreinforme` date DEFAULT NULL,
  `observacion` text,
  `frecinfliq` date DEFAULT NULL,
  `freinspeccion` date DEFAULT NULL,
  `nrocarpeta` varchar(16) DEFAULT '',
  `evalreinspeccion` varchar(255) DEFAULT '',
  `reinspeccion` tinyint(1) DEFAULT '0',
  `fprorroga` date DEFAULT NULL,
  `declaracionjurada` tinyint(1) DEFAULT '0',
  `venprorroga` date DEFAULT NULL,
  `envdecjurada` date DEFAULT NULL,
  `prorrogado` tinyint(1) DEFAULT '0',
  `perdidareclamada` decimal(19,2) DEFAULT NULL,
  `nrofactura` varchar(16) DEFAULT '',
  `perdidadeterminada` decimal(19,2) DEFAULT NULL,
  `ffactura` date DEFAULT NULL,
  `deducibleafecto` decimal(19,2) DEFAULT NULL,
  `perdidaindemnizable` decimal(19,2) DEFAULT NULL,
  `fpagofactura` date DEFAULT NULL,
  `fprobpagocia` date DEFAULT NULL,
  `fprobablepago` date DEFAULT NULL,
  `observaciones` text,
  `facturapagada` tinyint(1) DEFAULT '0',
  `comprobantepagoenviado` tinyint(1) DEFAULT '0',
  `fcomprobanteenviado` date DEFAULT NULL,
  `facturarinforme` tinyint(1) DEFAULT '0',
  `informefacturado` tinyint(1) DEFAULT '0',
  `nvaperdidadet` decimal(19,2) DEFAULT NULL,
  `nvaperdidaindemnizable` decimal(19,2) DEFAULT NULL,
  `faddendumrebaja` date DEFAULT NULL,
  `facturaraddendum1` tinyint(1) DEFAULT '0',
  `addendum1facturado` tinyint(1) DEFAULT '0',
  `nrofacturaaddedum1` bigint(16) DEFAULT '0',
  `ffacturaaddendum1` date DEFAULT NULL,
  `frecepaddendum1` date DEFAULT NULL,
  `fimpugaddendum1` date DEFAULT NULL,
  `frespimpugaddendum1` date DEFAULT NULL,
  `obsimpugaddendum1` text,
  `frecepaddendum2` date DEFAULT NULL,
  `facturaraddendum2` tinyint(1) DEFAULT '0',
  `addendum2facturado` tinyint(1) DEFAULT '0',
  `nrofacturaaddendum2` bigint(16) DEFAULT '0',
  `montofacturaaddendum2` bigint(16) DEFAULT '0',
  `ffacturaaddendum2` date DEFAULT NULL,
  `solucion` text,
  `cartaenviopresupuesto` tinyint(1) DEFAULT '0',
  `cartarecepinfliq` tinyint(1) DEFAULT '0',
  `captador` varchar(255) DEFAULT '',
  `quienenvioppto` varchar(255) DEFAULT '',
  `comunadelcaso` varchar(255) DEFAULT '',
  `provinciadelcaso` varchar(255) DEFAULT '',
  `regiondelcaso` varchar(255) DEFAULT '',
  `montopresupuesto` bigint(64) DEFAULT '0',
  `valorfactura` bigint(64) DEFAULT '0',
  `montofacturaaddendum1` bigint(64) DEFAULT '0',
  `valorufestimado` bigint(64) DEFAULT '0',
  `nombrecliente` int(11) unsigned DEFAULT '0',
  `fedoprogreso` date DEFAULT NULL,
  `fedoliqasig` date DEFAULT NULL,
  `fedovisprog` date DEFAULT NULL,
  `fedovisreal` date DEFAULT NULL,
  `fedoesperando` date DEFAULT NULL,
  `edocomercialasesor` varchar(255) DEFAULT '',
  `montoesperado` decimal(22,8) DEFAULT NULL,
  `montoesperadofirma` decimal(22,8) DEFAULT NULL,
  `montoesperadovisita` decimal(22,8) DEFAULT NULL,
  `firmapagada` tinyint(1) DEFAULT '0',
  `convisitapagada` tinyint(1) DEFAULT '0',
  `fpagofirma` date DEFAULT NULL,
  `fpagovisitaasesor` date DEFAULT NULL,
  `montototalrecibido` decimal(22,8) DEFAULT NULL,
  `obsdelsistema` text,
  `descontado` tinyint(1) DEFAULT '0',
  `fdescuento` date DEFAULT NULL,
  `indemnizacion` bigint(64) DEFAULT '0',
  `valoruf` decimal(62,2) DEFAULT NULL,
  `rechazocia` tinyint(1) DEFAULT '0',
  `montoaddendum1` decimal(65,2) DEFAULT NULL,
  `montoaddendum2` decimal(22,2) DEFAULT NULL,
  `pertenecealgrupo` varchar(255) DEFAULT '',
  `rechazoliqcob` tinyint(1) DEFAULT '0',
  `clasificadodemanda` tinyint(1) DEFAULT '0',
  `fclasificaciondemanda` date DEFAULT NULL,
  `gestionardemanda` tinyint(1) DEFAULT '0',
  `fgestionardemanda` date DEFAULT NULL,
  `bancopago` varchar(255) DEFAULT '',
  `tipopago` varchar(255) DEFAULT '',
  `cartaresolucion` tinyint(1) DEFAULT '0',
  `freccartares` date DEFAULT NULL,
  `conpago` tinyint(1) DEFAULT '0',
  `tipoinspeccion` varchar(255) DEFAULT '',
  `cargofijo` tinyint(1) DEFAULT '0',
  `facurarcf` tinyint(1) DEFAULT '0',
  `descuentocf` tinyint(1) DEFAULT '0',
  `facturadocf` tinyint(1) DEFAULT '0',
  `fpreinsp` date DEFAULT NULL,
  `evalpreinsp` varchar(255) DEFAULT '',
  `preinsprealizada` tinyint(1) DEFAULT '0',
  `presupuestopreinsprecibido` tinyint(1) DEFAULT '0',
  `fpresrecpreinsp` date DEFAULT NULL,
  `prespreinsprevisado` tinyint(1) DEFAULT '0',
  `frevpresupuestopreinsp` date DEFAULT NULL,
  `inicoberpoliza` date DEFAULT NULL,
  `fincoberpoliza` date DEFAULT NULL,
  `rutciaseguros` varchar(255) DEFAULT '',
  `direccionciaseguros` varchar(255) DEFAULT '',
  `nreprelegal` varchar(255) DEFAULT '',
  `antigpropiedad` varchar(255) DEFAULT '',
  `enviocertinsp` tinyint(1) DEFAULT '0',
  `fentregacarta` date DEFAULT NULL,
  `fconocimientodanos` date DEFAULT NULL,
  `cobertura` varchar(255) DEFAULT '',
  `pago` varchar(255) DEFAULT '',
  `deducible` varchar(255) DEFAULT '',
  `fueraplazo` tinyint(1) DEFAULT '0',
  `nexocausal` tinyint(1) DEFAULT '0',
  `sindano` tinyint(1) DEFAULT '0',
  `obsanalisis` text,
  `gestionprevia` tinyint(1) DEFAULT '0',
  `cobertura2` varchar(255) DEFAULT '',
  `deducible2` varchar(255) DEFAULT '',
  `causalesmixtas` varchar(255) DEFAULT '',
  `objsincobmix` text,
  `objconcob` text,
  `objsincobpur` text,
  `indemaddendum1` bigint(24) DEFAULT '0',
  `facturaaddendumpagada1` tinyint(1) DEFAULT '0',
  `fvenfacturaaddendum1` date DEFAULT NULL,
  `fpagofacturaaddendum1` date DEFAULT NULL,
  `bancopagoaddendum1` varchar(255) DEFAULT '',
  `tipopagoaddendum1` varchar(255) DEFAULT '',
  `asesorseguros` tinyint(1) DEFAULT '0',
  `fsismo_nuevo` varchar(255) DEFAULT '',
  `obspreinforme` text,
  `lugarsismo` varchar(255) DEFAULT '',
  `cobertura3` varchar(255) DEFAULT '',
  `deducible3` varchar(255) DEFAULT '',
  `causalesmixtas2` varchar(255) DEFAULT '',
  `objsincobmix2` text,
  `objconcob2` text,
  `objsincobpur2` text,
  `obsinformefin` text,
  `foliocontrato` int(6) DEFAULT '0',
  `captadorfree` varchar(255) DEFAULT '',
  `pagofreelance` tinyint(1) DEFAULT '0',
  `gestcorredorreccob` tinyint(1) DEFAULT '0',
  `gestcorredorotros` tinyint(1) DEFAULT '0',
  `mandtomconfir` tinyint(1) DEFAULT '0',
  `corr_seg` varchar(255) DEFAULT '',
  `gest_ext` varchar(255) DEFAULT '',
  `imp_comp` tinyint(1) DEFAULT '0',
  `fecha_rec_imp_comp` date DEFAULT NULL,
  `resp_imp_comp` tinyint(1) DEFAULT '0',
  `fech_resp_imp_comp` date DEFAULT NULL,
  `tip_rec` varchar(255) DEFAULT '',
  `obs_ase_leg` varchar(25) DEFAULT '',
  `est_liq` varchar(255) DEFAULT '',
  `cau_as_le` text,
  `noaplicacobroseguro` tinyint(1) DEFAULT '0',
  `crearddacom` tinyint(1) DEFAULT '0',
  `crearddacober` tinyint(1) DEFAULT '0',
  `perdrecuperableuf` decimal(8,2) DEFAULT NULL,
  `perdrecuperablepesos` int(10) DEFAULT '0',
  `plazoinfliq` date DEFAULT NULL,
  `desctoas` tinyint(1) DEFAULT '0',
  `tipodesctoas` varchar(30) DEFAULT '',
  `idsiniestroreporte` int(15) DEFAULT NULL,
  `idclientereporte` int(15) DEFAULT NULL,
  `idgestddareporte` int(15) DEFAULT NULL,
  `razonnoaplica` varchar(255) DEFAULT '',
  `comisionpagada` tinyint(1) DEFAULT '0',
  `fechapagocomision` date DEFAULT NULL,
  `valorplan` varchar(255) DEFAULT '',
  `interesadodda` tinyint(1) DEFAULT '0',
  `indadddos` bigint(30) DEFAULT '0',
  `fechaimpgadddos` date DEFAULT NULL,
  `obsimpgadddos` varchar(120) DEFAULT '',
  `fecharespuestaimpudos` date DEFAULT NULL,
  `factadddospag` tinyint(1) DEFAULT '0',
  `fechavenfactadddos` date DEFAULT NULL,
  `fechapagfactadddos` date DEFAULT NULL,
  `bancopagoadddos` varchar(60) DEFAULT '',
  `tipodepagoadddos` varchar(60) DEFAULT '',
  `contratofirmado2` tinyint(1) DEFAULT '0',
  `contratofirmado3` tinyint(1) NOT NULL DEFAULT '0',
  `hora_preinspeccion` time DEFAULT NULL,
  `hravisita` time DEFAULT NULL,
  `correorecpre` tinyint(1) DEFAULT '0',
  `correorecvisliq` tinyint(1) DEFAULT '0',
  `ddaingresada` tinyint(1) DEFAULT '0',
  `docenplataforma` tinyint(1) DEFAULT '0',
  `comentcontrato` text,
  `abonopagado` tinyint(1) DEFAULT '0',
  `fechaintento1` date DEFAULT NULL,
  `fechaintento2` date DEFAULT NULL,
  `fechaintento3` date DEFAULT NULL,
  `comentariabono` text,
  `mandatoenplata` tinyint(1) DEFAULT '0',
  `fechamandayotrosfirma` date DEFAULT NULL,
  `fonoanalista` varchar(25) DEFAULT '',
  `estado_pf` tinyint(1) DEFAULT '0',
  `descargadoc` varchar(255) DEFAULT '',
  `rut` varchar(30) DEFAULT '',
  `nuevocriterioct` tinyint(1) DEFAULT '0',
  `porcentajepago` int(3) DEFAULT '0',
  `ddaliquidador` tinyint(1) DEFAULT '0',
  `crearvtadda` tinyint(1) DEFAULT '0',
  `comentaripre` text,
  `fechaavisopre` date DEFAULT NULL,
  `fechaavisopretres` date DEFAULT NULL,
  `fechaavisovisita` date DEFAULT NULL,
  `fechaavisotres` date DEFAULT NULL,
  `solcontact` varchar(255) DEFAULT '',
  `estadollamadauno` varchar(255) DEFAULT '',
  `estadollamadados` varchar(255) DEFAULT '',
  `estadollamadatres` varchar(255) DEFAULT '',
  `fechallamadauno` date DEFAULT NULL,
  `fechallamadados` date DEFAULT NULL,
  `fechallamadatres` date DEFAULT NULL,
  `obsllamada` text,
  `contactowsp` tinyint(1) DEFAULT '0',
  `enviocorreoregllamada` tinyint(1) DEFAULT '0',
  `diavolverallamar` date DEFAULT NULL,
  `horavolverllamar` time DEFAULT NULL,
  `fechacontactowsp` date DEFAULT NULL,
  `nroreprogramacion` varchar(255) DEFAULT '',
  `estadoreprogramacion` varchar(255) DEFAULT '',
  `fechapreinsp` date DEFAULT NULL,
  `evapre` varchar(255) DEFAULT '',
  `ex_captador` varchar(100) DEFAULT '',
  `arrendatario` varchar(100) DEFAULT '',
  `reprogramadosos` tinyint(1) DEFAULT '0',
  `estadossos` varchar(255) DEFAULT '',
  `retencionventas` varchar(255) DEFAULT '',
  `reas` int(1) NOT NULL DEFAULT '0',
  `estadoprogreso` varchar(255) DEFAULT '',
  `mandatofirmado` tinyint(1) DEFAULT '0',
  `descargarmandato` varchar(255) DEFAULT '',
  `tomadeconocimiento` tinyint(1) DEFAULT '0',
  `descargartomadeconocimiento` varchar(255) DEFAULT '',
  `declaracionjuradafirmada` tinyint(1) DEFAULT '0',
  `descargardeclaracionjurada` varchar(255) DEFAULT '',
  `certificadodeinspeccionfirmado` tinyint(1) DEFAULT '0',
  `descargarcertificadoinspeccion` varchar(255) DEFAULT '',
  `ftomadeconocimiento` date DEFAULT NULL,
  `estado_pf_tc` tinyint(1) DEFAULT '0',
  `fechacertificadoinspeccion` date DEFAULT NULL,
  `fechadecalracionjurada` date DEFAULT NULL,
  `fechamandatofirmado` date DEFAULT NULL,
  `obscasoesp` text,
  `volverallamar` tinyint(1) DEFAULT '0',
  `fechavolverallamar` date DEFAULT NULL,
  `obsvolverallamar` text,
  `id_fact_relBase_sus` varchar(200) DEFAULT '0',
  `estado_factura_sii` varchar(200) NOT NULL,
  `fecha_siniestro` date DEFAULT NULL,
  `id_fact_relBase_hono` varchar(200) NOT NULL DEFAULT '0',
  `razongestionarprogreso` varchar(255) DEFAULT '',
  `ffacturapagada` tinyint(1) DEFAULT '0',
  `nombrearrendatario` varchar(200) DEFAULT '',
  `telefonoarrendatario` varchar(200) DEFAULT '',
  `conarrendatario` tinyint(1) DEFAULT '0',
  `id_fact_relbase_hono_adendum` varchar(100) DEFAULT '0',
  `latitud_sini` varchar(100) DEFAULT '',
  `longitud_sini` varchar(100) DEFAULT '',
  `georeferenciado_estado` tinyint(1) DEFAULT '0',
  `nronotacredito` varchar(30) DEFAULT '',
  `evasig_pre_ins_ins` varchar(100) DEFAULT '',
  `hravisita_pre_ins_ins` time DEFAULT NULL,
  `nom_isnpec_pre_ins_ins` varchar(100) DEFAULT '',
  `obs_pre_ins_ins` varchar(100) DEFAULT '',
  `faviso_pre_ins_ins` date DEFAULT NULL,
  `favisovisita3dias_pre_ins_ins` date DEFAULT NULL,
  `progra_pre_ins_ins` tinyint(1) DEFAULT '0',
  `fvisita_pre_ins_ins` date DEFAULT NULL,
  `facta_pre_ins_ins` date DEFAULT NULL,
  `coor_completa` varchar(200) DEFAULT '',
  `confirmapreinspeccion` tinyint(1) DEFAULT '0',
  `confirmainspeccion` tinyint(1) DEFAULT '0',
  `mark_provisoria` int(11) NOT NULL,
  `clienteinformado` tinyint(1) DEFAULT '0',
  `fechaclinfo` date DEFAULT NULL,
  `obsclinformado` text,
  `solparagestionarprogreso` varchar(255) DEFAULT '',
  `rangohorpre` varchar(255) DEFAULT '',
  `diasdisppre` text,
  `fonoinspector` varchar(50) DEFAULT '',
  `mailinspector` varchar(50) DEFAULT '',
  `asociadoesterno` varchar(255) DEFAULT '',
  `canalcaptacion` varchar(255) DEFAULT '',
  `creadaaslegal` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`siniestroid`),
  KEY `vtiger_siniestro_pp_nombrecliente_idx` (`nombrecliente`),
  CONSTRAINT `fk_1_vtiger_siniestro_ppsiniestroid` FOREIGN KEY (`siniestroid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_siniestrocf` (
  `siniestroid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`siniestroid`),
  CONSTRAINT `fk_1_vtiger_siniestrocfsiniestroid` FOREIGN KEY (`siniestroid`) REFERENCES `vtiger_siniestro` (`siniestroid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_smsnotifier` (
  `smsnotifierid` int(10) NOT NULL,
  `message` text,
  `smsnotifier_status` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`smsnotifierid`),
  CONSTRAINT `vtiger_smsnotifier_ibfk_1` FOREIGN KEY (`smsnotifierid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_smsnotifier_status` (
  `smsnotifier_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `smsnotifier_status` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`smsnotifier_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_smsnotifiercf` (
  `smsnotifierid` int(10) NOT NULL,
  PRIMARY KEY (`smsnotifierid`),
  CONSTRAINT `vtiger_smsnotifiercf_ibfk_1` FOREIGN KEY (`smsnotifierid`) REFERENCES `vtiger_smsnotifier` (`smsnotifierid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_soapservice` (
  `id` int(10) DEFAULT NULL,
  `type` varchar(25) DEFAULT NULL,
  `sessionid` varchar(100) DEFAULT NULL,
  `lang` varchar(10) DEFAULT NULL,
  KEY `id` (`id`,`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_solcontact` (
  `solcontactid` int(11) NOT NULL AUTO_INCREMENT,
  `solcontact` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`solcontactid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_solicituddecredito` (
  `solicituddecreditoid` int(11) NOT NULL DEFAULT '0',
  `solicitud_credito` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `nombrecredito` varchar(32) DEFAULT '',
  `apellido` varchar(32) DEFAULT '',
  `fnacimiento` date DEFAULT NULL,
  `edocivil` varchar(255) DEFAULT '',
  `nrodctocredito` varchar(16) DEFAULT '',
  `emailcredito` varchar(100) DEFAULT '',
  `estudioscredito` varchar(255) DEFAULT '',
  `profcredito` varchar(32) DEFAULT '',
  `marca` varchar(255) DEFAULT '',
  `modelo` varchar(16) DEFAULT '',
  `nuevousado` varchar(255) DEFAULT '',
  `acreditacionpie` varchar(255) DEFAULT '',
  `patente` varchar(16) DEFAULT '',
  `fonoreferencia1_extra` varchar(100) DEFAULT NULL,
  `fonoreferencia2_extra` varchar(100) DEFAULT NULL,
  `rutempleador` varchar(16) DEFAULT '',
  `tipoempleado` varchar(255) DEFAULT '',
  `fonocomercio_extra` varchar(100) DEFAULT NULL,
  `fingreso` date DEFAULT NULL,
  `dondeotrosingresos` text,
  `banco` varchar(255) DEFAULT '',
  `nombreconyugue` varchar(32) DEFAULT '',
  `apellidoconyugue` varchar(32) DEFAULT '',
  `movilconyugue` varchar(30) DEFAULT '',
  `movilconyugue_extra` varchar(100) DEFAULT NULL,
  `rutconyugue` varchar(16) DEFAULT '',
  `bieninmueble1` varchar(255) DEFAULT '',
  `dirbieninmueble1` text,
  `bieninmueble2` varchar(255) DEFAULT '',
  `dirbieninmueble2` text,
  `deudainmueble2` varchar(255) DEFAULT '',
  `deudabieninmueble1` varchar(255) DEFAULT '',
  `automovil1` varchar(255) DEFAULT '',
  `modeloauto1` varchar(8) DEFAULT '',
  `patenteauto1` varchar(8) DEFAULT '',
  `automovil2` varchar(255) DEFAULT '',
  `modeloauto2` varchar(8) DEFAULT '',
  `patenteauto2` varchar(8) DEFAULT '',
  `prendaauto2` varchar(255) DEFAULT '',
  `movilcliente_extra` varchar(100) DEFAULT NULL,
  `tlfcliente_extra` varchar(100) DEFAULT NULL,
  `movil` varchar(30) DEFAULT '',
  `movil_extra` varchar(100) DEFAULT NULL,
  `tlfparticular` varchar(30) DEFAULT '',
  `tlfparticular_extra` varchar(100) DEFAULT NULL,
  `direccion` text,
  `nreferencia1` varchar(16) DEFAULT '',
  `fonoreferencia1` varchar(30) DEFAULT '',
  `parentezcoreferencia1` varchar(255) DEFAULT '',
  `fonoreferencia2` varchar(30) DEFAULT '',
  `parentezcoreferencia2` varchar(255) DEFAULT '',
  `direccionempleador` text,
  `fonoempleador` varchar(30) DEFAULT '',
  `fonoempleador_extra` varchar(100) DEFAULT NULL,
  `cuentacorriente` tinyint(1) DEFAULT '0',
  `antiguedad` varchar(255) DEFAULT '',
  `tipoempleadoconyugue` varchar(255) DEFAULT '',
  `fingresoconyugue` date DEFAULT NULL,
  `nempleadorconyugue` varchar(16) DEFAULT '',
  `frechazoaprobacion` date DEFAULT NULL,
  `prendaauto1` varchar(255) DEFAULT '',
  `posibilidad` decimal(5,2) DEFAULT NULL,
  `pais` varchar(255) DEFAULT '',
  `apellidoreferencia1` varchar(32) DEFAULT '',
  `nreferencia2` varchar(32) DEFAULT '',
  `apellidoreferencia2` varchar(32) DEFAULT '',
  `edosolcredito` varchar(255) DEFAULT '',
  `region` varchar(255) DEFAULT '',
  `comunaempleador` varchar(255) DEFAULT '',
  `provinciaempleador` varchar(255) DEFAULT '',
  `regionempleador` varchar(255) DEFAULT '',
  `comunacli` varchar(255) DEFAULT '',
  `provinciacli` 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 '',
  `cargo` varchar(64) DEFAULT '',
  `cargoconyugue` varchar(64) DEFAULT '',
  `nrosolicitud` varchar(64) DEFAULT '',
  `anovehiculo` varchar(255) DEFAULT '',
  `plazopa` varchar(255) DEFAULT '',
  `nroindexa` varchar(32) DEFAULT '',
  `edad` int(8) DEFAULT '0',
  `nroprotesto` int(8) DEFAULT '0',
  `tasapiso` decimal(5,2) DEFAULT NULL,
  `tasatecho` decimal(5,2) DEFAULT NULL,
  `cae` decimal(5,2) DEFAULT NULL,
  `comisionporciento` decimal(5,2) DEFAULT NULL,
  `preaprobado` tinyint(1) DEFAULT '0',
  `obssistema` text,
  `obsasesor` text,
  `obssupervisor` text,
  `checkmorosidad` tinyint(1) DEFAULT '0',
  `antlaboral` int(8) DEFAULT '0',
  `propiedad` varchar(255) DEFAULT '',
  `valorpie` varchar(255) DEFAULT '',
  `valorpieneto` decimal(65,8) DEFAULT NULL,
  `actividad` varchar(64) DEFAULT '',
  `valorvehiculo` decimal(65,8) DEFAULT NULL,
  `nempleador` varchar(64) DEFAULT '',
  `rentaliquida` decimal(65,8) DEFAULT NULL,
  `pensionjubilacion` decimal(65,8) DEFAULT NULL,
  `arriendobiener` decimal(65,8) DEFAULT NULL,
  `honorarios` decimal(65,8) DEFAULT NULL,
  `otrosingresos` decimal(65,8) DEFAULT NULL,
  `lineacredito` decimal(65,8) DEFAULT NULL,
  `totalingresos` decimal(65,8) DEFAULT NULL,
  `montototalprotesto` decimal(65,8) DEFAULT NULL,
  `valorcomercialbi1` decimal(65,8) DEFAULT NULL,
  `valorcomercialbi2` decimal(65,8) DEFAULT NULL,
  `valorcomercialbm1` decimal(65,8) DEFAULT NULL,
  `valorcomercialbm2` decimal(65,8) DEFAULT NULL,
  `valorcuota` decimal(65,8) DEFAULT NULL,
  `ctc` decimal(65,8) DEFAULT NULL,
  `comision` decimal(65,8) DEFAULT NULL,
  `alzamientoprenda` decimal(65,8) DEFAULT NULL,
  `constitucionprenda` decimal(65,8) DEFAULT NULL,
  `legalizacionpagare` decimal(65,8) DEFAULT NULL,
  `gastosadministrativos` decimal(65,8) DEFAULT NULL,
  `retirodocumentos` decimal(65,8) DEFAULT NULL,
  `montoafinanciar` decimal(65,8) DEFAULT NULL,
  `segurocesantia` decimal(65,8) DEFAULT NULL,
  `impuestopagare` decimal(5,2) DEFAULT NULL,
  `montopagare` decimal(65,8) DEFAULT NULL,
  `rentaliquidaconyugue` decimal(65,8) DEFAULT NULL,
  PRIMARY KEY (`solicituddecreditoid`),
  CONSTRAINT `fk_1_vtiger_solicituddecreditosolicituddecreditoid` FOREIGN KEY (`solicituddecreditoid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_solicituddecreditocf` (
  `solicituddecreditoid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`solicituddecreditoid`),
  CONSTRAINT `fk_1_vtiger_solicituddecreditocfsolicituddecreditoid` FOREIGN KEY (`solicituddecreditoid`) REFERENCES `vtiger_solicituddecredito` (`solicituddecreditoid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_solitudsiniestros` (
  `solitudsiniestrosid` int(11) NOT NULL DEFAULT '0',
  `number` varchar(32) DEFAULT NULL,
  `nombres` varchar(16) DEFAULT '',
  `apellidos` varchar(16) DEFAULT '',
  `rut` varchar(8) DEFAULT '',
  `edocivil` varchar(255) DEFAULT '',
  `nacionalidad` varchar(8) DEFAULT '',
  `email` varchar(100) DEFAULT '',
  `movil` varchar(30) DEFAULT '',
  `movil_extra` varchar(100) DEFAULT NULL,
  `tlfparticular` varchar(30) DEFAULT '',
  `tlfparticular_extra` varchar(100) DEFAULT NULL,
  `tiposiniestro` varchar(255) DEFAULT '',
  `tipopropiedad` varchar(255) DEFAULT '',
  `banco` varchar(255) DEFAULT '',
  `ciaseguros` varchar(255) DEFAULT '',
  `mts2` decimal(11,2) DEFAULT NULL,
  `observaciones` text,
  `direccion` text,
  `dircaso` text,
  `nrodctoss` varchar(32) DEFAULT '',
  `profesion` varchar(32) DEFAULT '',
  `comunacli` varchar(255) DEFAULT '',
  `provinciacli` varchar(255) DEFAULT '',
  `regioncli` varchar(255) DEFAULT '',
  `comunadelcaso` varchar(255) DEFAULT '',
  `provinciadelcaso` varchar(255) DEFAULT '',
  `regiondelcaso` varchar(255) DEFAULT '',
  `valorufaproximado` bigint(64) DEFAULT '0',
  `nrosolicitud` varchar(64) DEFAULT '',
  `edosolicitud` varchar(255) DEFAULT '',
  PRIMARY KEY (`solitudsiniestrosid`),
  CONSTRAINT `fk_1_vtiger_solitudsiniestrossolitudsiniestrosid` FOREIGN KEY (`solitudsiniestrosid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_solitudsiniestroscf` (
  `solitudsiniestrosid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`solitudsiniestrosid`),
  CONSTRAINT `fk_1_vtiger_solitudsiniestroscfsolitudsiniestrosid` FOREIGN KEY (`solitudsiniestrosid`) REFERENCES `vtiger_solitudsiniestros` (`solitudsiniestrosid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_solparagestionarprogreso` (
  `solparagestionarprogresoid` int(11) NOT NULL AUTO_INCREMENT,
  `solparagestionarprogreso` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`solparagestionarprogresoid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_squoteenquiries_status` (
  `squoteenquiries_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `squoteenquiries_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 (`squoteenquiries_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_squotes_status` (
  `squotes_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `squotes_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 (`squotes_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_srecurringorders_status` (
  `srecurringorders_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `srecurringorders_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 (`srecurringorders_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_srequirementscards_status` (
  `srequirementscards_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `srequirementscards_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 (`srequirementscards_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ssalesprocesses_source` (
  `ssalesprocesses_sourceid` int(10) NOT NULL AUTO_INCREMENT,
  `ssalesprocesses_source` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`ssalesprocesses_sourceid`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ssalesprocesses_status` (
  `ssalesprocesses_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `ssalesprocesses_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 (`ssalesprocesses_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ssalesprocesses_type` (
  `ssalesprocesses_typeid` int(10) NOT NULL AUTO_INCREMENT,
  `ssalesprocesses_type` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`ssalesprocesses_typeid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ssingleorders_source` (
  `ssingleorders_sourceid` int(10) NOT NULL AUTO_INCREMENT,
  `ssingleorders_source` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`ssingleorders_sourceid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ssingleorders_status` (
  `ssingleorders_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `ssingleorders_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 (`ssingleorders_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ssservicesstatus` (
  `ssservicesstatusid` int(10) NOT NULL AUTO_INCREMENT,
  `ssservicesstatus` 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 (`ssservicesstatusid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ssservicesstatus_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_start_hour` (
  `start_hourid` int(10) NOT NULL AUTO_INCREMENT,
  `start_hour` 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 (`start_hourid`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_start_hour_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_state` (
  `stateid` int(10) NOT NULL AUTO_INCREMENT,
  `state` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`stateid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_state_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_status` (
  `statusid` int(10) NOT NULL AUTO_INCREMENT,
  `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 (`statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_status_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_storage_status` (
  `storage_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `storage_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 (`storage_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_storage_type` (
  `storage_typeid` int(10) NOT NULL AUTO_INCREMENT,
  `storage_type` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`storage_typeid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_subidadocs_inventory` (
  `id` int(11) DEFAULT NULL,
  `seq` int(10) DEFAULT NULL,
  KEY `subidadocs_inventory_idx` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_subidadocs_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_subidadocs_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_subidadocumentos` (
  `subidadocumentosid` int(11) NOT NULL,
  `subidadocs` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `idsiniestro` int(11) unsigned DEFAULT '0',
  `idcliente` int(11) unsigned DEFAULT '0',
  `tipodoc` varchar(50) DEFAULT '',
  `descargardoc` varchar(255) DEFAULT '',
  PRIMARY KEY (`subidadocumentosid`),
  KEY `vtiger_subidadocumentos_idsiniestro_idx` (`idsiniestro`),
  KEY `vtiger_subidadocumentos_idcliente_idx` (`idcliente`),
  CONSTRAINT `fk_1_vtiger_subidadocumentossubidadocumentosid` FOREIGN KEY (`subidadocumentosid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_subidadocumentoscf` (
  `subidadocumentosid` int(11) NOT NULL,
  PRIMARY KEY (`subidadocumentosid`),
  CONSTRAINT `fk_1_vtiger_subidadocumentoscfsubidadocumentosid` FOREIGN KEY (`subidadocumentosid`) REFERENCES `vtiger_subidadocumentos` (`subidadocumentosid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_subindustry` (
  `subindustryid` int(10) NOT NULL AUTO_INCREMENT,
  `subindustry` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`subindustryid`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_subindustry_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_subunit` (
  `subunitid` int(10) NOT NULL AUTO_INCREMENT,
  `subunit` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  PRIMARY KEY (`subunitid`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_support_processes` (
  `id` int(10) NOT NULL,
  `ticket_status_indicate_closing` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_suscripcion` (
  `suscripcionid` int(11) NOT NULL DEFAULT '0',
  `valortotal` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `siniestro` int(11) unsigned DEFAULT '0',
  `valorcuota` bigint(16) DEFAULT '0',
  `banco` varchar(255) DEFAULT '',
  `nrocuenta` bigint(64) DEFAULT '0',
  `tipocuenta` varchar(255) DEFAULT '',
  `sucursal` varchar(59) DEFAULT '',
  `diaspago` varchar(255) DEFAULT '',
  `nrocuotas` varchar(255) DEFAULT '',
  `abono` bigint(59) DEFAULT '0',
  `ven1cuota` date DEFAULT NULL,
  `nrofactura` bigint(32) DEFAULT '0',
  `ffactura` date DEFAULT NULL,
  `facturapagada` tinyint(1) DEFAULT '0',
  `ffacturapagada` date DEFAULT NULL,
  `primeracuota` bigint(32) DEFAULT '0',
  `1cuotapagada` tinyint(1) DEFAULT '0',
  `tpago1cuota` varchar(255) DEFAULT '',
  `fven1` date DEFAULT NULL,
  `f1cuotapagada` date DEFAULT NULL,
  `bdpago1cuota` varchar(255) DEFAULT '',
  `segundacuota` bigint(32) DEFAULT '0',
  `2cuotapagada` tinyint(1) DEFAULT '0',
  `tpago2cuota` varchar(255) DEFAULT '',
  `fven2` date DEFAULT NULL,
  `f2cuotapagada` date DEFAULT NULL,
  `bdpago2cuota` varchar(255) DEFAULT '',
  `abonopagado` tinyint(1) DEFAULT '0',
  `fpagoabono` date DEFAULT NULL,
  `tpagoabono` varchar(255) DEFAULT '',
  `bdpago` varchar(255) DEFAULT '',
  `captador` varchar(255) DEFAULT '',
  `nombrecliente` int(11) unsigned DEFAULT '0',
  `fechadelabono` date DEFAULT NULL,
  `codwebpayabono` bigint(12) DEFAULT '0',
  `codwebpaycuota1` bigint(12) DEFAULT '0',
  `codwebpaycuota2` varchar(12) DEFAULT '',
  `tarjpagoabono` varchar(255) DEFAULT '',
  `tarjpagocuota1` varchar(255) DEFAULT '',
  `tarjpagocuota2` varchar(255) DEFAULT '',
  `matclayabo` tinyint(1) DEFAULT '0',
  `matclayuno` tinyint(1) DEFAULT '0',
  `matchclaydos` tinyint(1) DEFAULT '0',
  `c_abono` int(11) NOT NULL DEFAULT '0',
  `c_c1` int(11) NOT NULL DEFAULT '1',
  `c_c2` int(11) NOT NULL DEFAULT '2',
  `pagadapornc` varchar(50) DEFAULT '',
  `devolucionrealizada` tinyint(1) DEFAULT '0',
  `fechapagodevolucion` date DEFAULT NULL,
  `notacredito` tinyint(1) DEFAULT '0',
  `numerocredito` varchar(50) DEFAULT '',
  `fechavenabo` date DEFAULT NULL,
  `actualizarvencuotas` tinyint(1) DEFAULT '0',
  `estadosus` varchar(255) DEFAULT '',
  `fechallamadauno` date DEFAULT NULL,
  `fechallamadados` date DEFAULT NULL,
  `fechallamadatres` date DEFAULT NULL,
  `estadollamadauno` varchar(255) DEFAULT '',
  `estadollamadados` varchar(255) DEFAULT '',
  `estadollamadatres` varchar(255) DEFAULT '',
  `obs` varchar(255) DEFAULT '',
  `fechapagocompro` date DEFAULT NULL,
  `estado` varchar(255) DEFAULT '',
  `montopresupuesto` bigint(40) DEFAULT '0',
  `abonovencido` tinyint(1) DEFAULT '0',
  `correocliente` varchar(50) DEFAULT '',
  `sinacofi` tinyint(1) DEFAULT '0',
  `paymentsinid` int(11) unsigned DEFAULT '0',
  `contratofirmado` tinyint(1) DEFAULT '0',
  `fechacargopacabono` date DEFAULT NULL,
  `fechaabonofintocabono` date DEFAULT NULL,
  `fechacargopaccuota1` date DEFAULT NULL,
  `fechaabonofintoccuota1` date DEFAULT NULL,
  `fechacargopaccuota2` date DEFAULT NULL,
  `fechaabonofintoccuota2` date DEFAULT NULL,
  `obssus` varchar(200) DEFAULT '',
  `observacion_pago_abono` text,
  `observacion_pago_primera_cuota` text,
  `observacion_pago_segunda_cuota` text,
  `asociadoesterno` varchar(200) DEFAULT '',
  `id_customer_toku` varchar(200) DEFAULT '',
  `id_sub_toku` varchar(200) DEFAULT '',
  PRIMARY KEY (`suscripcionid`),
  KEY `vtiger_suscripcion_siniestro_idx` (`siniestro`),
  KEY `vtiger_suscripcion_nombrecliente_idx` (`nombrecliente`),
  KEY `vtiger_suscripcion_paymentsinid_idx` (`paymentsinid`),
  CONSTRAINT `fk_1_vtiger_suscripcionsuscripcionid` FOREIGN KEY (`suscripcionid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_suscripcion_inventory` (
  `id` int(11) DEFAULT NULL,
  `seq` int(10) DEFAULT NULL,
  KEY `suscripcion_inventory_idx` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_suscripcion_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_suscripcion_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_suscripcioncf` (
  `suscripcionid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`suscripcionid`),
  CONSTRAINT `fk_1_vtiger_suscripcioncfsuscripcionid` FOREIGN KEY (`suscripcionid`) REFERENCES `vtiger_suscripcion` (`suscripcionid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_suscripciondda` (
  `suscripcionddaid` int(11) NOT NULL,
  `id` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `idventademanda` int(11) unsigned DEFAULT '0',
  PRIMARY KEY (`suscripcionddaid`),
  KEY `vtiger_suscripciondda_idventademanda_idx` (`idventademanda`),
  CONSTRAINT `fk_1_vtiger_suscripcionddasuscripcionddaid` FOREIGN KEY (`suscripcionddaid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_suscripcionddacf` (
  `suscripcionddaid` int(11) NOT NULL,
  PRIMARY KEY (`suscripcionddaid`),
  CONSTRAINT `fk_1_vtiger_suscripcionddacfsuscripcionddaid` FOREIGN KEY (`suscripcionddaid`) REFERENCES `vtiger_suscripciondda` (`suscripcionddaid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_suscripciondemanda` (
  `suscripciondemandaid` int(11) NOT NULL,
  `id` varchar(255) DEFAULT NULL,
  `number` varchar(32) DEFAULT NULL,
  `rutcliente` varchar(30) DEFAULT '',
  `estadocaso` varchar(100) DEFAULT '',
  `estadocomercialdda` varchar(100) DEFAULT '',
  `valorplan` bigint(100) DEFAULT '0',
  `valorcuotas` bigint(100) DEFAULT '0',
  `nrofactura` varchar(100) DEFAULT '',
  `notacredito` tinyint(1) DEFAULT '0',
  `nronotacredito` varchar(100) DEFAULT '',
  `cuotaunoddapagada` tinyint(1) DEFAULT '0',
  `valorcuota1dda` bigint(100) DEFAULT '0',
  `fechacuotaunopagada` date DEFAULT NULL,
  `fechavencimientocuotauno` date DEFAULT NULL,
  `valorcuotadosdda` bigint(100) DEFAULT '0',
  `fechacuotadospagada` date DEFAULT NULL,
  `fechavencimientocuotados` date DEFAULT NULL,
  `cuotadospagada` tinyint(1) DEFAULT '0',
  `matchclaycuotauno` tinyint(1) DEFAULT '0',
  `matchclaycuotados` tinyint(1) DEFAULT '0',
  `bancopagocuotauno` varchar(255) DEFAULT '',
  `bacnodepagocuotados` varchar(255) DEFAULT '',
  `tipodepagocuotauno` varchar(255) DEFAULT '',
  `tipodepagocuotados` varchar(255) DEFAULT '',
  `estadosuscripcion` varchar(255) DEFAULT '',
  `fechapagocompro` date DEFAULT NULL,
  `estadollamadauno` varchar(255) DEFAULT '',
  `fechallamadauno` date DEFAULT NULL,
  `estadollamadados` varchar(255) DEFAULT '',
  `fechallamadados` date DEFAULT NULL,
  `estadollamadatres` varchar(255) DEFAULT '',
  `fechallamadatres` date DEFAULT NULL,
  `nrocuotas` varchar(255) DEFAULT '',
  `cuotatrespagada` tinyint(1) DEFAULT '0',
  `valorcuotatresdda` bigint(20) DEFAULT '0',
  `fechacuotatrespagada` date DEFAULT NULL,
  `fechavencimientocuotatres` date DEFAULT NULL,
  `matchclaycuotatres` tinyint(1) DEFAULT '0',
  `bancodepagocuotatres` varchar(255) DEFAULT '',
  `tipodepagocuotatres` varchar(255) DEFAULT '',
  `actualizar` tinyint(1) DEFAULT '0',
  `observaciones` text,
  `facturasusddapagada` tinyint(1) DEFAULT '0',
  `susfacturada` tinyint(1) DEFAULT '0',
  `fechaemifact` date DEFAULT NULL,
  `idventadedemanda` int(11) unsigned DEFAULT '0',
  `clienteid` int(11) unsigned DEFAULT '0',
  `siniestroid` int(11) unsigned DEFAULT '0',
  `agregadolistadda` tinyint(1) DEFAULT '0',
  `id_relbase` varchar(100) NOT NULL DEFAULT '0',
  `tipoplan` varchar(255) DEFAULT '',
  `observaciones_gestion` text,
  `observaciones_cuota_n1` varchar(120) DEFAULT '',
  `observaciones_cuota_n2` varchar(120) DEFAULT '',
  `observaciones_cuota_n3` varchar(120) DEFAULT '',
  `planaslegal` varchar(255) DEFAULT '',
  `id_customer_toku` varchar(200) DEFAULT '',
  `id_sub_toku` varchar(200) DEFAULT '',
  PRIMARY KEY (`suscripciondemandaid`),
  KEY `vtiger_suscripciondemanda_idventadedemanda_idx` (`idventadedemanda`),
  KEY `vtiger_suscripciondemanda_clienteid_idx` (`clienteid`),
  KEY `vtiger_suscripciondemanda_siniestroid_idx` (`siniestroid`),
  CONSTRAINT `fk_1_vtiger_suscripciondemandasuscripciondemandaid` FOREIGN KEY (`suscripciondemandaid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_suscripciondemandacf` (
  `suscripciondemandaid` int(11) NOT NULL,
  PRIMARY KEY (`suscripciondemandaid`),
  CONSTRAINT `fk_1_vtiger_suscripciondemandacfsuscripciondemandaid` FOREIGN KEY (`suscripciondemandaid`) REFERENCES `vtiger_suscripciondemanda` (`suscripciondemandaid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_svendorenquiries_status` (
  `svendorenquiries_statusid` int(10) NOT NULL AUTO_INCREMENT,
  `svendorenquiries_status` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `picklist_valueid` smallint(5) DEFAULT '0',
  `sortorderid` smallint(5) DEFAULT '0',
  PRIMARY KEY (`svendorenquiries_statusid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_systems` (
  `id` int(10) NOT NULL,
  `server` varchar(100) DEFAULT NULL,
  `server_port` int(10) DEFAULT NULL,
  `server_username` varchar(100) DEFAULT NULL,
  `server_password` varchar(100) DEFAULT NULL,
  `server_type` varchar(20) DEFAULT NULL,
  `smtp_auth` varchar(5) DEFAULT NULL,
  `server_path` varchar(256) DEFAULT NULL,
  `from_email_field` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tab` (
  `tabid` smallint(5) NOT NULL DEFAULT '0',
  `name` varchar(25) NOT NULL,
  `presence` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `tabsequence` smallint(5) NOT NULL DEFAULT '0',
  `tablabel` varchar(25) NOT NULL,
  `modifiedby` smallint(5) DEFAULT NULL,
  `modifiedtime` int(10) DEFAULT NULL,
  `customized` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `ownedby` tinyint(1) NOT NULL DEFAULT '0',
  `isentitytype` tinyint(1) NOT NULL DEFAULT '1',
  `version` varchar(10) DEFAULT NULL,
  `parent` varchar(30) DEFAULT NULL,
  `color` varchar(30) DEFAULT NULL,
  `coloractive` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `type` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`tabid`),
  UNIQUE KEY `tab_name_idx` (`name`),
  KEY `tab_modifiedby_idx` (`modifiedby`),
  KEY `tab_tabid_idx` (`tabid`),
  KEY `name` (`name`,`presence`),
  KEY `presence` (`presence`),
  KEY `name_2` (`name`,`presence`,`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tab_info` (
  `tabid` smallint(5) DEFAULT NULL,
  `prefname` varchar(256) DEFAULT NULL,
  `prefvalue` varchar(256) DEFAULT NULL,
  KEY `fk_1_vtiger_tab_info` (`tabid`),
  CONSTRAINT `fk_1_vtiger_tab_info` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tarjpago` (
  `tarjpagoid` int(11) NOT NULL AUTO_INCREMENT,
  `tarjpago` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tarjpagoid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tarjpagoabono` (
  `tarjpagoabonoid` int(11) NOT NULL AUTO_INCREMENT,
  `tarjpagoabono` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tarjpagoabonoid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tarjpagocuota1` (
  `tarjpagocuota1id` int(11) NOT NULL AUTO_INCREMENT,
  `tarjpagocuota1` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tarjpagocuota1id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tarjpagocuota2` (
  `tarjpagocuota2id` int(11) NOT NULL AUTO_INCREMENT,
  `tarjpagocuota2` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tarjpagocuota2id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tarjpagocuota3` (
  `tarjpagocuota3id` int(11) NOT NULL AUTO_INCREMENT,
  `tarjpagocuota3` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tarjpagocuota3id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tarjpagocuota4` (
  `tarjpagocuota4id` int(11) NOT NULL AUTO_INCREMENT,
  `tarjpagocuota4` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tarjpagocuota4id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tarjpagocuota5` (
  `tarjpagocuota5id` int(11) NOT NULL AUTO_INCREMENT,
  `tarjpagocuota5` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tarjpagocuota5id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tarjpagocuota6` (
  `tarjpagocuota6id` int(11) NOT NULL AUTO_INCREMENT,
  `tarjpagocuota6` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tarjpagocuota6id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_taskpriority` (
  `taskpriorityid` int(10) NOT NULL AUTO_INCREMENT,
  `taskpriority` 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 (`taskpriorityid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_taskpriority_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ticketcf` (
  `ticketid` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`ticketid`),
  CONSTRAINT `fk_1_vtiger_ticketcf` FOREIGN KEY (`ticketid`) REFERENCES `vtiger_troubletickets` (`ticketid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ticketpriorities` (
  `ticketpriorities_id` int(10) NOT NULL AUTO_INCREMENT,
  `ticketpriorities` varchar(200) DEFAULT NULL,
  `presence` int(1) NOT NULL DEFAULT '0',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT NULL,
  `color` varchar(25) DEFAULT '	#E6FAD8',
  PRIMARY KEY (`ticketpriorities_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ticketpriorities_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ticketseverities` (
  `ticketseverities_id` int(10) NOT NULL AUTO_INCREMENT,
  `ticketseverities` varchar(200) DEFAULT NULL,
  `presence` int(1) NOT NULL DEFAULT '0',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT NULL,
  PRIMARY KEY (`ticketseverities_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ticketseverities_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ticketstatus` (
  `ticketstatus_id` int(10) NOT NULL AUTO_INCREMENT,
  `ticketstatus` varchar(200) DEFAULT NULL,
  `presence` int(1) NOT NULL DEFAULT '0',
  `picklist_valueid` int(10) NOT NULL DEFAULT '0',
  `sortorderid` int(10) DEFAULT NULL,
  `color` varchar(25) DEFAULT '#E6FAD8',
  PRIMARY KEY (`ticketstatus_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_ticketstatus_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_time_zone` (
  `time_zoneid` int(10) NOT NULL AUTO_INCREMENT,
  `time_zone` varchar(200) NOT NULL,
  `sortorderid` int(10) NOT NULL DEFAULT '0',
  `presence` int(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`time_zoneid`)
) ENGINE=InnoDB AUTO_INCREMENT=98 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_time_zone_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_timecontrol_type` (
  `timecontrol_typeid` int(10) NOT NULL AUTO_INCREMENT,
  `timecontrol_type` varchar(200) NOT NULL,
  `sortorderid` int(10) DEFAULT NULL,
  `presence` int(10) NOT NULL DEFAULT '1',
  `color` varchar(25) DEFAULT '#E6FAD8',
  PRIMARY KEY (`timecontrol_typeid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_timecontrol_type_seq` (
  `id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tip_rec` (
  `tip_recid` int(11) NOT NULL AUTO_INCREMENT,
  `tip_rec` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tip_recid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tipddacob` (
  `tipddacobid` int(11) NOT NULL AUTO_INCREMENT,
  `tipddacob` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tipddacobid`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tipo_demanda` (
  `tipo_demandaid` int(11) NOT NULL AUTO_INCREMENT,
  `tipo_demanda` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tipo_demandaid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tipocliente` (
  `tipoclienteid` int(11) NOT NULL AUTO_INCREMENT,
  `tipocliente` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tipoclienteid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tipocobranza` (
  `tipocobranzaid` int(11) NOT NULL AUTO_INCREMENT,
  `tipocobranza` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tipocobranzaid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tipocontrato` (
  `tipocontratoid` int(11) NOT NULL AUTO_INCREMENT,
  `tipocontrato` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tipocontratoid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tipocuenta` (
  `tipocuentaid` int(11) NOT NULL AUTO_INCREMENT,
  `tipocuenta` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tipocuentaid`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tipoddacobranza` (
  `tipoddacobranzaid` int(11) NOT NULL AUTO_INCREMENT,
  `tipoddacobranza` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tipoddacobranzaid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tipodenegociacion` (
  `tipodenegociacionid` int(11) NOT NULL AUTO_INCREMENT,
  `tipodenegociacion` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tipodenegociacionid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tipodepagocuotados` (
  `tipodepagocuotadosid` int(11) NOT NULL AUTO_INCREMENT,
  `tipodepagocuotados` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tipodepagocuotadosid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tipodepagocuotatres` (
  `tipodepagocuotatresid` int(11) NOT NULL AUTO_INCREMENT,
  `tipodepagocuotatres` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tipodepagocuotatresid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tipodepagocuotauno` (
  `tipodepagocuotaunoid` int(11) NOT NULL AUTO_INCREMENT,
  `tipodepagocuotauno` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tipodepagocuotaunoid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tipoempleado` (
  `tipoempleadoid` int(11) NOT NULL AUTO_INCREMENT,
  `tipoempleado` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tipoempleadoid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tipoempleadoconyugue` (
  `tipoempleadoconyugueid` int(11) NOT NULL AUTO_INCREMENT,
  `tipoempleadoconyugue` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tipoempleadoconyugueid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tipoinspeccion` (
  `tipoinspeccionid` int(11) NOT NULL AUTO_INCREMENT,
  `tipoinspeccion` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tipoinspeccionid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tipopago` (
  `tipopagoid` int(11) NOT NULL AUTO_INCREMENT,
  `tipopago` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tipopagoid`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tipopagoaddendum1` (
  `tipopagoaddendum1id` int(11) NOT NULL AUTO_INCREMENT,
  `tipopagoaddendum1` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tipopagoaddendum1id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tipoplan` (
  `tipoplanid` int(11) NOT NULL AUTO_INCREMENT,
  `tipoplan` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tipoplanid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tipopropiedad` (
  `tipopropiedadid` int(11) NOT NULL AUTO_INCREMENT,
  `tipopropiedad` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tipopropiedadid`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE `vtiger_tiposervicio` (
  `tiposervicioid` int(11) NOT NULL AUTO_INCREMENT,
  `tiposervicio` varchar(255) DEFAULT NULL,
  `presence` tinyint(1) DEFAULT '1',
  `sortorderid` smallint(6) DEFAULT '0',
  PRIMARY KEY (`tiposervicioid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
