-- --------------------------------------------------------
-- Host:                         127.0.0.1
-- Server version:               11.7.2-MariaDB - mariadb.org binary distribution
-- Server OS:                    Win64
-- HeidiSQL Version:             12.10.0.7000
-- --------------------------------------------------------

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


-- Dumping database structure for go_selva
CREATE DATABASE IF NOT EXISTS `go_selva` /*!40100 DEFAULT CHARACTER SET utf32 COLLATE utf32_unicode_ci */;
USE `go_selva`;

-- Dumping structure for table go_selva.familias
CREATE TABLE IF NOT EXISTS `familias` (
  `FamiliaID` int(11) NOT NULL AUTO_INCREMENT,
  `Familia` varchar(35) NOT NULL,
  PRIMARY KEY (`FamiliaID`),
  UNIQUE KEY `Familia` (`Familia`)
) ENGINE=InnoDB AUTO_INCREMENT=112 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table go_selva.fotos
CREATE TABLE IF NOT EXISTS `fotos` (
  `FotoID` int(11) NOT NULL AUTO_INCREMENT,
  `NombreID` int(11) NOT NULL DEFAULT 0,
  `Direccion` varchar(75) NOT NULL,
  `HayVideo` char(1) DEFAULT '0',
  `Video` varchar(75) DEFAULT '',
  PRIMARY KEY (`FotoID`),
  KEY `NombreID` (`NombreID`),
  CONSTRAINT `Fotos_ibfk_1` FOREIGN KEY (`NombreID`) REFERENCES `nombres` (`NombreID`)
) ENGINE=InnoDB AUTO_INCREMENT=1093 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table go_selva.logs
CREATE TABLE IF NOT EXISTS `logs` (
  `LogID` int(9) NOT NULL AUTO_INCREMENT,
  `Tiempo` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `UsuarioID` int(4) NOT NULL DEFAULT 0,
  `Query` text NOT NULL,
  PRIMARY KEY (`LogID`)
) ENGINE=InnoDB AUTO_INCREMENT=14427 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table go_selva.logs20191029
CREATE TABLE IF NOT EXISTS `logs20191029` (
  `LogID` int(9) NOT NULL DEFAULT 0,
  `Tiempo` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `UsuarioID` int(4) NOT NULL DEFAULT 0,
  `Query` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table go_selva.nombres
CREATE TABLE IF NOT EXISTS `nombres` (
  `NombreID` int(11) NOT NULL AUTO_INCREMENT,
  `FamiliaID` int(6) NOT NULL DEFAULT 1,
  `Nombre` varchar(75) NOT NULL,
  `Fecha` date NOT NULL DEFAULT '0000-00-00',
  `ProveedorID` int(4) NOT NULL DEFAULT 1,
  `Precio` float(10,2) NOT NULL DEFAULT 0.00,
  `Inactivo` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`NombreID`),
  UNIQUE KEY `Nombre` (`Nombre`),
  KEY `FamiliaID` (`FamiliaID`),
  KEY `ProveedorID` (`ProveedorID`),
  CONSTRAINT `Nombres_ibfk_1` FOREIGN KEY (`FamiliaID`) REFERENCES `familias` (`FamiliaID`),
  CONSTRAINT `Nombres_ibfk_2` FOREIGN KEY (`ProveedorID`) REFERENCES `proveedores` (`ProveedorID`)
) ENGINE=InnoDB AUTO_INCREMENT=1140 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table go_selva.nombresvulgares
CREATE TABLE IF NOT EXISTS `nombresvulgares` (
  `NombreVulgarID` int(11) NOT NULL AUTO_INCREMENT,
  `NombreID` int(11) NOT NULL DEFAULT 0,
  `NombreVulgar` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`NombreVulgarID`),
  KEY `NombreID` (`NombreID`),
  CONSTRAINT `NombresVulgares_ibfk_1` FOREIGN KEY (`NombreID`) REFERENCES `nombres` (`NombreID`)
) ENGINE=InnoDB AUTO_INCREMENT=2453 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table go_selva.notas
CREATE TABLE IF NOT EXISTS `notas` (
  `NotaID` int(11) NOT NULL AUTO_INCREMENT,
  `NombreID` int(11) NOT NULL,
  `Nota` tinytext DEFAULT NULL,
  PRIMARY KEY (`NotaID`),
  KEY `NombreID` (`NombreID`),
  CONSTRAINT `Notas_ibfk_1` FOREIGN KEY (`NombreID`) REFERENCES `nombres` (`NombreID`)
) ENGINE=InnoDB AUTO_INCREMENT=6426 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table go_selva.proveedores
CREATE TABLE IF NOT EXISTS `proveedores` (
  `ProveedorID` int(3) NOT NULL AUTO_INCREMENT,
  `Nombre` varchar(95) NOT NULL DEFAULT '',
  `RFC` varchar(15) DEFAULT '',
  `Direccion` varchar(75) DEFAULT '',
  `Colonia` varchar(50) DEFAULT '',
  `Ciudad` varchar(25) DEFAULT '',
  `Estado` varchar(40) DEFAULT '',
  `Pais` varchar(25) DEFAULT '',
  `CP` varchar(20) DEFAULT '',
  `Tel1` varchar(20) DEFAULT '',
  `Tel2` varchar(20) DEFAULT '',
  `URL` varchar(75) DEFAULT NULL,
  `Desactivado` char(1) NOT NULL DEFAULT 'N',
  `Observaciones` varchar(150) DEFAULT NULL,
  `Contacto1Nombre` varchar(75) DEFAULT '',
  `Contacto1Tel` varchar(20) DEFAULT '',
  `Contacto1Cel` varchar(20) DEFAULT '',
  `Contacto1EMail` varchar(75) DEFAULT '',
  `Contacto2Nombre` varchar(75) DEFAULT '',
  `Contacto2Tel` varchar(20) DEFAULT '',
  `Contacto2Cel` varchar(20) DEFAULT '',
  `Contacto2EMail` varchar(75) DEFAULT '',
  PRIMARY KEY (`ProveedorID`),
  UNIQUE KEY `Nombre` (`Nombre`)
) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table go_selva.ubicaciones
CREATE TABLE IF NOT EXISTS `ubicaciones` (
  `UbiID` int(11) NOT NULL AUTO_INCREMENT,
  `NombreID` int(11) NOT NULL,
  `Ubicacion` varchar(20) NOT NULL,
  PRIMARY KEY (`UbiID`),
  KEY `NombreID` (`NombreID`),
  CONSTRAINT `Ubicaciones_ibfk_1` FOREIGN KEY (`NombreID`) REFERENCES `nombres` (`NombreID`)
) ENGINE=InnoDB AUTO_INCREMENT=1665 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table go_selva.usuarios
CREATE TABLE IF NOT EXISTS `usuarios` (
  `UID` int(5) NOT NULL AUTO_INCREMENT,
  `ApellidoPaterno` varchar(25) NOT NULL DEFAULT '',
  `ApellidoMaterno` varchar(25) DEFAULT '',
  `Nombres` varchar(30) NOT NULL DEFAULT '',
  `Login` varchar(25) NOT NULL DEFAULT '',
  `PWD` varchar(70) NOT NULL DEFAULT '',
  `Fecha` date NOT NULL DEFAULT '0000-00-00',
  `Nivel` enum('Admin','Capturista','Almacenista','Consulta','Instalador','Vendedor','PedOrdInv') DEFAULT NULL,
  `Deshabilitado` char(1) NOT NULL DEFAULT 'N',
  PRIMARY KEY (`UID`),
  UNIQUE KEY `Login` (`Login`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- Data exporting was unselected.

/*!40103 SET TIME_ZONE=IFNULL(@OLD_TIME_ZONE, 'system') */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;
