text: -- MySQL Script generated by MySQL Workbench
  -- Mon Jan  3 16:12:30 2022
  -- Model: New Model    Version: 1.0
  -- MySQL Workbench Forward Engineering
  
  SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
  SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
  SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
  
  -- -----------------------------------------------------
  -- Schema epiz_30728937_CANTINA
  -- -----------------------------------------------------
  
  -- -----------------------------------------------------
  -- Schema epiz_30728937_CANTINA
  -- -----------------------------------------------------
  CREATE SCHEMA IF NOT EXISTS `epiz_30728937_CANTINA` DEFAULT CHARACTER SET utf8 ;
  USE `epiz_30728937_CANTINA` ;
  
  -- -----------------------------------------------------
  -- Table `epiz_30728937_CANTINA`.`ATENDENTE`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `epiz_30728937_CANTINA`.`ATENDENTE` (
    `ID` INT NOT NULL AUTO_INCREMENT,
    `NOME` VARCHAR(120) NOT NULL,
    `FOTO` VARCHAR(255) NULL,
    `LOGIN` VARCHAR(16) NOT NULL,
    `SENHA` VARCHAR(255) NOT NULL,
    PRIMARY KEY (`ID`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `epiz_30728937_CANTINA`.`FORNECEDOR`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `epiz_30728937_CANTINA`.`FORNECEDOR` (
    `ID` INT NOT NULL AUTO_INCREMENT,
    `NOME` VARCHAR(120) NOT NULL,
    `CNPJ` VARCHAR(255) NULL,
    `IESTADUAL` VARCHAR(255) NULL,
    `CEP` INT NOT NULL,
    `LOGRADOURO` VARCHAR(150) NULL,
    `NUMERO` INT NOT NULL,
    `BAIRRO` VARCHAR(80) NULL,
    `CIDADE` VARCHAR(120) NULL,
    `UF` VARCHAR(2) NULL,
    `ATENDENTE_ID` INT NOT NULL,
    PRIMARY KEY (`ID`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `epiz_30728937_CANTINA`.`CLIENTE`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `epiz_30728937_CANTINA`.`CLIENTE` (
    `ID` INT NOT NULL AUTO_INCREMENT,
    `NOME` VARCHAR(120) NOT NULL,
    `CPF` VARCHAR(255) NULL,
    `RG` VARCHAR(255) NULL,
    `CEP` INT NOT NULL,
    `NUMERO` INT NOT NULL,
    `LOGRADOURO` VARCHAR(150) NULL,
    `BAIRRO` VARCHAR(80) NULL,
    `CIDADE` VARCHAR(120) NULL,
    `UF` VARCHAR(2) NULL,
    `EMAIL` VARCHAR(255) NOT NULL,
    `CELULAR` VARCHAR(16) NULL,
    `ATENDENTE_ID` INT NOT NULL,
    PRIMARY KEY (`ID`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `epiz_30728937_CANTINA`.`ESTOQUE`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `epiz_30728937_CANTINA`.`ESTOQUE` (
    `ID` INT NOT NULL AUTO_INCREMENT,
    `LOTE` VARCHAR(200) NULL,
    `VALIDADE` DATE NULL,
    `QTDE` INT NOT NULL,
    `PRODUTO_ID` INT NOT NULL,
    PRIMARY KEY (`ID`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `epiz_30728937_CANTINA`.`PRODUTO`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `epiz_30728937_CANTINA`.`PRODUTO` (
    `ID` INT NOT NULL AUTO_INCREMENT,
    `CODIGOBARRAS` VARCHAR(255) NULL,
    `NOME` VARCHAR(60) NOT NULL,
    `MARCA` VARCHAR(60) NOT NULL,
    `VLRCOMPRA` DOUBLE NOT NULL,
    `VLRVENDA` DOUBLE NOT NULL,
    `FORNECEDOR_ID` INT NOT NULL,
    PRIMARY KEY (`ID`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `epiz_30728937_CANTINA`.`VENDA`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `epiz_30728937_CANTINA`.`VENDA` (
    `ID` INT NOT NULL AUTO_INCREMENT,
    `DATA` DATETIME NOT NULL,
    `VALORTOTAL` DOUBLE NOT NULL,
    `VALORPAGO` DOUBLE NOT NULL,
    `TROCO` DOUBLE NULL,
    `FORMAPGTO` INT NOT NULL COMMENT '1 - DINHEIRO\n2 - CARTÃO DE DÉBITO\n3 - CARTÃO DE CRÉDITO\n4 - PICPAY\n5 - PIX\n6 - CARTEIRA',
    `CLIENTE_ID` INT NOT NULL,
    PRIMARY KEY (`ID`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `epiz_30728937_CANTINA`.`ITENSVENDA`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `epiz_30728937_CANTINA`.`ITENSVENDA` (
    `COMPRA_ID` INT NOT NULL,
    `PRODUTO_ID` INT NOT NULL,
    `QTDE` INT NOT NULL,
    PRIMARY KEY (`COMPRA_ID`, `PRODUTO_ID`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `epiz_30728937_CANTINA`.`COMPRA`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `epiz_30728937_CANTINA`.`COMPRA` (
    `ID` INT NOT NULL AUTO_INCREMENT,
    `DATA` DATETIME NOT NULL,
    `VALORTOTAL` DOUBLE NOT NULL,
    `FORMAPGTO` INT NOT NULL,
    `VENCIMENTO` DATETIME NOT NULL,
    `FORNECEDOR_ID` INT NOT NULL,
    PRIMARY KEY (`ID`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `epiz_30728937_CANTINA`.`ITENSCOMPRA`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `epiz_30728937_CANTINA`.`ITENSCOMPRA` (
    `PRODUTO_ID` INT NOT NULL,
    `COMPRA_ID` INT NOT NULL,
    `QTDE` INT NOT NULL,
    PRIMARY KEY (`PRODUTO_ID`, `COMPRA_ID`))
  ENGINE = InnoDB;
  
  
  SET SQL_MODE=@OLD_SQL_MODE;
  SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
  SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
  