
/*************** ranjith , nov 23, 2017 **************************/
ALTER TABLE student_final_percentage ADD COLUMN failCount INT DEFAULT NULL;


/*************** Kishan , nov 23, 2017 **************************/

ALTER TABLE subbatches ADD UNIQUE INDEX subbatch_unique (psID,batchID,semID,subbatchName);

CREATE TABLE `password_change_date_settings` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `change_date` DATE NOT NULL,
  `deptID` INT(11) NOT NULL,
  `sms_email` VARCHAR(45) NOT NULL DEFAULT 'email',
  PRIMARY KEY (`id`));



CREATE TABLE `student_semwise_percentage` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `studentID` int(11) DEFAULT NULL,
  `courseTypeID` int(11) DEFAULT NULL,
  `batchID` int(11) DEFAULT NULL,
  `semID` int(11) DEFAULT NULL,
  `totalMarks` varchar(50) DEFAULT NULL,
  `maxMarks` varchar(10) DEFAULT NULL,
  `failCount` int(3) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB;


ALTER TABLE `password_change_date_settings` 
ADD COLUMN `createdBy` INT(11) NOT NULL AFTER `sms_email`,
ADD COLUMN `updatedBy` INT(11) NOT NULL AFTER `createdBy`,
ADD COLUMN `createdDate` DATETIME NOT NULL AFTER `updatedBy`,
ADD COLUMN `updatedDate` DATETIME NOT NULL AFTER `createdDate`;


ALTER TABLE password_change_date_settings ADD UNIQUE INDEX deptID (deptID);


CREATE TABLE `staff_forgotPassword` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `staffId` int(11) DEFAULT NULL,
  `staffEmail` varchar(50) DEFAULT NULL,
  `staffAccount` varchar(11) DEFAULT NULL,
  `randNo` varchar(40) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB;


ALTER TABLE staff_forgotPassword ADD COLUMN usedRandNoFlag INT DEFAULT NULL;


ALTER TABLE `staff_forgotPassword` ADD COLUMN createdDate TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL;

ALTER TABLE `staff_forgotPassword` ADD COLUMN updatedDate TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL;


