delete from FF$DOMAIN_CLASS_INFO where DOMAIN_CLASS_NAME like '%nquiries%' and DOMAIN_CLASS_ID >=996;

update FF$DOMAIN_CLASS_INFO set DOMAIN_CLASS_NAME = 'net.sourceforge.fenixedu.domain.oldInquiries.OldInquiriesSummary' where DOMAIN_CLASS_ID = 56;
update FF$DOMAIN_CLASS_INFO set DOMAIN_CLASS_NAME = 'net.sourceforge.fenixedu.domain.oldInquiries.InquiryResponsePeriod' where DOMAIN_CLASS_ID = 413;
update FF$DOMAIN_CLASS_INFO set DOMAIN_CLASS_NAME = 'net.sourceforge.fenixedu.domain.oldInquiries.OldInquiriesCoursesRes' where DOMAIN_CLASS_ID = 438;
update FF$DOMAIN_CLASS_INFO set DOMAIN_CLASS_NAME = 'net.sourceforge.fenixedu.domain.oldInquiries.InquiriesTeacher' where DOMAIN_CLASS_ID = 460;
update FF$DOMAIN_CLASS_INFO set DOMAIN_CLASS_NAME = 'net.sourceforge.fenixedu.domain.oldInquiries.InquiriesRoom' where DOMAIN_CLASS_ID = 491;
update FF$DOMAIN_CLASS_INFO set DOMAIN_CLASS_NAME = 'net.sourceforge.fenixedu.domain.oldInquiries.InquiriesStudentExecutionPeriod' where DOMAIN_CLASS_ID = 549;
update FF$DOMAIN_CLASS_INFO set DOMAIN_CLASS_NAME = 'net.sourceforge.fenixedu.domain.oldInquiries.OldInquiriesTeachersRes' where DOMAIN_CLASS_ID = 571;
update FF$DOMAIN_CLASS_INFO set DOMAIN_CLASS_NAME = 'net.sourceforge.fenixedu.domain.oldInquiries.InquiriesCourse' where DOMAIN_CLASS_ID = 582;
update FF$DOMAIN_CLASS_INFO set DOMAIN_CLASS_NAME = 'net.sourceforge.fenixedu.domain.oldInquiries.InquiriesRegistry' where DOMAIN_CLASS_ID = 609;
update FF$DOMAIN_CLASS_INFO set DOMAIN_CLASS_NAME = 'net.sourceforge.fenixedu.domain.oldInquiries.teacher.TeachingInquiry' where DOMAIN_CLASS_ID = 979;
update FF$DOMAIN_CLASS_INFO set DOMAIN_CLASS_NAME = 'net.sourceforge.fenixedu.domain.oldInquiries.StudentInquiriesTeachingResult' where DOMAIN_CLASS_ID = 991;
update FF$DOMAIN_CLASS_INFO set DOMAIN_CLASS_NAME = 'net.sourceforge.fenixedu.domain.oldInquiries.StudentInquiriesCourseResult' where DOMAIN_CLASS_ID = 995;


