--
-- Host: localhost    Database: pasabus
-- ------------------------------------------------------


--
-- Table structure for table `concesiones_inclusiones`
--

CREATE TABLE `concesiones_inclusiones` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `ruta_id` int(10) unsigned NOT NULL,
  `concesion_inclusion_numero` varchar(120) NOT NULL COMMENT 'Numero de concesion o Folio',
  `concesion_inclusion_tipo` tinyint(1) NOT NULL COMMENT '1. Concesion\r\n2. Inclusion',
  `tipo_tramite` tinyint(1) NOT NULL COMMENT '1. Nuevo\r\n2. Reasignacion\r\n3. Renovacion',
  `numero_autorizaciones` int(11) DEFAULT NULL COMMENT 'CONDICIONAL SOLO PARA INCLUSIONES',
  `fecha_inicio` date DEFAULT NULL,
  `fecha_termino` date NOT NULL,
  `fecha_vigencia` date DEFAULT NULL,
  `observacion` text DEFAULT NULL,
  `documento_url` varchar(128) NOT NULL,
  `status` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `INDEX_concesiones_1` (`id`) USING BTREE,
  KEY `id` (`id`,`concesion_inclusion_numero`) USING BTREE,
  KEY `fk_concesiones_inclusiones_rutas1_idx` (`ruta_id`),
  CONSTRAINT `fk_concesiones_inclusiones_rutas1` FOREIGN KEY (`ruta_id`) REFERENCES `rutas` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `concesiones_inclusiones`
--


--
-- Table structure for table `concesiones_unidades_matriculas`
--

CREATE TABLE `concesiones_unidades_matriculas` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `concesion_unidad_id` int(10) DEFAULT NULL,
  `concesion_inclusion_id` int(10) unsigned DEFAULT NULL,
  `unidad_id` int(10) unsigned DEFAULT NULL,
  `unidad_engomado_id` int(10) unsigned NOT NULL,
  `matricula` varchar(45) NOT NULL,
  `tarjeta_circulacion` varchar(45) NOT NULL,
  `tipo` tinyint(1) NOT NULL COMMENT '1. Nueva\r\n2. Reposicion',
  `matricula_documento_url` varchar(128) NOT NULL,
  `tarjeta_circulacion_documento_url` varchar(128) NOT NULL,
  `fecha_alta` datetime NOT NULL,
  `fecha_baja` datetime DEFAULT NULL,
  `fecha_alta_tarjeta_circulacion` datetime NOT NULL,
  `comentario_baja` text DEFAULT NULL,
  `status` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `INDEX_concesiones_unidades_matriculas_1` (`id`) USING BTREE,
  KEY `fk_concesiones_unidades_matriculas_unidades_engomados1_idx` (`unidad_engomado_id`),
  KEY `fk_concesiones_unidades_matriculas_unidades1_idx` (`unidad_id`),
  KEY `fk_concesiones_unidades_matriculas_concesiones_inclusiones1_idx` (`concesion_inclusion_id`),
  CONSTRAINT `fk_concesiones_unidades_matriculas_concesiones_inclusiones1` FOREIGN KEY (`concesion_inclusion_id`) REFERENCES `concesiones_inclusiones` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_concesiones_unidades_matriculas_unidades1` FOREIGN KEY (`unidad_id`) REFERENCES `unidades` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_concesiones_unidades_matriculas_unidades_engomados1` FOREIGN KEY (`unidad_engomado_id`) REFERENCES `unidades_engomados` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `concesiones_unidades_matriculas`
--


--
-- Table structure for table `departamentos`
--

