CREATE TABLE `academic_area_ministry` (
  `serial_acm` INT(11) NOT NULL AUTO_INCREMENT,
  `name_acm` VARCHAR(150) NOT NULL,
  `description_acm` VARCHAR(150) NOT NULL,
  `status_acm` ENUM('ACTIVE', 'INACTIVE') NOT NULL DEFAULT 'ACTIVE',
  PRIMARY KEY (`serial_acm`));


ALTER TABLE `ministry_subject`
ADD COLUMN `type_subject_msb` ENUM('COMMON', 'OPTATIVE') NULL DEFAULT 'COMMON' AFTER `grade_type_msb`,
ADD COLUMN `serial_acm` INT(11) NULL AFTER `type_subject_msb`,
ADD UNIQUE INDEX `serial_msb_UNIQUE` (`serial_msb` ASC),
ADD INDEX `fk_academic_area_idx` (`serial_acm` ASC);
ALTER TABLE `ministry_subject`
ADD CONSTRAINT `fk_academic_area`
  FOREIGN KEY (`serial_acm`)
  REFERENCES `academic_area_ministry` (`serial_acm`)
  ON DELETE NO ACTION
  ON UPDATE NO ACTION;
