/*
SQLyog Community
MySQL - 5.5.20-log : Database - predictionweb
*********************************************************************
*/

/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
/*Table structure for table `cat_operador` */

CREATE TABLE `cat_operador` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(800) DEFAULT NULL,
  `licencia` varchar(100) DEFAULT NULL,
  `rfc` varchar(20) DEFAULT NULL,
  `id_sat_tipofigura` varchar(10) DEFAULT NULL,
  `status` int(11) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

/*Table structure for table `cat_vehiculo` */

CREATE TABLE `cat_vehiculo` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `descripcion` varchar(800) DEFAULT NULL,
  `modelo` int(11) DEFAULT NULL,
  `placa` varchar(100) DEFAULT NULL,
  `peso` decimal(9,2) DEFAULT NULL,
  `aseguradora` varchar(500) DEFAULT NULL,
  `poliza` varchar(200) DEFAULT NULL,
  `id_sat_configvehicular` varchar(10) DEFAULT NULL,
  `id_sat_tipopermisosct` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

/*Table structure for table `sat_colonia` */

CREATE TABLE `sat_colonia` (
  `id` varchar(10) CHARACTER SET latin1 COLLATE latin1_spanish_ci DEFAULT NULL,
  `codigopostal` varchar(10) CHARACTER SET latin1 COLLATE latin1_spanish_ci DEFAULT NULL,
  `descripcion` varchar(800) CHARACTER SET latin1 COLLATE latin1_spanish_ci DEFAULT NULL,
  `status` int(11) DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*Table structure for table `sat_configvehicular` */

CREATE TABLE `sat_configvehicular` (
  `id` varchar(100) NOT NULL,
  `descripcion` varchar(800) DEFAULT NULL,
  `ejes` varchar(10) DEFAULT NULL,
  `llantas` varchar(100) DEFAULT NULL,
  `remolque` varchar(10) DEFAULT NULL,
  `orden` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*Table structure for table `sat_estado` */

CREATE TABLE `sat_estado` (
  `id` varchar(50) CHARACTER SET latin1 COLLATE latin1_spanish_ci NOT NULL,
  `id_sat_pais` varchar(50) CHARACTER SET latin1 COLLATE latin1_spanish_ci DEFAULT NULL,
  `descripcion` varchar(800) CHARACTER SET latin1 COLLATE latin1_spanish_ci DEFAULT NULL,
  `status` int(11) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*Table structure for table `sat_formapago` */

CREATE TABLE `sat_formapago` (
  `id` varchar(100) NOT NULL,
  `descripcion` varchar(500) DEFAULT NULL,
  `status` int(11) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `sat_localidad` */

CREATE TABLE `sat_localidad` (
  `id` varchar(10) CHARACTER SET latin1 COLLATE latin1_spanish_ci NOT NULL,
  `id_sat_estado` varchar(10) CHARACTER SET latin1 COLLATE latin1_spanish_ci NOT NULL,
  `descripcion` varchar(800) CHARACTER SET latin1 COLLATE latin1_spanish_ci DEFAULT NULL,
  `status` int(11) DEFAULT '1',
  PRIMARY KEY (`id`,`id_sat_estado`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*Table structure for table `sat_metodopago` */

CREATE TABLE `sat_metodopago` (
  `id` varchar(10) NOT NULL DEFAULT '',
  `descripcion` varchar(300) DEFAULT NULL,
  `text` varchar(300) DEFAULT NULL,
  `version` varchar(10) DEFAULT NULL,
  `orden` int(1) DEFAULT NULL,
  `status` int(11) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Table structure for table `sat_municipio` */

CREATE TABLE `sat_municipio` (
  `id` varchar(10) CHARACTER SET latin1 COLLATE latin1_spanish_ci NOT NULL,
  `id_sat_estado` varchar(10) CHARACTER SET latin1 COLLATE latin1_spanish_ci NOT NULL,
  `descripcion` varchar(800) CHARACTER SET latin1 COLLATE latin1_spanish_ci DEFAULT NULL,
  `status` int(11) DEFAULT '1',
  PRIMARY KEY (`id`,`id_sat_estado`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*Table structure for table `sat_pais` */

CREATE TABLE `sat_pais` (
  `id` varchar(50) CHARACTER SET latin1 COLLATE latin1_spanish_ci NOT NULL,
  `descripcion` varchar(800) CHARACTER SET latin1 COLLATE latin1_spanish_ci DEFAULT NULL,
  `status` int(11) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*Table structure for table `sat_regimenfiscal` */

CREATE TABLE `sat_regimenfiscal` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `clave` int(11) DEFAULT NULL,
  `descripcion` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` int(5) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

/*Table structure for table `sat_tipofigura` */

CREATE TABLE `sat_tipofigura` (
  `id` varchar(10) NOT NULL,
  `descripcion` varchar(200) DEFAULT NULL,
  `status` int(11) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*Table structure for table `sat_tipopermisosct` */

CREATE TABLE `sat_tipopermisosct` (
  `id` varchar(20) NOT NULL,
  `descripcion` varchar(800) DEFAULT NULL,
  `clavetransporte` varchar(100) DEFAULT NULL,
  `status` int(11) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*Table structure for table `sat_usocfdi` */

CREATE TABLE `sat_usocfdi` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `clave` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `descripcion` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` int(5) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

/*Table structure for table `sys_direccion` */

CREATE TABLE `sys_direccion` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `calle` varchar(256) COLLATE latin1_spanish_ci DEFAULT '',
  `numexterior` varchar(256) COLLATE latin1_spanish_ci DEFAULT '',
  `numinterior` varchar(256) COLLATE latin1_spanish_ci DEFAULT '',
  `cp` varchar(50) COLLATE latin1_spanish_ci DEFAULT '',
  `colonia` varchar(20) COLLATE latin1_spanish_ci DEFAULT '',
  `municipio` varchar(20) COLLATE latin1_spanish_ci DEFAULT '0',
  `localidad` varchar(20) COLLATE latin1_spanish_ci DEFAULT NULL,
  `estado` varchar(11) COLLATE latin1_spanish_ci DEFAULT 'CHP',
  `pais` varchar(11) COLLATE latin1_spanish_ci DEFAULT 'MEX',
  `tipo` int(11) DEFAULT '1',
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `status` int(8) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COLLATE=latin1_spanish_ci;

/*Table structure for table `sys_empresa` */

CREATE TABLE `sys_empresa` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `descripcion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `razonsocial` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rfc` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `direccion` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cp` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `telefono` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `id_sat_regimenfiscal` varchar(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nocertificado` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `numpermisosct` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `permisosct` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `logo` varchar(900) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `serie` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `folio` int(11) DEFAULT NULL,
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `status` int(5) DEFAULT '1',
  `env` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'prod',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

/*Table structure for table `tpv_almacen` */

CREATE TABLE `tpv_almacen` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_almacenprediction` int(11) DEFAULT NULL,
  `descripcion` varchar(256) COLLATE latin1_spanish_ci DEFAULT NULL,
  `telefono` varchar(100) COLLATE latin1_spanish_ci DEFAULT NULL,
  `email` varchar(100) COLLATE latin1_spanish_ci DEFAULT NULL,
  `id_sys_empresa` int(5) DEFAULT NULL,
  `latitud` varchar(256) COLLATE latin1_spanish_ci DEFAULT NULL,
  `longitud` varchar(256) COLLATE latin1_spanish_ci DEFAULT NULL,
  `id_sys_direccion` int(11) DEFAULT NULL,
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `status` int(8) DEFAULT '1',
  `serie` varchar(999) COLLATE latin1_spanish_ci DEFAULT '',
  `folio` int(11) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COLLATE=latin1_spanish_ci;

/*Table structure for table `tpv_cartaporte` */

CREATE TABLE `tpv_cartaporte` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idprediction` int(11) DEFAULT NULL,
  `serie` varchar(10) DEFAULT 'TRAS',
  `folio` int(11) DEFAULT NULL,
  `id_cat_vehiculo` int(11) DEFAULT NULL,
  `id_tpv_almacen_origen` int(11) DEFAULT NULL,
  `fecha_envio` date DEFAULT NULL,
  `id_tpv_almacen_destino` int(11) DEFAULT NULL,
  `fecha_llegada` date DEFAULT NULL,
  `id_cat_operador` int(11) DEFAULT NULL,
  `distancia` decimal(9,2) DEFAULT NULL,
  `pesobruto` decimal(9,2) DEFAULT NULL,
  `tipopermisosct` varchar(100) DEFAULT NULL,
  `permisosct` varchar(100) DEFAULT NULL,
  `fecha` date DEFAULT NULL,
  `hora` time DEFAULT NULL,
  `uuid` varchar(800) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
