/*Aswin 10-05-18*/
alter table admission_student_details add column talukID int,add column districtID int;
alter table taluks add column student_specify tinyint(1) default 0;


/*Kishan 14-05-2018*/

CREATE TABLE `admission_enabled` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `courseType` VARCHAR(45) NULL,
  `enabledFlag` VARCHAR(45) NULL,
  PRIMARY KEY (`id`),
  UNIQUE INDEX `id_UNIQUE` (`id` ASC));
  
  
  ALTER TABLE `admission_enabled` 
ADD UNIQUE INDEX `coursetype_unique` (`courseType` ASC);
/*Aswin 15-05-2018*/
create table admission_bank_challan_details_sbi (id int primary key auto_increment,category_name varchar(45),payment_mode varchar(45),referenceID varchar(45) unique,transaction_date date,amount float(6,2),status varchar(100),student_name varchar(100),studentEmail varchar(100) unique,remarks varchar(100));
/*Aswin 17-05-2018*/
alter table nationality modify column nationalityName varchar(50) not null unique;
alter table admission_indian_states modify column state_name varchar(45) not null unique;
alter table districts add unique unique_dist (admission_indian_states_id,districtName);
alter table taluks add unique unique_tlk (districts_id,talukName);
alter table admission_student_details_pg add column talukID int,add column districtID int;
alter table autonomous_feature_settings modify column value varchar(200) default 0;
insert into autonomous_feature_settings (name,value,type,created_by,updated_by) values ('ENTRANCE_MSG','please use this printed form as hall ticket for entrance test','ADMISSION',1,1);
create table admission_entrance_patternCourses (id int primary key auto_increment,patterncourseID int not null unique);
insert into autonomous_feature_settings (name,value,type,created_by,updated_by) values ('PG_MARK_SKIP_MSG','students who have not obtained their UG mark/grade can skip this section','ADMISSION','1','1');
create table admission_intimation_student_limit (id int primary key auto_increment,patterncourseID int not null,seatReservationID int not null,merit int default 0,waiting_list int default 0);





/*Kishan 19-05-2018*/
ALTER TABLE `pg_admission_streams` 
ADD COLUMN `enterMarkFlag` INT(11) NULL DEFAULT 0 AFTER `streamType`,
ADD COLUMN `enterGradeFlag` INT(11) NULL DEFAULT 0 AFTER `enterMarkFlag`,
ADD COLUMN `semesterWise` INT(11) NULL DEFAULT 0 AFTER `enterGradeFlag`;
/*Aswin 20-5-2018*/
alter table pg_admission_streams add column markOldScheme int default 0;

/** Ranjith 21-05-2018 **/

ALTER TABLE admission_intimation_student_limit ADD COLUMN course_type_id INT DEFAULT NULL;

ALTER TABLE admission_intimation_student_limit ADD COLUMN allotmentId INT DEFAULT NULL;


/*Aswin 22-5-2018*/

alter table pg_admission_stream_validation add column complementary_mark_max_limit int,add column is_mark_mandatory int;
alter table pg_admission_stream_validation modify column is_mark_mandatory int default 0;

/*Aswin 24-5-2018*/
/**For group SMS*/
insert into autonomous_feature_settings (name,value,type,created_by,updated_by) values ('INTIMATION_SMS_GROUP','1','ADMISSION','1','1');
/**For single sms*/
insert into autonomous_feature_settings (name,value,type,created_by,updated_by) values ('INTIMATION_SMS_GROUP','0','ADMISSION','1','1');

alter table pg_admission_streams add column streamDesc varchar(500);
alter table pg_admission_streams add column noValidation int default 0;

alter table pg_admission_streams add unique (streamType);

insert into pg_admission_appln_user_query (table_name,user_query) values ('reservation_students',' where hide_admission<>1');




/*Kishan 28 may , 2018*/
ALTER TABLE `pg_admission_appln_forms_fields` 
CHANGE COLUMN `description` `description` VARCHAR(250) NULL DEFAULT NULL ;



/*Aswin 28-5-2018*/

create pg_admission_entrance_marks (id int primary key auto_increment,studentID int not null,entrance_mark int default 0,patterncourseID int not null);

create table pg_admission_index_mark_percentage (id int primary key auto_increment,percentage int not null);

alter table pg_admission_index_mark_percentage add column patterncourseID int not null after id;

create table pgadmission_deptcourse_indexmarks_old (id int primary key auto_increment,studentID int not null,patterncourseID int not null,mark int not null);

alter table pgadmission_deptcourse_indexmarks_old modify column mark float(7,3) not null default 0;

/*Aswin 29-5-2018*/

create table admission_course_group_pattern_relation_ug (id int primary key auto_increment,admission_course_groupID int not null,ug_streamID int not null);

/*Aswin 30-5-2018*/

alter table admission_admit_student_inbrach add column paid tinyint(1) default 0;

/*Aswin 31-5-2018*/
alter table pg_admission_admit_student_inbranch add column paid tinyint(1) default 0;

/*Aswin 04-06-2018*/
insert into autonomous_feature_settings (name,value,type,created_by,updated_by) values ('ADMISSION_ID_CARD_TEMPLATE','template1','ADMISSION','1','1');

/*Aswin 05-06-2018*/
alter table pg_admission_index_mark_percentage add column minMark int not null;
alter table tc_prefix modify column prefix varchar(20);
insert into student_tc_templates (templateName,templateUrl,templatePrintUrl,isActiveTemplate) values ('Template3','studentTcTemplate3','studentTcTemplatePrint3','1');

ALTER TABLE `studentaccount`  ADD COLUMN `syllabus10` INT NULL , ADD COLUMN `syllabus12` INT NULL ;

alter table studentaccount add column fatherName varchar(45),add column isManagement int default 0;

alter table studentaccount add column talukID int,add column districtID int;

alter table studentaccount add column taluk varchar(45);




/*Aswin 10-06-2018*/

alter table admission_admit_student_inbrach modify column admissionNo varchar(45);

alter table admission_admit_weightage_student_inbranch modify column admissionNo varchar(45);

alter table admission_management_students modify column admissionNo varchar(45);

/*Aswin 11-06-2018*/
alter table amsstudent_pg_student_compl_grp_point add column markawarded int (11) not null;

alter table amsstudent_pg_student_compl_grp_point add column admissionDate date;

alter table studentaccount_extras add column admissionDate date;

create table ams_pg_student_semester_grade (id int primary key auto_increment,studentID int(11),sem int(11),subjectName varchar(100),credit int(11),overall_wgpa float(5,2),admission_complementary_groupID int (11),creditPoint float (5,2),markawarded int(11),maxmark int(11),admissionDate date);

/*Aswin 12-06-2018*/
alter table admission_hod_msg_configure change column deptID patterncourseID int(11);

alter table admission_department_phone change column deptID patterncourseID int(11);

/*Aswin 13-06-2018*/
alter table admission_admin change column deptID patterncourseID int(11) default 0;


/*Aswin 18-06-2018*/
create table admission_intimation_student_limit_pg (id int primary key auto_increment,patterncourseID int,seatReservationID int,merit int default 0,waiting_list int default 0,course_type_id int,isAdmitLimit int default 0);
alter table admission_allotment_letter_design add column courseType int default 1;
alter table admission_allotment_letter_design drop key allotment_letter_design;
alter table admission_allotment_letter_design  add constraint allotment_letter_design unique (allotment_table_id,patterncourseID,courseType);
