CREATE TABLE `users` (
  `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` VARCHAR(45),
  `lastname` VARCHAR(45),
  `email` VARCHAR(100),
  `password` VARCHAR(245),
  `level` TINYINT,
  `enabled` TINYINT,
  PRIMARY KEY (`id`)
)
ENGINE = InnoDB;

CREATE TABLE `historylog` (
  `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  `email` VARCHAR(100),
  `password` VARCHAR(245),
  `ip` VARCHAR(20),
  PRIMARY KEY (`id`)
)
ENGINE = InnoDB;
ALTER TABLE `historylog` ADD COLUMN `date1` DATETIME AFTER `ip`;

CREATE TABLE `editionstype` (
  `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  `description` VARCHAR(45),
  PRIMARY KEY (`id`)
)
ENGINE = InnoDB;

CREATE TABLE `editions` (
  `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  `idtype` INTEGER,
  `timeedition` INTEGER,
  `maxtimeup` INTEGER,
  `days` VARCHAR(7),
  `path` VARCHAR(500),
  `name` VARCHAR(100),
  PRIMARY KEY (`id`)
)
ENGINE = InnoDB;

ALTER TABLE `editions` MODIFY COLUMN `idtype` INTEGER(11) DEFAULT NULL,
 MODIFY COLUMN `timeedition` INTEGER(11) DEFAULT NULL,
 MODIFY COLUMN `maxtimeup` INTEGER(11) DEFAULT NULL;



CREATE TABLE `uploads` (
  `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  `dateup` TIMESTAMP,
  `idedition` INTEGER,
  `dateedition` VARCHAR(45),
  `iduser` INTEGER,
  `filename` VARCHAR(245),
  PRIMARY KEY (`id`)
)
ENGINE = InnoDB;