CREATE TABLE `departamentos` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `departamento_id` int(10) unsigned NOT NULL,
  `nivel` tinyint(4) NOT NULL,
  `nombre_departamento` varchar(250) NOT NULL,
  `status` tinyint(4) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  `departamentos_id` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`),
  KEY `fk_departamentos_departamentos1_idx` (`departamento_id`),
  CONSTRAINT `fk_departamentos_departamentos1` FOREIGN KEY (`departamento_id`) REFERENCES `departamentos` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `departamentos`
--


--
-- Table structure for table `documentos`
--

CREATE TABLE `documentos` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `documento_nombre` varchar(45) NOT NULL,
  `status` tinyint(4) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `documentos`
--


--
-- Table structure for table `empleados`
--

CREATE TABLE `empleados` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `estado_civil_id` int(10) unsigned NOT NULL,
  `escolaridad_id` int(10) unsigned NOT NULL,
  `lugar_nacimiento_id` int(10) unsigned NOT NULL,
  `tipo_sangre_id` int(10) unsigned NOT NULL,
  `empresa_patronal_id` int(10) unsigned DEFAULT NULL,
  `tipo_empleado` char(1) DEFAULT '',
  `identificador` int(10) DEFAULT NULL,
  `empleado_nombre` varchar(120) NOT NULL,
  `apellido_paterno` varchar(120) NOT NULL,
  `apellido_materno` varchar(120) NOT NULL,
  `fecha_nacimiento` date DEFAULT NULL,
  `genero` char(1) NOT NULL COMMENT 'M=MASCULINO, F=FEMENINO',
  `curp` varchar(19) NOT NULL,
  `rfc` varchar(13) DEFAULT '',
  `numero_seguridad_social` decimal(20,0) unsigned DEFAULT NULL,
  `fecha_alta_empresa_patronal` date DEFAULT NULL,
  `fecha_baja_empresa_patronal` date DEFAULT NULL,
  `valida_asistencia` tinyint(1) DEFAULT 0,
  `calle` varchar(240) NOT NULL,
  `numero_exterior` varchar(90) NOT NULL,
  `numero_interior` varchar(90) DEFAULT '',
  `email` text DEFAULT NULL,
  `url_imagen` varchar(460) NOT NULL,
  `telefonos` text DEFAULT NULL,
  `telefono` varchar(90) NOT NULL,
  `movil` varchar(90) DEFAULT '',
  `alergias` text NOT NULL,
  `padecimientos` text NOT NULL,
  `contactos_emergencia` text DEFAULT NULL,
  `observacion` text DEFAULT NULL,
  `observacion_baja` text DEFAULT NULL,
  `fecha_alta` date DEFAULT NULL,
  `fecha_baja` date DEFAULT NULL,
  `status` tinyint(1) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`),
  KEY `fk_empleados_estados_civiles1_idx` (`estado_civil_id`),
  KEY `fk_empleados_empresas_patronales1_idx` (`empresa_patronal_id`),
  KEY `fk_empleados_tipos_sangre1_idx` (`tipo_sangre_id`),
  KEY `fk_empleados_escolaridades1_idx` (`escolaridad_id`),
  KEY `fk_empleados_estados1_idx` (`lugar_nacimiento_id`),
  CONSTRAINT `fk_empleados_empresas_patronales1` FOREIGN KEY (`empresa_patronal_id`) REFERENCES `empresas_patronales` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_empleados_escolaridades1` FOREIGN KEY (`escolaridad_id`) REFERENCES `escolaridades` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_empleados_estados1` FOREIGN KEY (`lugar_nacimiento_id`) REFERENCES `estados` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_empleados_estados_civiles1` FOREIGN KEY (`estado_civil_id`) REFERENCES `estados_civiles` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_empleados_tipos_sangre1` FOREIGN KEY (`tipo_sangre_id`) REFERENCES `tipos_sangre` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `empleados`
--

INSERT INTO `empleados` VALUES (1,2,1,17,8,NULL,'S',9889,'Sergio','Monroy','GTZ','2000-02-02','1','MOGD','SDFS',0,NULL,NULL,-1,'','','','smonroy@matec.app','','[{\"tipo_telefono\":\"celular\",\"numero\":\"7771993568\"}]','','','Polvo','Ninguno','[]',NULL,NULL,'2010-02-11',NULL,1,'2024-06-12 20:53:01','2024-06-13 19:24:01');

--
-- Table structure for table `empleados_bajas`
--

