-- MySQL dump 10.13  Distrib 8.0.27, for Linux (x86_64)
--
-- Host: 127.0.0.1    Database: grupodental
-- ------------------------------------------------------
-- Server version	8.0.27-0ubuntu0.20.04.1

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!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 `abonos`
--

DROP TABLE IF EXISTS `abonos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `abonos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `valor` double NOT NULL,
  `recibo` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `factura` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `descripcion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tipo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `abonos_paciente_id_foreign` (`paciente_id`),
  CONSTRAINT `abonos_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `actividads`
--

DROP TABLE IF EXISTS `actividads`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `actividads` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `actividads_user_id_foreign` (`user_id`),
  CONSTRAINT `actividads_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `agendas`
--

DROP TABLE IF EXISTS `agendas`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `agendas` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `doctor_id` bigint unsigned NOT NULL,
  `paciente` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tratamiento` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fecha` date NOT NULL,
  `hora` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `estado` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `agendas_doctor_id_foreign` (`doctor_id`),
  CONSTRAINT `agendas_doctor_id_foreign` FOREIGN KEY (`doctor_id`) REFERENCES `doctores` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `anestesias`
--

DROP TABLE IF EXISTS `anestesias`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `anestesias` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `pader` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `edad` varchar(2) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `civil` varchar(12) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `profecion` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dpi` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `anestesias_paciente_id_foreign` (`paciente_id`),
  CONSTRAINT `anestesias_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `articulos`
--

DROP TABLE IF EXISTS `articulos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `articulos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `proveedor_id` bigint unsigned NOT NULL,
  `categoria_id` bigint unsigned NOT NULL,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `cod_barras` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `descripcion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `descripcion_interna` text COLLATE utf8mb4_unicode_ci,
  `p_venta` double(7,2) NOT NULL,
  `p_costo` double(7,2) NOT NULL,
  `stock` double(7,2) NOT NULL,
  `min_stock` double DEFAULT '0',
  `img` text COLLATE utf8mb4_unicode_ci,
  `img2` text COLLATE utf8mb4_unicode_ci,
  `fecha_promo` date DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `articulos_proveedor_id_foreign` (`proveedor_id`),
  KEY `articulos_categoria_id_foreign` (`categoria_id`),
  CONSTRAINT `articulos_categoria_id_foreign` FOREIGN KEY (`categoria_id`) REFERENCES `categoria` (`id`),
  CONSTRAINT `articulos_proveedor_id_foreign` FOREIGN KEY (`proveedor_id`) REFERENCES `proveedores` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `cajas`
--

DROP TABLE IF EXISTS `cajas`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `cajas` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `valor` double NOT NULL DEFAULT '0',
  `descripcion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `operacion` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL,
  `factura` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fecha` date NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `tipo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `categoria`
--

DROP TABLE IF EXISTS `categoria`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `categoria` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `tipo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `check_lists`
--

DROP TABLE IF EXISTS `check_lists`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `check_lists` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `actividads_id` bigint unsigned NOT NULL,
  `estado` varchar(2) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'SI',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `check_lists_actividads_id_foreign` (`actividads_id`),
  CONSTRAINT `check_lists_actividads_id_foreign` FOREIGN KEY (`actividads_id`) REFERENCES `actividads` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `clientes`
--

DROP TABLE IF EXISTS `clientes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `clientes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `nit` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'C/F',
  `direccion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'Ciudad',
  `telefono1` varchar(12) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `telefono2` varchar(12) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tipo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'ESTANDAR',
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `compra_articulos`
--

DROP TABLE IF EXISTS `compra_articulos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `compra_articulos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `articulo_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned NOT NULL,
  `cantidad` double NOT NULL,
  `factura` char(35) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fecha` date DEFAULT NULL,
  `fecha_vencimiento` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `compra_articulos_articulo_id_foreign` (`articulo_id`),
  KEY `compra_articulos_user_id_foreign` (`user_id`),
  CONSTRAINT `compra_articulos_articulo_id_foreign` FOREIGN KEY (`articulo_id`) REFERENCES `articulos` (`id`),
  CONSTRAINT `compra_articulos_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `compra_proveedores`
