create table DEGREE_INFO_CANDIDACY
   select
      ID_INTERNAL,
      KEY_ROOT_DOMAIN_OBJECT,
      ID_INTERNAL as 'KEY_DEGREE_INFO',
      ACCESS_REQUISITES,
      CANDIDACY_DOCUMENTS,
      CANDIDACY_PERIOD,
      ENROLMENT_PERIOD,
      SELECTION_RESULT_DEADLINE,
      TEST_INGRESSION
   from DEGREE_INFO;

alter table DEGREE_INFO_CANDIDACY type = InnoDB;

alter table DEGREE_INFO_CANDIDACY
   add primary key (ID_INTERNAL),
   add index (KEY_ROOT_DOMAIN_OBJECT),
   add index(KEY_DEGREE_INFO);

alter table DEGREE_INFO add column KEY_DEGREE_INFO_CANDIDACY int(11) not null;
update DEGREE_INFO set KEY_DEGREE_INFO_CANDIDACY = ID_INTERNAL;


create table DEGREE_INFO_FUTURE
   select
      ID_INTERNAL,
      KEY_ROOT_DOMAIN_OBJECT,
      ID_INTERNAL as 'KEY_DEGREE_INFO',
      OBJECTIVES,
      DESIGNED_FOR,
      PROFESSIONAL_EXITS,
      QUALIFICATION_LEVEL,
      RECOGNITIONS,
      CLASSIFICATIONS
   from DEGREE_INFO;

alter table DEGREE_INFO_FUTURE type = InnoDB;

alter table DEGREE_INFO_FUTURE
   add primary key (ID_INTERNAL),
   add index (KEY_ROOT_DOMAIN_OBJECT),
   add index(KEY_DEGREE_INFO);

alter table DEGREE_INFO add column KEY_DEGREE_INFO_FUTURE int(11) not null;
update DEGREE_INFO set KEY_DEGREE_INFO_FUTURE = ID_INTERNAL;


alter table DEGREE_INFO
   drop column ACCESS_REQUISITES,
   drop column CANDIDACY_DOCUMENTS,
   drop column CANDIDACY_PERIOD,
   drop column ENROLMENT_PERIOD,
   drop column SELECTION_RESULT_DEADLINE,
   drop column TEST_INGRESSION,
   drop column OBJECTIVES,
   drop column DESIGNED_FOR,
   drop column PROFESSIONAL_EXITS,
   drop column QUALIFICATION_LEVEL,
   drop column RECOGNITIONS,
   drop column CLASSIFICATIONS
;

alter table DEGREE_INFO type = InnoDB;