CREATE TABLE `empleados_bajas` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `empleado_id` int(10) unsigned NOT NULL,
  `empleado_veto_motivo_id` int(10) unsigned DEFAULT NULL,
  `tipo_baja` tinyint(1) NOT NULL COMMENT '1. Baja\n2. Veto',
  `observacion` text NOT NULL,
  `status` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`),
  KEY `fk_empleados_bajas_empleados1_idx` (`empleado_id`),
  KEY `fk_empleados_bajas_empleados_vetos_motivos1_idx` (`empleado_veto_motivo_id`),
  CONSTRAINT `fk_empleados_bajas_empleados1` FOREIGN KEY (`empleado_id`) REFERENCES `empleados` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_empleados_bajas_empleados_vetos_motivos1` FOREIGN KEY (`empleado_veto_motivo_id`) REFERENCES `empleados_vetos_motivos` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `empleados_bajas`
--

INSERT INTO `empleados_bajas` VALUES (1,1,NULL,1,'Ninguna',1,'2024-06-13 18:38:05',NULL);

--
-- Table structure for table `empleados_vetos_motivos`
--

CREATE TABLE `empleados_vetos_motivos` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `motivo_nombre` varchar(50) NOT NULL,
  `status` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `empleados_vetos_motivos`
--


--
-- Table structure for table `empresas_patronales`
--

CREATE TABLE `empresas_patronales` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `empresa_patronal_nombre` varchar(100) NOT NULL,
  `status` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `empresas_patronales`
--


--
-- Table structure for table `escolaridades`
--

CREATE TABLE `escolaridades` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `escolaridad_nombre` varchar(100) NOT NULL,
  `status` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `escolaridades`
--

INSERT INTO `escolaridades` VALUES (1,'Sin escolaridad',1,'2024-06-11 11:15:47','2024-06-11 18:30:36'),(2,'Primaria',1,'2024-06-11 11:17:07','2024-06-11 18:24:01'),(3,'Secundaria',1,'2024-06-11 11:17:35','2024-06-11 18:24:09'),(4,'Bachillerato',1,'2024-06-11 11:20:13','2024-06-11 18:24:18');

--
-- Table structure for table `estados`
--