--

DROP TABLE IF EXISTS `compra_proveedores`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `compra_proveedores` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `proveedor_id` bigint unsigned NOT NULL,
  `articulo_id` bigint unsigned NOT NULL,
  `cantidad` double NOT NULL,
  `factura` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fecha_de_compra` date NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `compra_proveedores_proveedor_id_foreign` (`proveedor_id`),
  KEY `compra_proveedores_articulo_id_foreign` (`articulo_id`),
  CONSTRAINT `compra_proveedores_articulo_id_foreign` FOREIGN KEY (`articulo_id`) REFERENCES `proveedores` (`id`),
  CONSTRAINT `compra_proveedores_proveedor_id_foreign` FOREIGN KEY (`proveedor_id`) REFERENCES `proveedores` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `consentimiento_informados`
--

DROP TABLE IF EXISTS `consentimiento_informados`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `consentimiento_informados` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `fecha_lugar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dpi` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nacionaliad` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `extendido` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `diagnostico` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `consentimiento_informados_paciente_id_foreign` (`paciente_id`),
  CONSTRAINT `consentimiento_informados_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `cuadres`
--

DROP TABLE IF EXISTS `cuadres`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `cuadres` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `entrada` double(7,2) NOT NULL,
  `salida` double(7,2) NOT NULL,
  `cuadre` double(7,2) NOT NULL,
  `boleta` char(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `totalEfectico` double(7,2) NOT NULL,
  `faltante` double(7,2) NOT NULL,
  `totalVisas` double(7,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deuda_medicamento` double DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `descripcion_odontologicos`
--

DROP TABLE IF EXISTS `descripcion_odontologicos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `descripcion_odontologicos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `odonto_id` bigint unsigned NOT NULL,
  `pieza` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fecha` date NOT NULL,
  `descripcion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `descripcion_odontologicos_paciente_id_foreign` (`paciente_id`),
  KEY `descripcion_odontologicos_odonto_id_foreign` (`odonto_id`),
  CONSTRAINT `descripcion_odontologicos_odonto_id_foreign` FOREIGN KEY (`odonto_id`) REFERENCES `odontologicos` (`id`),
  CONSTRAINT `descripcion_odontologicos_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `deuda_meciamentos`
--

DROP TABLE IF EXISTS `deuda_meciamentos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `deuda_meciamentos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `total` double NOT NULL,
  `descripcion` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `deuda_meciamentos_paciente_id_foreign` (`paciente_id`),
  CONSTRAINT `deuda_meciamentos_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `deuda_pacientes`
--

DROP TABLE IF EXISTS `deuda_pacientes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `deuda_pacientes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `descripcion` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `valor` double NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `tratamiento_id` bigint unsigned NOT NULL,
  `doctor_id` bigint unsigned NOT NULL,
  `pieza` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `deuda_pacientes_paciente_id_foreign` (`paciente_id`),
  KEY `deuda_pacientes_doctor_id_foreign` (`doctor_id`),
  KEY `deuda_pacientes_tratamiento_id_foreign` (`tratamiento_id`),
  CONSTRAINT `deuda_pacientes_doctor_id_foreign` FOREIGN KEY (`doctor_id`) REFERENCES `doctores` (`id`),
  CONSTRAINT `deuda_pacientes_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`),
  CONSTRAINT `deuda_pacientes_tratamiento_id_foreign` FOREIGN KEY (`tratamiento_id`) REFERENCES `tratamientos` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `dieta_notas`
--

