/************Aswin 25-04-2018******************/
alter table collegeExtraDetailsSettings add column (phoneNo varchar(45),module varchar(100));
update collegeExtraDetailsSettings set module='EXAM_CONTROLLER' where id in ();


/*********************** Ranjith Balachandran April 26,2018 **********************/

ALTER TABLE exam_combineInternals ADD COLUMN examIdPrev INT DEFAULT NULL;

CREATE TABLE `student_final_marks_obtained` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `studentID` int(11) DEFAULT NULL,
  `courseTypeID` int(11) DEFAULT NULL,
  `batchID` int(11) DEFAULT NULL,
  `totalMarksObtained` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB;


CREATE TABLE `student_final_exam_dates` (
  `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,
  `examDate` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB;

ALTER TABLE moderation_max_mark_each_sub ADD COLUMN considerWhichPaperFlag INT DEFAULT NULL;

ALTER TABLE exam_combineInternals ADD COLUMN considerExamType INT DEFAULT 1;

/*** Ranjith Balachandran 04-05-2018 Onwards **********/

CREATE TABLE `admission_enquiry_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `courseTypeName` varchar(10) DEFAULT NULL,
  `msg` varchar(1000) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB;

/** for vimala only **/


INSERT INTO admission_enquiry_details (courseTypeName,msg) VALUES ('PG','For more information contact college, phone nos. 0487 2332080, 8086850773, 9605575589 or email us at vimalaadmission@gmail.com');

INSERT INTO admission_enquiry_details (courseTypeName,msg) VALUES ('UG','For more information contact college, phone nos. 0487 2332080, 8086850773, 9605575589 or email us at vimalaadmission@gmail.com');

CREATE TABLE `categoryCode` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `subject_category_id` INT DEFAULT NULL,
  `course_type_id` INT NOT NULL,
  `categoryCode` VARCHAR(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB;


/** Ranjith **/

ALTER TABLE secondLangauge ADD COLUMN secondLangaugeCode varchar(10) DEFAULT NULL;

ALTER TABLE batches ADD COLUMN batchOptionName varchar(50) DEFAULT NULL;

ALTER TABLE studentaccount ADD COLUMN taluk varchar(20) DEFAULT NULL;

ALTER TABLE studentaccount ADD COLUMN village varchar(20) DEFAULT NULL;

CREATE TABLE `subjectPaperType` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `paperTypeName` varchar(50) NOT NULL,
  `paperTypeCode` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB;

ALTER TABLE subjects ADD COLUMN paperTypeId INT(10) DEFAULT NULL;
ALTER TABLE subjects ADD COLUMN secondLangaugeId INT(10) DEFAULT NULL;

CREATE TABLE `courseSubjectCategoryRelation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `subject_category_id` INT DEFAULT NULL,
  `pattern_deptcourses_id` INT NOT NULL,
  `batchStartYear` INT NOT NULL,
  `categoryValue` VARCHAR(10) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB;


CREATE TABLE `trDates` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `batchId` INT DEFAULT NULL,
  `examRegId` INT NOT NULL,
  `supplyExamRegId` INT NOT NULL,
  `boardMeatingDate` date NOT NULL,
  `resultPublishDate` date DEFAULT NULL,
  `moderation` int(10) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB;

ALTER TABLE admission_quotas ADD COLUMN quotaCode varchar(10) DEFAULT NULL;


CREATE TABLE `migration_prefix` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `campus_typeID` int(11) NOT NULL,
  `fromDate` date NOT NULL,
  `toDate` date NOT NULL,
  `prefix` varchar(20) NOT NULL,
  `prefixYear` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `campus_typeID` (`campus_typeID`,`fromDate`,`toDate`),
  CONSTRAINT `mig_prefix_ibfk_1` FOREIGN KEY (`campus_typeID`) REFERENCES `campus_type` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB;

CREATE TABLE `studentMigrationCertificateNo` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `studentaccount_id` int(10) DEFAULT NULL,
  `migrationCertificateNo` int(10) DEFAULT NULL,
  `migration_prefix_id` int(10) DEFAULT NULL,
  `is_deleted` int(10) DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `studentCcNoUnique` (`studentaccount_id`,`migrationCertificateNo`)
) ENGINE=InnoDB;



/*Kishan june 4, 2018*/

ALTER TABLE `pattern_deptcourses` 
DROP INDEX `patterncourseName` ,
ADD UNIQUE INDEX `patterncourseName` (`patterncourseCode` ASC, `patterncourseID` ASC);