CREATE TABLE `estados` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `estado` varchar(200) NOT NULL,
  `abreviatura` varchar(10) NOT NULL,
  `status` tinyint(4) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `id_UNIQUE` (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `estados`
--

INSERT INTO `estados` VALUES (1,'Aguascalientes','AGS',1,'2024-01-01 00:00:01',NULL),(2,'Baja california','BC',1,'2024-01-01 00:00:01',NULL),(3,'Baja california sur','BCS',1,'2024-01-01 00:00:01',NULL),(4,'Campeche','CAM',1,'2024-01-01 00:00:01',NULL),(5,'Chiapas','CHIS',1,'2024-01-01 00:00:01',NULL),(6,'Chiihuahua','CHIH',1,'2024-01-01 00:00:01',NULL),(7,'Ciudad de México','CDMX',1,'2024-01-01 00:00:01',NULL),(8,'Coahuila','COAH',1,'2024-01-01 00:00:01',NULL),(9,'Colima','COL',1,'2024-01-01 00:00:01',NULL),(10,'Durango','DUR',1,'2024-01-01 00:00:01',NULL),(11,'Estado de México','EDOMEX',1,'2024-01-01 00:00:01',NULL),(12,'Guanajuato','GTO',1,'2024-01-01 00:00:01',NULL),(13,'Guerrero','GRO',1,'2024-01-01 00:00:01',NULL),(14,'Hidalgo','HGO',1,'2024-01-01 00:00:01',NULL),(15,'Jalisco','JAL',1,'2024-01-01 00:00:01',NULL),(16,'Michoacán','MICH',1,'2024-01-01 00:00:01',NULL),(17,'Morelos','MOR',1,'2024-01-01 00:00:01',NULL);

--
-- Table structure for table `estados_civiles`
--

CREATE TABLE `estados_civiles` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `estado_civil_nombre` varchar(50) NOT NULL,
  `status` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `estados_civiles`
--

INSERT INTO `estados_civiles` VALUES (1,'Soltero',1,'2024-06-11 19:48:52','2024-06-11 19:54:30'),(2,'Casado',1,'2024-06-11 19:49:00',NULL),(3,'Divorciado',1,'2024-06-11 19:49:10','2024-06-11 19:53:17');

--
-- Table structure for table `logs`
--

CREATE TABLE `logs` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `usuario_id` int(10) unsigned NOT NULL,
  `table` varchar(120) NOT NULL,
  `row_table_id` int(10) unsigned NOT NULL,
  `data` longtext NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`),
  KEY `fk_logs_usuarios1_idx` (`usuario_id`),
  CONSTRAINT `fk_logs_usuarios1` FOREIGN KEY (`usuario_id`) REFERENCES `usuarios` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `logs`
--


--
-- Table structure for table `modulos_acciones_roles`
--

CREATE TABLE `modulos_acciones_roles` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `modulo_accion_id` int(10) unsigned NOT NULL,
  `rol_id` int(10) unsigned NOT NULL,
  `status` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `id_UNIQUE` (`id`) USING BTREE,
  KEY `fk_modulos_acciones_roles_modulos_acciones1_idx` (`modulo_accion_id`) USING BTREE,
  KEY `fk_modulos_acciones_roles_roles1_idx` (`rol_id`) USING BTREE,
  CONSTRAINT `modulos_acciones_roles_ibfk_1` FOREIGN KEY (`rol_id`) REFERENCES `roles` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=64 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `modulos_acciones_roles`
--

INSERT INTO `modulos_acciones_roles` VALUES (1,960000,1,1,'2024-06-09 22:50:34',NULL),(2,960101,1,1,'2024-06-09 22:50:34',NULL),(3,960102,1,1,'2024-06-09 22:50:34',NULL),(4,960103,1,1,'2024-06-09 22:50:34',NULL),(5,960104,1,1,'2024-06-09 22:50:34',NULL),(6,960105,1,1,'2024-06-09 22:50:34',NULL),(7,960201,1,1,'2024-06-09 22:50:34',NULL),(8,960202,1,1,'2024-06-09 22:50:34',NULL),(9,960203,1,1,'2024-06-09 22:50:34',NULL),(10,960204,1,1,'2024-06-09 22:50:34',NULL),(25,960101,2,1,'2024-06-10 22:40:10',NULL),(31,900101,1,1,'2024-06-11 09:25:27',NULL),(32,900102,1,1,'2024-06-11 09:25:28',NULL),(33,900103,1,1,'2024-06-11 09:25:29',NULL),(34,900104,1,1,'2024-06-11 09:25:30',NULL),(35,900105,1,1,'2024-06-11 09:25:32',NULL),(36,900201,1,1,'2024-06-11 18:31:50',NULL),(37,900202,1,1,'2024-06-11 18:31:50',NULL),(38,900203,1,1,'2024-06-11 18:31:50',NULL),(39,900204,1,1,'2024-06-11 18:31:50',NULL),(40,900205,1,1,'2024-06-11 18:31:50',NULL),(41,110101,1,1,'2024-06-11 20:00:43',NULL),(42,110102,1,1,'2024-06-11 20:00:43',NULL),(43,110103,1,1,'2024-06-11 20:00:43',NULL),(44,110104,1,1,'2024-06-11 20:00:43',NULL),(45,110105,1,1,'2024-06-11 20:00:43',NULL),(46,110106,1,1,'2024-06-13 12:17:39',NULL),(47,110107,1,1,'2024-06-13 12:17:40',NULL),(48,900401,1,1,'2024-06-14 09:20:32',NULL),(49,900301,1,1,'2024-06-14 09:20:59',NULL),(50,900402,1,1,'2024-06-14 12:35:57',NULL),(51,900403,1,1,'2024-06-14 12:35:58',NULL),(52,900404,1,1,'2024-06-14 12:36:00',NULL),(53,900405,1,1,'2024-06-14 12:36:01',NULL),(54,900302,1,1,'2024-06-14 15:08:59',NULL),(55,900303,1,1,'2024-06-14 20:09:47',NULL),(56,900304,1,1,'2024-06-14 20:09:51',NULL),(57,900305,1,1,'2024-06-14 20:09:53',NULL),(58,900311,1,1,'2024-06-14 21:29:21',NULL),(59,900312,1,1,'2024-06-14 21:44:00',NULL),(60,900313,1,1,'2024-06-14 22:05:14',NULL),(61,900314,1,1,'2024-06-14 22:05:16',NULL),(62,900315,1,1,'2024-06-14 22:05:18',NULL),(63,210101,1,1,'2024-06-14 22:45:50',NULL);

--
-- Table structure for table `numeros_economicos`
--

CREATE TABLE `numeros_economicos` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `numero_economico_modalidad_id` int(10) unsigned NOT NULL,
  `numero_economico` int(10) unsigned NOT NULL,
  `observacion` text DEFAULT NULL,
  `status` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`),
  KEY `fk_numeros_economicos_numeros_economicos_modalidades1_idx` (`numero_economico_modalidad_id`),
  CONSTRAINT `fk_numeros_economicos_numeros_economicos_modalidades1` FOREIGN KEY (`numero_economico_modalidad_id`) REFERENCES `numeros_economicos_modalidades` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `numeros_economicos`