DROP TABLE IF EXISTS `dieta_notas`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `dieta_notas` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `notas_id` bigint unsigned NOT NULL,
  `dieta` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tratamiento` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fecha_hora` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `dieta_notas_paciente_id_foreign` (`paciente_id`),
  KEY `dieta_notas_notas_id_foreign` (`notas_id`),
  CONSTRAINT `dieta_notas_notas_id_foreign` FOREIGN KEY (`notas_id`) REFERENCES `hoja_notas` (`id`),
  CONSTRAINT `dieta_notas_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `doctores`
--

DROP TABLE IF EXISTS `doctores`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `doctores` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `password` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `porcentaje` double DEFAULT NULL,
  `tel_casa` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tel_oficina` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tel_celular` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `especialidad` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `colegiado` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cuentas` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `web` tinyint(1) NOT NULL DEFAULT '0',
  `color` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `foto` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `titulo1` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `titulo2` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `titulo3` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `elvolucion`
--

DROP TABLE IF EXISTS `elvolucion`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `elvolucion` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `fecha_inicio` date DEFAULT NULL,
  `fecha_fin` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `elvolucion_paciente_id_foreign` (`paciente_id`),
  CONSTRAINT `elvolucion_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `endodoncias`
--

DROP TABLE IF EXISTS `endodoncias`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `endodoncias` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dpi` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `direccion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cirujano` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `endodoncias_paciente_id_foreign` (`paciente_id`),
  CONSTRAINT `endodoncias_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `facturas`
--

DROP TABLE IF EXISTS `facturas`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `facturas` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `descuento` double DEFAULT NULL,
  `descripcion` text COLLATE utf8mb4_unicode_ci,
  `descripcion_min` text COLLATE utf8mb4_unicode_ci,
  `total` double DEFAULT NULL,
  `total_des` double DEFAULT NULL,
  `mayoristas` blob,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `facturas_proveedor`
--

DROP TABLE IF EXISTS `facturas_proveedor`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `facturas_proveedor` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `proveedor_id` bigint unsigned NOT NULL,
  `factura` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `valor` double NOT NULL,
  `fecha_de_pago` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `facturas_proveedor_proveedor_id_foreign` (`proveedor_id`),
  CONSTRAINT `facturas_proveedor_proveedor_id_foreign` FOREIGN KEY (`proveedor_id`) REFERENCES `proveedores` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `foto_paciente`
--

DROP TABLE IF EXISTS `foto_paciente`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `foto_paciente` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `foto` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `foto_paciente_paciente_id_foreign` (`paciente_id`),
  CONSTRAINT `foto_paciente_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `foto_tratamientos`
--

DROP TABLE IF EXISTS `foto_tratamientos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `foto_tratamientos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `foto` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `foto2` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `foto3` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `foto4` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `foto5` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `titulo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `descripcion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `hoja_anestecias`
--

