text: -- MySQL Script generated by MySQL Workbench
  -- Wed Mar 23 14:22:55 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 DB_Ecommerce
  -- -----------------------------------------------------
  
  -- -----------------------------------------------------
  -- Schema DB_Ecommerce
  -- -----------------------------------------------------
  CREATE SCHEMA IF NOT EXISTS `DB_Ecommerce` DEFAULT CHARACTER SET utf8 ;
  USE `DB_Ecommerce` ;
  
  -- -----------------------------------------------------
  -- Table `DB_Ecommerce`.`tb_categorias`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `DB_Ecommerce`.`tb_categorias` (
    `id` BIGINT NOT NULL AUTO_INCREMENT,
    `categoria` VARCHAR(50) NOT NULL,
    `sexo` VARCHAR(50) NOT NULL,
    PRIMARY KEY (`id`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `DB_Ecommerce`.`tb_usuarios`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `DB_Ecommerce`.`tb_usuarios` (
    `id` BIGINT NOT NULL AUTO_INCREMENT,
    `nome` VARCHAR(255) NOT NULL,
    `usuario` VARCHAR(255) NOT NULL,
    `senha` VARCHAR(10) NOT NULL,
    `foto` VARCHAR(255) NULL,
    PRIMARY KEY (`id`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `DB_Ecommerce`.`tb_produtos`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `DB_Ecommerce`.`tb_produtos` (
    `id` BIGINT NOT NULL AUTO_INCREMENT,
    `nome` VARCHAR(255) NOT NULL,
    `quantidade` INT NULL,
    `valor` DECIMAL(8,2) NOT NULL,
    `descricao` VARCHAR(500) NULL,
    `usuario_id` BIGINT NULL,
    `categoria_id` BIGINT NULL,
    PRIMARY KEY (`id`),
    INDEX `fk_tb_produtos_tb_usuario1_idx` (`usuario_id` ASC) VISIBLE,
    INDEX `fk_tb_produtos_tb_categorias1_idx` (`categoria_id` ASC) VISIBLE,
    CONSTRAINT `fk_tb_produtos_tb_usuario1`
      FOREIGN KEY (`usuario_id`)
      REFERENCES `DB_Ecommerce`.`tb_usuarios` (`id`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
    CONSTRAINT `fk_tb_produtos_tb_categorias1`
      FOREIGN KEY (`categoria_id`)
      REFERENCES `DB_Ecommerce`.`tb_categorias` (`id`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB;
  
  
  SET SQL_MODE=@OLD_SQL_MODE;
  SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
  SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
  