--


--
-- Table structure for table `numeros_economicos_modalidades`
--

CREATE TABLE `numeros_economicos_modalidades` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `modalidad_nombre` varchar(50) NOT NULL,
  `codigo` char(2) DEFAULT '',
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `numeros_economicos_modalidades`
--


--
-- Table structure for table `permisionarios`
--

CREATE TABLE `permisionarios` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `permisionario_tipo` int(11) DEFAULT NULL,
  `permisionario_nombre` varchar(80) NOT NULL,
  `apellido_paterno` varchar(80) NOT NULL,
  `apellido_materno` varchar(80) NOT NULL,
  `tel1` varchar(45) DEFAULT '',
  `tel2` varchar(45) DEFAULT NULL,
  `movil` varchar(45) DEFAULT NULL,
  `email` varchar(45) DEFAULT NULL,
  `calle` varchar(120) NOT NULL DEFAULT '',
  `noExt` varchar(120) NOT NULL DEFAULT '',
  `noInt` varchar(180) DEFAULT NULL,
  `observacion` text DEFAULT NULL,
  `imagen_url` varchar(45) DEFAULT NULL,
  `ine_url` varchar(45) DEFAULT NULL,
  `curp_url` varchar(45) DEFAULT NULL,
  `acta_nacimiento_url` varchar(45) DEFAULT NULL,
  `comprobante_domicilio_url` varchar(45) DEFAULT NULL,
  `contactos_emergencia` text NOT NULL,
  `telefonos` text NOT NULL,
  `status` tinyint(1) DEFAULT 0,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `permisionarios`
--


--
-- Table structure for table `permisionarios_claves`
--