DROP TABLE IF EXISTS `hoja_anestecias`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `hoja_anestecias` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `asa` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `consentimiento` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `peso` varchar(6) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `alergicos` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `importantes` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `premedicacion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `diagnostico` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `otros_examenes` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mantenimiento` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `induccion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `relajante` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `medico` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fecha` date DEFAULT NULL,
  `hora` varchar(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `liquidos` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `trans` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cc1` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cc2` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cc3` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `operacion_efc` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `torniquete` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tiempo_op` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `anestecia` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cirujano` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ayudante` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `anestesiologo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `drogas_trans` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `monitoreo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `hoja_anestecias_paciente_id_foreign` (`paciente_id`),
  CONSTRAINT `hoja_anestecias_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `hoja_evolucions`
--

DROP TABLE IF EXISTS `hoja_evolucions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `hoja_evolucions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `hoja_evolucions_paciente_id_foreign` (`paciente_id`),
  CONSTRAINT `hoja_evolucions_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `hoja_ingresos`
--

DROP TABLE IF EXISTS `hoja_ingresos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `hoja_ingresos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `fecha` date DEFAULT NULL,
  `municipio` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `medico` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `estatura` varchar(4) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `peso` varchar(4) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `embarazo` varchar(2) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `lloro` varchar(2) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `alimentacion` varchar(70) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vacunacion` varchar(70) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `medic_actual` varchar(2) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `medic_actual_por` varchar(70) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `hospitalizado` varchar(2) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `hospitalizado_por` varchar(70) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `enfermedades` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cirugia` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fracturas` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `alergias` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sangrado` varchar(2) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `parentesco` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `responsable` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `documento` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nombre` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `hoja_ingresos_paciente_id_foreign` (`paciente_id`),
  CONSTRAINT `hoja_ingresos_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `hoja_notas`
--

DROP TABLE IF EXISTS `hoja_notas`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `hoja_notas` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `hoja_notas_paciente_id_foreign` (`paciente_id`),
  CONSTRAINT `hoja_notas_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `implante_dentals`
--

DROP TABLE IF EXISTS `implante_dentals`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `implante_dentals` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dpi` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `direccion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cirujano` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `implante_dentals_paciente_id_foreign` (`paciente_id`),
  CONSTRAINT `implante_dentals_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `insumos`
--

DROP TABLE IF EXISTS `insumos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `insumos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(120) COLLATE utf8mb4_unicode_ci NOT NULL,
  `precio` double(7,2) DEFAULT NULL,
  `cantidad` double DEFAULT NULL,
  `minimo` double DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `fecha_vencimiento` date DEFAULT NULL,
  `factura` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `laboratorios`
--

DROP TABLE IF EXISTS `laboratorios`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `laboratorios` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `direccion` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `telefono` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `migrations`
--

DROP TABLE IF EXISTS `migrations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=74 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `mobiliario_equipos`
--

DROP TABLE IF EXISTS `mobiliario_equipos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `mobiliario_equipos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `mobiliario` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `cantidad` double NOT NULL,
  `descripcion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `precio` double DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `fecha_mantenimiento` date DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `nota_hoja_evolucions`
--

DROP TABLE IF EXISTS `nota_hoja_evolucions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `nota_hoja_evolucions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `notas_id` bigint unsigned NOT NULL,
  `notas` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fecha_hora` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `nota_hoja_evolucions_paciente_id_foreign` (`paciente_id`),
  KEY `nota_hoja_evolucions_notas_id_foreign` (`notas_id`),
  CONSTRAINT `nota_hoja_evolucions_notas_id_foreign` FOREIGN KEY (`notas_id`) REFERENCES `hoja_evolucions` (`id`),
  CONSTRAINT `nota_hoja_evolucions_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `odontologicos`
--

DROP TABLE IF EXISTS `odontologicos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `odontologicos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `fecha_ingreso` date NOT NULL,
  `unidad` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `odontologicos_paciente_id_foreign` (`paciente_id`),
  CONSTRAINT `odontologicos_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `paciente_l_aboratorios`
--

DROP TABLE IF EXISTS `paciente_l_aboratorios`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `paciente_l_aboratorios` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `laboratorio_id` bigint unsigned NOT NULL,
  `total` double NOT NULL,
  `descripcion` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `paciente_l_aboratorios_paciente_id_foreign` (`paciente_id`),
  KEY `paciente_l_aboratorios_laboratorio_id_foreign` (`laboratorio_id`),
  CONSTRAINT `paciente_l_aboratorios_laboratorio_id_foreign` FOREIGN KEY (`laboratorio_id`) REFERENCES `laboratorios` (`id`),
  CONSTRAINT `paciente_l_aboratorios_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `pacientes`
--

DROP TABLE IF EXISTS `pacientes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `pacientes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sexo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `civil` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ocupacion` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `t_casa` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `t_oficina` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `t_celular` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `direccion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `motivo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tipo` varchar(8) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fecha_nacimiento` date NOT NULL,
  `estado` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVO',
  `en_nombre` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `en_relacion` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `en_tel_casa` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `en_tel_celular` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `presion` tinyint(1) NOT NULL DEFAULT '0',
  `obs_presion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `diabetes` tinyint(1) NOT NULL DEFAULT '0',
  `obs_diabetes` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `anemia` tinyint(1) NOT NULL DEFAULT '0',
  `obs_anemia` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `corteligero` tinyint(1) NOT NULL DEFAULT '0',
  `obs_corteligero` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `inf_repiratoria` tinyint(1) NOT NULL DEFAULT '0',
  `obs_inf_repiratoria` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `renales` tinyint(1) NOT NULL DEFAULT '0',
  `obs_renales` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tuberculosis` tinyint(1) NOT NULL DEFAULT '0',
  `obs_tuberculosis` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `hepaticos` tinyint(1) NOT NULL DEFAULT '0',
  `obs_hepaticos` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gastricos` tinyint(1) NOT NULL DEFAULT '0',
  `obs_gastricos` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `artritis` tinyint(1) NOT NULL DEFAULT '0',
  `obs_artritis` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vih` tinyint(1) NOT NULL DEFAULT '0',
  `obs_vih` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `epilepcia` tinyint(1) NOT NULL DEFAULT '0',
  `obs_epilepcia` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `neurologicos` tinyint(1) NOT NULL DEFAULT '0',
  `obs_neurologicos` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `virales` tinyint(1) NOT NULL DEFAULT '0',
  `obs_virales` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `venereas` tinyint(1) NOT NULL DEFAULT '0',
  `obs_venereas` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `hepatitis` tinyint(1) NOT NULL DEFAULT '0',
  `obs_hepatitis` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tumores` tinyint(1) NOT NULL DEFAULT '0',
  `obs_tumores` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cancer` tinyint(1) NOT NULL DEFAULT '0',
  `obs_cancer` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `emocionales` tinyint(1) NOT NULL DEFAULT '0',
  `obs_emocionales` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `accidentes` tinyint(1) NOT NULL DEFAULT '0',
  `obs_accidentes` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nerviosos` tinyint(1) NOT NULL DEFAULT '0',
  `obs_nerviosos` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `hemofilia` tinyint(1) NOT NULL DEFAULT '0',
  `obs_hemofilia` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `circulatorios` tinyint(1) NOT NULL DEFAULT '0',
  `obs_circulatorios` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cardiacos` tinyint(1) NOT NULL DEFAULT '0',
  `obs_cardiacos` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `embarazo` tinyint(1) NOT NULL DEFAULT '0',
  `obs_embarazo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `otra_enfermedad` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `toma_actual` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `med_nombre` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `med_telefono` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cirugias_pre` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `antibioticos` tinyint(1) NOT NULL DEFAULT '0',
  `anes_locales` tinyint(1) NOT NULL DEFAULT '0',
  `picadura` tinyint(1) NOT NULL DEFAULT '0',
  `otros_alegias` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `onicogafia` tinyint(1) NOT NULL DEFAULT '0',
  `bruxismo` tinyint(1) NOT NULL DEFAULT '0',
  `fumar` tinyint(1) NOT NULL DEFAULT '0',
  `alcoholismo` tinyint(1) NOT NULL DEFAULT '0',
  `otros_habitos` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `his_excelente` tinyint(1) NOT NULL DEFAULT '0',
  `his_buena` tinyint(1) NOT NULL DEFAULT '0',
  `his_regular` tinyint(1) NOT NULL DEFAULT '0',
  `his_mala` tinyint(1) NOT NULL DEFAULT '0',
  `dentis_anterior` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ultima_visita` date DEFAULT NULL,
  `porque` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `frio` tinyint(1) NOT NULL DEFAULT '0',
  `calor` tinyint(1) NOT NULL DEFAULT '0',
  `masticacion` tinyint(1) NOT NULL DEFAULT '0',
  `dulce` tinyint(1) NOT NULL DEFAULT '0',
  `sensi_otro` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `firma` text COLLATE utf8mb4_unicode_ci,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `depemedica` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nafiliacion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deuda` double DEFAULT '0',
  `abono` double DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `pago_docotores`
--

DROP TABLE IF EXISTS `pago_docotores`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `pago_docotores` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `doctor_id` bigint unsigned NOT NULL,
  `paciente_id` bigint unsigned NOT NULL,
  `tratamiento_id` bigint unsigned NOT NULL,
  `pieza` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pago_docotores_doctor_id_foreign` (`doctor_id`),
  KEY `pago_docotores_paciente_id_foreign` (`paciente_id`),
  KEY `pago_docotores_tratamiento_id_foreign` (`tratamiento_id`),
  CONSTRAINT `pago_docotores_doctor_id_foreign` FOREIGN KEY (`doctor_id`) REFERENCES `doctores` (`id`),
  CONSTRAINT `pago_docotores_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`),
  CONSTRAINT `pago_docotores_tratamiento_id_foreign` FOREIGN KEY (`tratamiento_id`) REFERENCES `tratamientos` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `pago_facturas`
--

DROP TABLE IF EXISTS `pago_facturas`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `pago_facturas` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `factura` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `valor` double NOT NULL,
  `fecha_pago` date DEFAULT NULL,
  `descripcion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `pago_tratamientos`
--

DROP TABLE IF EXISTS `pago_tratamientos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `pago_tratamientos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `doctor_id` bigint unsigned NOT NULL,
  `tratamiento_id` bigint unsigned NOT NULL,
  `porcentaje` double NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pago_tratamientos_doctor_id_foreign` (`doctor_id`),
  KEY `pago_tratamientos_tratamiento_id_foreign` (`tratamiento_id`),
  CONSTRAINT `pago_tratamientos_doctor_id_foreign` FOREIGN KEY (`doctor_id`) REFERENCES `doctores` (`id`),
  CONSTRAINT `pago_tratamientos_tratamiento_id_foreign` FOREIGN KEY (`tratamiento_id`) REFERENCES `tratamientos` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `password_resets`
--

DROP TABLE IF EXISTS `password_resets`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `password_resets` (
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  KEY `password_resets_email_index` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `permissions`
--

DROP TABLE IF EXISTS `permissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `permissions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=98 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `procedimiento_evolucions`
--

DROP TABLE IF EXISTS `procedimiento_evolucions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `procedimiento_evolucions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `tratamiento_id` bigint unsigned NOT NULL,
  `evolucion_id` bigint unsigned NOT NULL,
  `pieza` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `procedimiento_evolucions_paciente_id_foreign` (`paciente_id`),
  KEY `procedimiento_evolucions_tratamiento_id_foreign` (`tratamiento_id`),
  KEY `procedimiento_evolucions_evolucion_id_foreign` (`evolucion_id`),
  CONSTRAINT `procedimiento_evolucions_evolucion_id_foreign` FOREIGN KEY (`evolucion_id`) REFERENCES `elvolucion` (`id`),
  CONSTRAINT `procedimiento_evolucions_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`),
  CONSTRAINT `procedimiento_evolucions_tratamiento_id_foreign` FOREIGN KEY (`tratamiento_id`) REFERENCES `tratamientos` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `procedimientos`
--

DROP TABLE IF EXISTS `procedimientos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `procedimientos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `tratamiento_id` bigint unsigned NOT NULL,
  `doctor_id` bigint unsigned DEFAULT NULL,
  `pieza` varchar(4) COLLATE utf8mb4_unicode_ci NOT NULL,
  `valor` double NOT NULL,
  `estado_pago` tinyint(1) NOT NULL DEFAULT '0',
  `fecha` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `procedimientos_paciente_id_foreign` (`paciente_id`),
  KEY `procedimientos_tratamiento_id_foreign` (`tratamiento_id`),
  KEY `procedimientos_doctor_id_foreign` (`doctor_id`),
  CONSTRAINT `procedimientos_doctor_id_foreign` FOREIGN KEY (`doctor_id`) REFERENCES `doctores` (`id`),
  CONSTRAINT `procedimientos_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`),
  CONSTRAINT `procedimientos_tratamiento_id_foreign` FOREIGN KEY (`tratamiento_id`) REFERENCES `tratamientos` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `protesis_fijas`
--

DROP TABLE IF EXISTS `protesis_fijas`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `protesis_fijas` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dpi` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `direccion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cirujano` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `protesis_fijas_paciente_id_foreign` (`paciente_id`),
  CONSTRAINT `protesis_fijas_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `proveedores`
--

DROP TABLE IF EXISTS `proveedores`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `proveedores` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `telefono1` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `telefono2` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `articulos` text COLLATE utf8mb4_unicode_ci,
  `dias` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `receta_pacientes`
--

DROP TABLE IF EXISTS `receta_pacientes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `receta_pacientes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `paciente_id` bigint unsigned NOT NULL,
  `receta_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `receta_pacientes_paciente_id_foreign` (`paciente_id`),
  KEY `receta_pacientes_receta_id_foreign` (`receta_id`),
  CONSTRAINT `receta_pacientes_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`),
  CONSTRAINT `receta_pacientes_receta_id_foreign` FOREIGN KEY (`receta_id`) REFERENCES `recetas` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `recetas`