create table `STUDENT_INQUIRY_EXECUTION_PERIOD` (`OID` bigint unsigned, `OID_STUDENT` bigint unsigned, `DONT_WANT_TO_RESPOND` tinyint(1), `OID_ROOT_DOMAIN_OBJECT` bigint unsigned, `WEEKLY_HOURS_SPENT_IN_CLASSES_SEASON` int(11), `OID_EXECUTION_PERIOD` bigint unsigned, `ID_INTERNAL` int(11) NOT NULL auto_increment, primary key (ID_INTERNAL), index (OID), index (OID_STUDENT), index (OID_ROOT_DOMAIN_OBJECT), index (OID_EXECUTION_PERIOD)) type=InnoDB, character set latin1;
create table `STUDENT_INQUIRY_REGISTRY` (`ESTIMATED_E_C_T_S` double, `ATTENDENCE_CLASSES_PERCENTAGE` int(11), `OID` bigint unsigned, `STATE` text, `OID_STUDENT` bigint unsigned, `WEEKLY_HOURS_SPENT_PERCENTAGE` int(11), `STUDY_DAYS_SPENT_IN_EXAMS_SEASON` double, `OID_EXECUTION_COURSE` bigint unsigned, `OID_CURRICULAR_COURSE` bigint unsigned, `OID_ROOT_DOMAIN_OBJECT` bigint unsigned, `OID_EXECUTION_PERIOD` bigint unsigned, `ID_INTERNAL` int(11) NOT NULL auto_increment, primary key (ID_INTERNAL), index (OID), index (OID_STUDENT), index (OID_EXECUTION_COURSE), index (OID_CURRICULAR_COURSE), index (OID_ROOT_DOMAIN_OBJECT), index (OID_EXECUTION_PERIOD)) type=InnoDB, character set latin1;
create table `INQUIRY_QUESTION_HEADER` (`OID` bigint unsigned, `OID_INQUIRY_GROUP_QUESTION` bigint unsigned, `TOOL_TIP` text, `OID_INQUIRY_QUESTION` bigint unsigned, `SCALE_HEADERS` text, `OID_ROOT_DOMAIN_OBJECT` bigint unsigned, `OID_INQUIRY_BLOCK` bigint unsigned, `TITLE` text, `ID_INTERNAL` int(11) NOT NULL auto_increment, primary key (ID_INTERNAL), index (OID), index (OID_ROOT_DOMAIN_OBJECT)) type=InnoDB, character set latin1;
create table `QUESTION_CONDITION` (`OID` bigint unsigned, `OID_INQUIRY_GROUP_QUESTION` bigint unsigned, `DEPENDS_RESULT` tinyint(1), `SHOW_IF_CONDITION_IS_FALSE` tinyint(1), `MINIMUM_NUMBER_OF_CHARS` int(11), `OID_INQUIRY_QUESTION` bigint unsigned, `OJB_CONCRETE_CLASS` varchar(255) NOT NULL DEFAULT '', `CONDITION_VALUES` text, `OID_INQUIRY_DEPENDENT_QUESTION` bigint unsigned, `OID_ROOT_DOMAIN_OBJECT` bigint unsigned, `ID_INTERNAL` int(11) NOT NULL auto_increment, primary key (ID_INTERNAL), index (OID), index (OID_INQUIRY_GROUP_QUESTION), index (OID_INQUIRY_QUESTION), index (OID_ROOT_DOMAIN_OBJECT)) type=InnoDB, character set latin1;
create table `INQUIRY_QUESTION` (`OID_DEPENDENT_QUESTION_CONDITION` bigint unsigned, `OID` bigint unsigned, `NEW_ROW` tinyint(1), `OID_INQUIRY_GROUP_QUESTION` bigint unsigned, `AUTOFIT` tinyint(1), `LABEL` text, `SHOW_REQUIRED_MARK` tinyint(1), `QUESTION_ORDER` int(11), `OJB_CONCRETE_CLASS` varchar(255) NOT NULL DEFAULT '', `OID_INQUIRY_QUESTION_HEADER` bigint unsigned, `TEXT_AREA` tinyint(1), `TOOL_TIP` text, `REQUIRED` tinyint(1), `OID_ROOT_DOMAIN_OBJECT` bigint unsigned, `ID_INTERNAL` int(11) NOT NULL auto_increment, primary key (ID_INTERNAL), index (OID), index (OID_INQUIRY_GROUP_QUESTION), index (OID_ROOT_DOMAIN_OBJECT)) type=InnoDB, character set latin1;
create table `INQUIRY_GROUP_QUESTION` (`OID` bigint unsigned, `REQUIRED` tinyint(1), `OID_ROOT_DOMAIN_OBJECT` bigint unsigned, `OID_INQUIRY_QUESTION_HEADER` bigint unsigned, `OID_INQUIRY_BLOCK` bigint unsigned, `GROUP_ORDER` int(11), `ID_INTERNAL` int(11) NOT NULL auto_increment, primary key (ID_INTERNAL), index (OID), index (OID_ROOT_DOMAIN_OBJECT), index (OID_INQUIRY_BLOCK)) type=InnoDB, character set latin1;
create table `INQUIRY_ANSWER` (`ANSWER_DURATION` bigint(20), `ATTENDENCE_CLASSES_PERCENTAGE` int(11), `OID` bigint unsigned, `NOT_ANSWERED_OTHER_JUSTIFICATION` text, `OJB_CONCRETE_CLASS` varchar(255) NOT NULL DEFAULT '', `OID_EXECUTION_PERIOD` bigint unsigned, `OID_ROOM` bigint unsigned, `OID_INQUIRY_COURSE_ANSWER` bigint unsigned, `COMMITTED_FRAUD` tinyint(1), `NUMBER_OF_ENROLMENTS` int(11), `OID_PROFESSORSHIP` bigint unsigned, `NOT_ANSWERED_JUSTIFICATION` text, `WEEKLY_HOURS_SPENT_PERCENTAGE` int(11), `STUDY_DAYS_SPENT_IN_EXAMS_SEASON` double, `OID_EXECUTION_DEGREE_STUDENT` bigint unsigned, `ID_INTERNAL` int(11) NOT NULL auto_increment, `OID_NON_AFFILIATED_TEACHER` bigint unsigned, `RESPONSE_DATE_TIME` timestamp NULL default NULL, `GRADE` text, `ENTRY_GRADE` text, `OID_EXECUTION_COURSE` bigint unsigned, `STUDENT_TYPE` text, `OID_EXECUTION_DEGREE_COURSE` bigint unsigned, `SHIFT_TYPE` text, `OID_ROOT_DOMAIN_OBJECT` bigint unsigned, primary key (ID_INTERNAL), index (OID), index (OID_NON_AFFILIATED_TEACHER), index (OID_INQUIRY_COURSE_ANSWER), index (OID_PROFESSORSHIP), index (OID_EXECUTION_DEGREE_COURSE), index (OID_EXECUTION_COURSE), index (OID_EXECUTION_DEGREE_STUDENT), index (OID_ROOT_DOMAIN_OBJECT), index (OID_EXECUTION_PERIOD), index (OID_ROOM)) type=InnoDB, character set latin1;
create table `INQUIRY_TEMPLATE` (`COURSE_TYPE` text, `RESPONSE_PERIOD_BEGIN` timestamp NULL default NULL, `OID` bigint unsigned, `INQUIRY_MESSAGE` text, `RESPONSE_PERIOD_END` timestamp NULL default NULL, `OJB_CONCRETE_CLASS` varchar(255) NOT NULL DEFAULT '', `OID_ROOT_DOMAIN_OBJECT` bigint unsigned, `OID_EXECUTION_PERIOD` bigint unsigned, `ID_INTERNAL` int(11) NOT NULL auto_increment, primary key (ID_INTERNAL), index (OID), index (OID_ROOT_DOMAIN_OBJECT), index (OID_EXECUTION_PERIOD)) type=InnoDB, character set latin1;
create table `QUESTION_ANSWER` (`OID` bigint unsigned, `OID_INQUIRY_ANSWER` bigint unsigned, `OID_INQUIRY_QUESTION` bigint unsigned, `OID_ROOT_DOMAIN_OBJECT` bigint unsigned, `ANSWER` text, `ID_INTERNAL` int(11) NOT NULL auto_increment, primary key (ID_INTERNAL), index (OID), index (OID_INQUIRY_ANSWER), index (OID_INQUIRY_QUESTION), index (OID_ROOT_DOMAIN_OBJECT)) type=InnoDB, character set latin1;
create table `INQUIRY_BLOCK` (`OID` bigint unsigned, `BLOCK_ORDER` int(11), `OID_INQUIRY` bigint unsigned, `OID_INQUIRY_QUESTION_HEADER` bigint unsigned, `OID_ROOT_DOMAIN_OBJECT` bigint unsigned, `ID_INTERNAL` int(11) NOT NULL auto_increment, primary key (ID_INTERNAL), index (OID), index (OID_INQUIRY), index (OID_ROOT_DOMAIN_OBJECT)) type=InnoDB, character set latin1;