CREATE TABLE `permisionarios_claves` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `permisionario_tipo_id` int(10) unsigned NOT NULL,
  `permisionario_clave` int(10) unsigned NOT NULL,
  `status` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`),
  KEY `fk_permisionarios_claves_permisionarios_tipos1_idx` (`permisionario_tipo_id`),
  CONSTRAINT `fk_permisionarios_claves_permisionarios_tipos1` FOREIGN KEY (`permisionario_tipo_id`) REFERENCES `permisionarios_tipos` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `permisionarios_claves`
--


--
-- Table structure for table `permisionarios_permisionarios_claves`
--

CREATE TABLE `permisionarios_permisionarios_claves` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `permisionario_clave_id` int(10) unsigned NOT NULL,
  `permisionario_id` int(10) unsigned NOT NULL,
  `observacion` text DEFAULT NULL,
  `fecha_asignacion` date NOT NULL,
  `fecha_desasignacion` date DEFAULT NULL,
  `status` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`),
  KEY `fk_permisionarios_permisionarios_claves_permisionarios_clav_idx` (`permisionario_clave_id`),
  KEY `fk_permisionarios_permisionarios_claves_permisionarios1_idx` (`permisionario_id`),
  CONSTRAINT `fk_permisionarios_permisionarios_claves_permisionarios1` FOREIGN KEY (`permisionario_id`) REFERENCES `permisionarios` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_permisionarios_permisionarios_claves_permisionarios_claves1` FOREIGN KEY (`permisionario_clave_id`) REFERENCES `permisionarios_claves` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `permisionarios_permisionarios_claves`
--


--
-- Table structure for table `permisionarios_tipos`
--

CREATE TABLE `permisionarios_tipos` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `tipo_nombre` varchar(128) NOT NULL,
  `codigo` char(2) NOT NULL COMMENT 'La clave funciona para empatar los datos con el tipo de permisionario',
  `status` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `permisionarios_tipos`
--


--
-- Table structure for table `permisionarios_unidades`
--

CREATE TABLE `permisionarios_unidades` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `permisionario_id` int(10) unsigned NOT NULL,
  `unidad_id` int(10) unsigned NOT NULL,
  `fecha_alta` datetime NOT NULL,
  `fecha_baja` datetime DEFAULT NULL,
  `comentario_alta` text NOT NULL,
  `comentario_baja` text DEFAULT NULL,
  `status` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`),
  KEY `fk_permisionarios_unidades_permisionarios1_idx` (`permisionario_id`),
  KEY `fk_permisionarios_unidades_unidades1_idx` (`unidad_id`),
  CONSTRAINT `fk_permisionarios_unidades_permisionarios1` FOREIGN KEY (`permisionario_id`) REFERENCES `permisionarios` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_permisionarios_unidades_unidades1` FOREIGN KEY (`unidad_id`) REFERENCES `unidades` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `permisionarios_unidades`
--


--
-- Table structure for table `permisionarios_unidades_numeros_economicos`
--

CREATE TABLE `permisionarios_unidades_numeros_economicos` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `permisionario_id` int(10) unsigned DEFAULT NULL,
  `unidad_id` int(10) unsigned NOT NULL,
  `numero_economico_id` int(10) unsigned NOT NULL,
  `fecha_alta` datetime NOT NULL,
  `fecha_baja` datetime DEFAULT NULL,
  `comentario_alta` text DEFAULT NULL,
  `comentario_baja` text DEFAULT NULL,
  `status` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`),
  KEY `fk_permisionarios_unidades_numeros_economicos_permisionario_idx` (`permisionario_id`),
  KEY `fk_permisionarios_unidades_numeros_economicos_unidades1_idx` (`unidad_id`),
  KEY `fk_permisionarios_unidades_numeros_economicos_numeros_econo_idx` (`numero_economico_id`),
  CONSTRAINT `fk_permisionarios_unidades_numeros_economicos_numeros_economi1` FOREIGN KEY (`numero_economico_id`) REFERENCES `numeros_economicos` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_permisionarios_unidades_numeros_economicos_permisionarios1` FOREIGN KEY (`permisionario_id`) REFERENCES `permisionarios` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_permisionarios_unidades_numeros_economicos_unidades1` FOREIGN KEY (`unidad_id`) REFERENCES `unidades` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `permisionarios_unidades_numeros_economicos`
--


--
-- Table structure for table `roles`
--