--

DROP TABLE IF EXISTS `recetas`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `recetas` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `role_permissions`
--

DROP TABLE IF EXISTS `role_permissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `role_permissions` (
  `role_id` bigint unsigned NOT NULL,
  `permission_id` bigint unsigned NOT NULL,
  KEY `role_permissions_role_id_foreign` (`role_id`),
  KEY `role_permissions_permission_id_foreign` (`permission_id`),
  CONSTRAINT `role_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `role_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

DROP TABLE IF EXISTS `roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `roles` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `short_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `salida_insumos`
--

DROP TABLE IF EXISTS `salida_insumos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `salida_insumos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `insumo_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned NOT NULL,
  `cantidad` double NOT NULL,
  `clinica` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `salida_insumos_insumo_id_foreign` (`insumo_id`),
  KEY `salida_insumos_user_id_foreign` (`user_id`),
  CONSTRAINT `salida_insumos_insumo_id_foreign` FOREIGN KEY (`insumo_id`) REFERENCES `insumos` (`id`),
  CONSTRAINT `salida_insumos_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `servicios_laboratorios`
--

DROP TABLE IF EXISTS `servicios_laboratorios`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `servicios_laboratorios` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `laboratorio_id` bigint unsigned NOT NULL,
  `nombre` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `precio` double NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `servicios_laboratorios_laboratorio_id_foreign` (`laboratorio_id`),
  CONSTRAINT `servicios_laboratorios_laboratorio_id_foreign` FOREIGN KEY (`laboratorio_id`) REFERENCES `laboratorios` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tratamientos`
