/************ Ranjith Balachandran 26/10/2017 **************************/



CREATE TABLE `gracemarks_consider_rules_flags` (
  `Id` INT(11) NOT NULL AUTO_INCREMENT,
  `gracemarks_rules_id` INT(11) NOT NULL,
  `considerMaxOrObtained` INT(11) NOT NULL,
  `considerMarkDistribution` INT(11) NOT NULL,
  `considerPassPercentage` INT(11) NOT NULL,
  `considerSupplyPercentage` INT(11) NOT NULL,
  `considerTotalPercentage` INT(11) NULL DEFAULT NULL,
  `considerSubjectLimit` INT(11) NULL DEFAULT NULL,
  PRIMARY KEY (`Id`)
  ) ENGINE=InnoDB;


ALTER TABLE gracemarks_rules CHANGE COLUMN passPaperPercentage passPaperPercentage VARCHAR (50) DEFAULT NULL;

ALTER TABLE gracemarks_rules CHANGE COLUMN supplyPaperPercentage supplyPaperPercentage VARCHAR (50) DEFAULT NULL;

ALTER TABLE gracemarks_rules CHANGE COLUMN totalPecentageLimit totalPecentageLimit VARCHAR (50) DEFAULT NULL;

ALTER TABLE gracemarks_rules CHANGE COLUMN mark_distribution mark_distribution VARCHAR (50) DEFAULT NULL;

ALTER TABLE gracemarks_rules CHANGE COLUMN considerMark considerMark VARCHAR (50) DEFAULT NULL;

ALTER TABLE gracemarks_rules CHANGE COLUMN subjectLimit subjectLimit VARCHAR (50) DEFAULT NULL;


ALTER TABLE gracemarks_save_appln ADD CONSTRAINT combineIDs UNIQUE (gracemarks_appln_initiate_id, gracemarks_event_category_id, gracemarks_event_subcategory_id, gracemarks_level_id,gracemarks_position_id,studentaccount_id);

ALTER TABLE gracemarks_save_appln ADD COLUMN printedOut INT DEFAULT NULL;


/** new one to be updated ****/


alter table gracemarks_rules add column studentPassPercentage varchar(50) default null;