CREATE TABLE `icon_catalogue` (
  `serial_ict` INT NOT NULL AUTO_INCREMENT,
  `name_ict` VARCHAR(45) NOT NULL,
  `description_ict` VARCHAR(100) NULL,
  `status_ict` ENUM('ACTIVE', 'INACTIVE') NOT NULL DEFAULT 'ACTIVE',
  PRIMARY KEY (`serial_ict`));

CREATE TABLE `summary` (
  `serial_ict` INT NOT NULL,
  `serial_emp` INT NOT NULL,
  `status_sum` ENUM('ACTIVE', 'INACTIVE') NOT NULL DEFAULT 'ACTIVE',
  PRIMARY KEY (`serial_ict`, `serial_emp`),
  INDEX `fk_emp_idx` (`serial_emp` ASC),
  CONSTRAINT `fk_emp`
    FOREIGN KEY (`serial_emp`)
    REFERENCES `employee` (`serial_emp`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_ict`
    FOREIGN KEY (`serial_ict`)
    REFERENCES `icon_catalogue` (`serial_ict`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION);

CREATE TABLE `new` (
  `serial_new` INT NOT NULL AUTO_INCREMENT,
  `title_new` VARCHAR(45) NOT NULL,
  `description_new` TEXT NOT NULL,
  `priority_new` SET('IS PRIORITY') NULL,
  `creation_date_new` DATETIME NULL,
  `publication_date_new` DATETIME NULL,
  `expiration_date_new` DATETIME NULL,
  `status_new` ENUM('ACTIVE', 'INACTIVE') NULL DEFAULT 'ACTIVE',
  PRIMARY KEY (`serial_new`));

INSERT INTO `new` (`serial_new`, `title_new`, `description_new`, `creation_date_new`, `publication_date_new`, `expiration_date_new`, `status_new`) VALUES ('1', 'Graduación', 'Graduación tercero de Bachillerato', '2018-03-18 12:00:00', '2018-03-16 12:00:00', '2018-04-16 12:00:00', 'ACTIVE');
INSERT INTO `new` (`serial_new`, `title_new`, `description_new`, `priority_new`, `creation_date_new`, `publication_date_new`, `expiration_date_new`, `status_new`) VALUES ('2', 'Deportes', 'Inaguración del campeonato de deportes', 'IS_PRIORITY', '2018-05-18 12:00:00', '2018-05-16 12:00:00', '2018-05-16 12:00:00', 'ACTIVE');

CREATE TABLE `img_new` (
  `serial_imgn` INT NOT NULL AUTO_INCREMENT,
  `serial_new` INT NOT NULL,
  `name_img` VARCHAR(45) NULL,
  `status_imgn` ENUM('ACTIVE', 'INACTIVE') NULL DEFAULT 'ACTIVE',
  PRIMARY KEY (`serial_imgn`),
  INDEX `fk_new_idx` (`serial_new` ASC),
  CONSTRAINT `fk_new`
    FOREIGN KEY (`serial_new`)
    REFERENCES `tomasmoro_pruebas_app20180620`.`new` (`serial_new`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION);

INSERT INTO `img_new` (`serial_imgn`, `serial_new`, `name_img`, `status_imgn`) VALUES ('1', '1', 'noticia1.jpg', 'ACTIVE');
INSERT INTO `img_new` (`serial_imgn`, `serial_new`, `name_img`, `status_imgn`) VALUES ('2', '2', 'noticia2.jpg', 'ACTIVE');
INSERT INTO `img_new` (`serial_imgn`, `serial_new`, `name_img`, `status_imgn`) VALUES ('3', '1', 'noticia2.jpg', 'ACTIVE');

INSERT INTO `icon_catalogue` (`serial_ict`, `name_ict`, `description_ict`, `status_ict`) VALUES ('1', 'Calificaciones', 'Calificaciones por profesores', 'ACTIVE');
INSERT INTO `icon_catalogue` (`serial_ict`, `name_ict`, `description_ict`, `status_ict`) VALUES ('2', 'Comportamiento Inspector', 'Comportamiento para ser registrado por los inspectores', 'ACTIVE');
INSERT INTO `icon_catalogue` (`serial_ict`, `name_ict`, `description_ict`, `status_ict`) VALUES ('3', 'Comportamiento Profesor', 'Comportamiento por profesor de cada materia', 'ACTIVE');
INSERT INTO `icon_catalogue` (`serial_ict`, `name_ict`, `description_ict`, `status_ict`) VALUES ('4', 'Comportamiento Dirigente de Curso', 'Comportamiento registrado por cada dirigente de curso', 'ACTIVE');
INSERT INTO `icon_catalogue` (`serial_ict`, `name_ict`, `description_ict`, `status_ict`) VALUES ('5', 'Asistencia', 'Registro de asistencia', 'ACTIVE');

INSERT INTO `summary` (`serial_ict`, `serial_emp`, `status_sum`) VALUES ('1', '360', 'ACTIVE');
INSERT INTO `summary` (`serial_ict`, `serial_emp`, `status_sum`) VALUES ('2', '30', 'ACTIVE');
INSERT INTO `summary` (`serial_ict`, `serial_emp`, `status_sum`) VALUES ('3', '360', 'ACTIVE');
INSERT INTO `summary` (`serial_ict`, `serial_emp`, `status_sum`) VALUES ('4', '30', 'ACTIVE');
INSERT INTO `summary` (`serial_ict`, `serial_emp`, `status_sum`) VALUES ('5', '30', 'ACTIVE');
INSERT INTO `summary` (`serial_ict`, `serial_emp`, `status_sum`) VALUES ('5', '360', 'ACTIVE');