--

DROP TABLE IF EXISTS `tratamientos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tratamientos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `descripcion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `precio` double NOT NULL,
  `descripcion_interna` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tipo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'PRIVADO',
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `users`
--

DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `users` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `role_id` bigint unsigned DEFAULT NULL,
  `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `vacaciones` date NOT NULL,
  `sueldo` double NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_email_unique` (`email`),
  KEY `users_role_id_foreign` (`role_id`),
  CONSTRAINT `users_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `venta_articulos`
--

DROP TABLE IF EXISTS `venta_articulos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `venta_articulos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `articulo_id` bigint unsigned NOT NULL,
  `cliente` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'Consumidor Final',
  `nit` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'C/F',
  `factura_id` bigint unsigned NOT NULL,
  `credito` char(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `cantidad` double NOT NULL,
  `total` double NOT NULL,
  `descuento` double NOT NULL,
  `mayorista` blob,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `paciente_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `venta_articulos_articulo_id_foreign` (`articulo_id`),
  KEY `venta_articulos_factura_id_foreign` (`factura_id`),
  KEY `venta_articulos_paciente_id_foreign` (`paciente_id`),
  CONSTRAINT `venta_articulos_articulo_id_foreign` FOREIGN KEY (`articulo_id`) REFERENCES `articulos` (`id`),
  CONSTRAINT `venta_articulos_factura_id_foreign` FOREIGN KEY (`factura_id`) REFERENCES `facturas` (`id`),
  CONSTRAINT `venta_articulos_paciente_id_foreign` FOREIGN KEY (`paciente_id`) REFERENCES `pacientes` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2021-11-16 12:59:48