CREATE TABLE `roles` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `rol_nombre` varchar(45) NOT NULL,
  `status` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `id_UNIQUE` (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` VALUES (1,'superusuario',1,'2024-06-04 02:23:22',NULL),(2,'gerencia',1,'2024-06-11 03:30:01','2024-06-10 23:22:26');

--
-- Table structure for table `rutas`
--

CREATE TABLE `rutas` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `ruta_nombre` varchar(64) NOT NULL,
  `documento_url` varchar(100) NOT NULL,
  `numero_derrotero` varchar(15) NOT NULL,
  `fecha_autorizacion` date DEFAULT NULL,
  `parque_vehicular` int(11) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `rutas`
--


--
-- Table structure for table `tipos_sangre`
--

CREATE TABLE `tipos_sangre` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `tipo_sangre` varchar(15) NOT NULL,
  `status` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `tipos_sangre`
--

INSERT INTO `tipos_sangre` VALUES (1,'A+',1,'2024-01-01 00:01:01',NULL),(2,'A-',1,'2024-01-01 00:00:01',NULL),(3,'B+',1,'2024-01-01 00:00:01',NULL),(4,'B-',1,'2024-01-01 00:00:01',NULL),(5,'AB+',1,'2024-01-01 00:00:01',NULL),(6,'AB-',1,'2024-01-01 00:00:01',NULL),(7,'O+',1,'2024-01-01 00:00:01',NULL),(8,'O-',1,'2024-01-01 00:00:01',NULL);

--
-- Table structure for table `unidades`
--

CREATE TABLE `unidades` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `unidad_tipo_id` int(10) unsigned DEFAULT NULL,
  `unidad_submarca_id` int(10) unsigned NOT NULL,
  `asientos` int(11) DEFAULT NULL,
  `modelo` int(10) unsigned NOT NULL,
  `numero_motor` varchar(50) NOT NULL,
  `numero_serie_niv` varchar(50) NOT NULL,
  `observacion` text DEFAULT NULL,
  `urlFactura` varchar(128) DEFAULT NULL,
  `urlCartaFactura` varchar(128) DEFAULT NULL,
  `urlContratoFinanciamiento` varchar(128) DEFAULT NULL,
  `estatus` char(1) NOT NULL COMMENT 'A = ACTIVO B = BAJA',
  `status` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `id_UNIQUE` (`id`),
  KEY `fk_unidades_unidades_tipos1_idx` (`unidad_tipo_id`),
  KEY `fk_unidades_unidades_submarcas1_idx` (`unidad_submarca_id`),
  CONSTRAINT `fk_unidades_unidades_submarcas1` FOREIGN KEY (`unidad_submarca_id`) REFERENCES `unidades_submarcas` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_unidades_unidades_tipos1` FOREIGN KEY (`unidad_tipo_id`) REFERENCES `unidades_tipos` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `unidades`
--


--
-- Table structure for table `unidades_engomados`
--

CREATE TABLE `unidades_engomados` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `engomado_nombre` varchar(250) NOT NULL,
  `color` char(6) NOT NULL,
  `terminaciones` varchar(10) NOT NULL,
  `status` tinyint(4) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `id_UNIQUE` (`id`) USING BTREE,
  UNIQUE KEY `nombre_marca_UNIQUE` (`engomado_nombre`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `unidades_engomados`
--


--
-- Table structure for table `unidades_marcas`
--

CREATE TABLE `unidades_marcas` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `marca_nombre` varchar(250) NOT NULL,
  `status` tinyint(4) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `id_UNIQUE` (`id`) USING BTREE,
  UNIQUE KEY `nombre_marca_UNIQUE` (`marca_nombre`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `unidades_marcas`
--

INSERT INTO `unidades_marcas` VALUES (1,'Mercedes  Benz',1,'2024-06-14 20:02:21','2024-06-14 20:15:29'),(2,'Nissan',1,'2024-06-14 20:06:52',NULL);

--
-- Table structure for table `unidades_submarcas`
--

CREATE TABLE `unidades_submarcas` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `unidad_marca_id` int(10) unsigned NOT NULL,
  `tipo` tinyint(1) DEFAULT 0,
  `submarca_nombre` varchar(120) NOT NULL,
  `status` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `id_UNIQUE` (`id`),
  KEY `fk_unidades_submarcas_unidades_marcas1_idx` (`unidad_marca_id`),
  CONSTRAINT `fk_unidades_submarcas_unidades_marcas1` FOREIGN KEY (`unidad_marca_id`) REFERENCES `unidades_marcas` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `unidades_submarcas`
--

INSERT INTO `unidades_submarcas` VALUES (1,1,2,'BECCAR 340',1,'2024-06-14 21:52:56','2024-06-14 22:43:35'),(2,1,2,'BECCAR URBI G2',1,'2024-06-14 22:04:52',NULL),(3,2,1,'March',1,'2024-06-14 22:06:50','2024-06-14 22:37:51'),(4,2,1,'NP300',1,'2024-06-14 22:39:31',NULL);

--
-- Table structure for table `unidades_tipos`
--

CREATE TABLE `unidades_tipos` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `nombre_unidad_tipo` varchar(250) NOT NULL,
  `status` tinyint(4) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `id_UNIQUE` (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `unidades_tipos`
--

INSERT INTO `unidades_tipos` VALUES (1,'Sin selección de tipo',1,'2024-06-14 12:50:28','2024-06-14 15:02:51'),(2,'Autobus',1,'2024-06-14 12:52:02',NULL),(3,'Microbús',1,'2024-06-14 12:57:14','2024-06-14 15:00:09'),(4,'Vagoneta',1,'2024-06-14 13:00:47','2024-06-14 15:00:22'),(5,'Colectivo',1,'2024-06-14 13:00:54','2024-06-14 15:00:31');

--
-- Dumping routines for database 'pasabus'
--


