text: -- MySQL Script generated by MySQL Workbench
  -- 03/15/17 10:20:20
  -- 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='TRADITIONAL,ALLOW_INVALID_DATES';
  
  -- -----------------------------------------------------
  -- Schema ftbserver
  -- -----------------------------------------------------
  
  -- -----------------------------------------------------
  -- Schema ftbserver
  -- -----------------------------------------------------
  CREATE SCHEMA IF NOT EXISTS `ftbserver` DEFAULT CHARACTER SET utf8 ;
  USE `ftbserver` ;
  
  -- -----------------------------------------------------
  -- Table `ftbserver`.`users`
  -- -----------------------------------------------------
  DROP TABLE IF EXISTS `ftbserver`.`users` ;
  
  CREATE TABLE IF NOT EXISTS `ftbserver`.`users` (
    `id` INT NOT NULL AUTO_INCREMENT,
    `username` VARCHAR(255) NOT NULL,
    `password` VARCHAR(255) NOT NULL,
    `salt` VARCHAR(255) NOT NULL,
    `firstname` VARCHAR(255) NULL,
    `sirname` VARCHAR(255) NULL,
    `lastname` VARCHAR(255) NULL,
    `email` VARCHAR(255) NULL,
    `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` DATETIME NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
    `avatar` VARCHAR(255) NULL,
    PRIMARY KEY (`id`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `ftbserver`.`minecraftusers`
  -- -----------------------------------------------------
  DROP TABLE IF EXISTS `ftbserver`.`minecraftusers` ;
  
  CREATE TABLE IF NOT EXISTS `ftbserver`.`minecraftusers` (
    `id` INT NOT NULL AUTO_INCREMENT,
    `user_id` INT NOT NULL,
    `UUID` VARCHAR(255) NULL,
    `username` VARCHAR(255) NULL,
    `skin` VARCHAR(255) NULL,
    `cape` VARCHAR(255) NULL,
    `minecraftuserscol` VARCHAR(45) NULL,
    PRIMARY KEY (`id`),
    CONSTRAINT `fk_minecraftusers_users`
      FOREIGN KEY (`user_id`)
      REFERENCES `ftbserver`.`users` (`id`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB;
  
  CREATE INDEX `fk_minecraftusers_users_idx` ON `ftbserver`.`minecraftusers` (`user_id` ASC);
  
  
  -- -----------------------------------------------------
  -- Table `ftbserver`.`Items`
  -- -----------------------------------------------------
  DROP TABLE IF EXISTS `ftbserver`.`Items` ;
  
  CREATE TABLE IF NOT EXISTS `ftbserver`.`Items` (
    `id` INT NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(45) NULL,
    `price` INT NULL,
    `money` DECIMAL(6,2) NULL,
    `created_at` DATETIME NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` DATETIME NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`))
  ENGINE = InnoDB;
  
  
  -- -----------------------------------------------------
  -- Table `ftbserver`.`minecraftuser_has_Items`
  -- -----------------------------------------------------
  DROP TABLE IF EXISTS `ftbserver`.`minecraftuser_has_Items` ;
  
  CREATE TABLE IF NOT EXISTS `ftbserver`.`minecraftuser_has_Items` (
    `id` INT NOT NULL AUTO_INCREMENT,
    `minecraftuser_id` INT NOT NULL,
    `item_id` INT NOT NULL,
    `paid` VARCHAR(255) NULL,
    `created_at` DATETIME NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` DATETIME NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`, `minecraftuser_id`, `item_id`),
    CONSTRAINT `fk_minecraftusers_has_Items_minecraftusers1`
      FOREIGN KEY (`minecraftuser_id`)
      REFERENCES `ftbserver`.`minecraftusers` (`id`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
    CONSTRAINT `fk_minecraftusers_has_Items_Items1`
      FOREIGN KEY (`item_id`)
      REFERENCES `ftbserver`.`Items` (`id`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB;
  
  CREATE INDEX `fk_minecraftusers_has_Items_Items1_idx` ON `ftbserver`.`minecraftuser_has_Items` (`item_id` ASC);
  
  CREATE INDEX `fk_minecraftusers_has_Items_minecraftusers1_idx` ON `ftbserver`.`minecraftuser_has_Items` (`minecraftuser_id` ASC);
  
  
  SET SQL_MODE=@OLD_SQL_MODE;
  SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
  SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
  