/*
 * Aswin 23-3-2018
 */
create table admission_allotment_letter_design 
(id int primary key auto_increment,
allotment_table_id int not null,
patterncourseID int not null,
allotment_message varchar(500));

alter table admission_allotment_letter_design 
add constraint allotment_letter_design unique (allotment_table_id,patterncourseID);

alter table admission_allotment_letter_design modify column allotment_message longtext;

/*
 * Aswin 27-3-2018
 */

ALTER TABLE `admission_appln_user_query` 
CHANGE COLUMN `user_query` `user_query` VARCHAR(500) NULL DEFAULT NULL ;

 update admission_appln_user_query set user_query=' where quotaID not in (select coalesce(admission_quotas_id,0) as admission_quotas_id from admission_hide_fee_reservation) order by quotaName ASC'  where table_name='admission_quotas';
 create table admission_hod_msg_configure (id int primary key auto_increment,subject varchar(45),msg varchar(300),deptID int default 0);
alter table admission_hod_msg_configure add column msgtype int;
alter table admission_hod_msg_configure add column sendFor varchar(45);
/*Aswin 09-04-18*/
alter table religion add column religionDesc varchar(300);
/*Aswin 10-04-18*/


/*PG TABLES FOR ADMISSION*/
create table pg_admission_appln_forms_section (id int primary key auto_increment,section varchar(45) not null unique,priority int,isPayment tinyint(1));
create table pg_admission_appln_forms_fields (id int primary key auto_increment,name varchar(45),label varchar(45),type varchar(45),description varchar(45),required varchar(45),validator varchar(45),foreign_key tinyint(1),table_name varchar(45),value varchar(45),display_name varchar(45),default_value varchar(45),field_relation varchar(45),event_handlers varchar(45),field_priority int,sectionID int,user_query tinyint(1),groupname varchar(45));
create table pg_admission_appln_current_section (id int primary key auto_increment,studentID int unique,sectionID int);
alter table pg_admission_appln_forms_fields modify column name varchar(45) not null unique;
create table pg_admission_appln_user_query (id int primary key auto_increment,table_name varchar(45) unique,user_query varchar(500));
create table pg_admission_appln_current_section (id int primary key auto_increment,studentID int unique not null,sectionID int);

/*Aswin 19-04-18*/
insert into admission_appln_user_query (table_name,user_query) values ('student_reservation',' where reservID not in (select reservID from admission_hide_reservation)');

/*Aswin 23-04-18*/
alter table student_caste add column sub_caste_description varchar(500);
alter table autonomous_feature_settings modify column value int(11) default 0;
insert into autonomous_feature_settings (name,value,type,created_by,updated_by) values ('TWELFTH_NORMALIZATION_MARKS',1200,'ADMISSION','1','1'),('PART3_NORMALIZATION_MARKS',800,'ADMISSION','1','1');
/*Aswin 28-04-18*/
create table pg_admission_streams (id int primary key auto_increment,streamType varchar(100) not null);
insert into pg_admission_streams (streamType) values ('Grade Stream (Semester-wise for 2017 passout-UTY 6 point scale)'),('Mark Stream (Old scheme)'),('Grade Stream (Consolidated for 2017 passout-UTY 6 point scale)'),('Grade Stream (Old scheme-UTY 4 point scale)'),('Grade Stream (Consolidated-UTY 10 point scale)');
alter table pg_admission_appln_forms_fields modify column label varchar(100);
alter table pg_admission_appln_forms_fields modify column description varchar(100);
/*Aswin 30-04-18*/
alter table admission_student_details_pg add column aadharNo varchar(45),add column poverty_line int(11);
alter table admission_student_details_pg add column motherName varchar(45),add column motherOccupation varchar(45),add column parentEmail varchar(45);

















