/*****kishan, adding hr designations 0ct 10, 2017******************/

INSERT INTO hr_designations (designationID,designationName,designationDesc) VALUES (1,'Faculty','Faculty');
INSERT INTO hr_sections (sectionID,sectionName,sectionDesc) VALUES (1,'Academics','Academics');
INSERT INTO hr_section_designation (sectionID,designationID) VALUES (1,1);
UPDATE staffaccounts set designationID = 1 ;



ALTER TABLE `exam_registration_fine` 
ADD COLUMN `verificationDate` VARCHAR(45) NULL AFTER `startDate`;

/*****Sujesh T, batch_timetable_swap_log and batch_timetable_swap_order******************/


CREATE TABLE `batch_timetable_swap_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `createdBy` int(11) NOT NULL,
  `updatedBy` int(11) NOT NULL,
  `createdDate` datetime NOT NULL,
  `updatedDate` datetime NOT NULL,
  PRIMARY KEY (`id`)
) 


CREATE TABLE `batch_timetable_day_order` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `dayId` INT(11) NOT NULL,
  `dayOrder` INT(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE INDEX `dayId_UNIQUE` (`dayId` ASC));



ALTER TABLE `batch_timetable_day_order` 
ADD COLUMN `courseTypeId` INT(11) NOT NULL AFTER `dayOrder`,
ADD COLUMN `batchStartYear` VARCHAR(45) NOT NULL AFTER `courseTypeId`;


ALTER TABLE `batch_timetable_day_order` 
DROP INDEX `dayId_UNIQUE` ;



/************ FRANCIS DAVY ******************/


ALTER TABLE `exam_registration_batches` ADD COLUMN `id` INT NOT NULL AUTO_INCREMENT AFTER `examRegID`, ADD PRIMARY KEY (`id`);

ALTER TABLE `exam_registration_batches` CHANGE COLUMN `id` `id` INT(11) NOT NULL AUTO_INCREMENT FIRST;

DELETE t1 FROM exam_registration_batches t1, exam_registration_batches t2 WHERE t1.id < t2.id AND t1.examregID=t2.examregID and t1.batchID=t2.batchID and t1.semID=t2.semID;

ALTER TABLE `exam_registration_batches` ADD UNIQUE INDEX `index2` (`examregID` ASC, `batchID` ASC, `semID` ASC);


