CREATE TABLE `forum_threads` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `dateCreated` datetime NOT NULL,
  `lastModified` datetime NOT NULL,
  `version` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL,
  `subject` varchar(255) NOT NULL,
  `user` bigint(20) NOT NULL,
  `project` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `FKAF97368B924F477B` (`user`),
  KEY `FKAF97368B247CE02D` (`project`),
  KEY `deleted_index` (`deleted`),
  CONSTRAINT `FKAF97368B247CE02D` FOREIGN KEY (`project`) REFERENCES `project` (`id`),
  CONSTRAINT `FKAF97368B924F477B` FOREIGN KEY (`user`) REFERENCES `user` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

CREATE TABLE `forum_posts` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `dateCreated` datetime NOT NULL,
  `lastModified` datetime NOT NULL,
  `version` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL,
  `content` longtext NOT NULL,
  `user` bigint(20) NOT NULL,
  `thread` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `FKEDDC4F35924F477B` (`user`),
  KEY `FKEDDC4F355E9380A1` (`thread`),
  KEY `deleted_index` (`deleted`),
  CONSTRAINT `FKEDDC4F355E9380A1` FOREIGN KEY (`thread`) REFERENCES `forum_threads` (`id`),
  CONSTRAINT `FKEDDC4F35924F477B` FOREIGN KEY (`user`) REFERENCES `user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

drop table idea_student;
drop table supervisoridea_Keyword;

alter table supervisoridea_match drop foreign key FKF66B57E5BCA56165;
alter table supervisoridea_match drop foreign key FKF66B57E58DE85053;
alter table supervisoridea_match drop foreign key FKF66B57E59AA5FCB;

ALTER TABLE supervisoridea_match DROP INDEX FKF66B57E59AA5FCB;
ALTER TABLE supervisoridea_match DROP INDEX FKF66B57E58DE85053;
ALTER TABLE supervisoridea_match DROP INDEX FKF66B57E5BCA56165;

alter table supervisoridea drop foreign key IDEAPROJECTKEY;
alter table supervisoridea drop foreign key IDEAPROJECTCLASSKEY;
alter table supervisoridea drop foreign key IDEAPERIODKEY;
alter table supervisoridea drop foreign key FKD75F9E5FD69FF922;
alter table supervisoridea drop foreign key FKD75F9E5F4E257FBF;

alter table supervisoridea drop index IDEAPROJECTKEY;
alter table supervisoridea drop index IDEAPROJECTCLASSKEY;
alter table supervisoridea drop index IDEAPERIODKEY;
alter table supervisoridea drop index FKD75F9E5FD69FF922;
alter table supervisoridea drop index FKD75F9E5F4E257FBF;

drop table supervisoridea_match;

drop table first_meeting;
drop table supervisoridea;

drop table projectIdea_role;
drop table projectIdea_Language;
drop table projectIdea_Keyword;
drop table projectidea_first_meeting;
drop table projectIdea_employee;

alter table projectIdea drop foreign key FKC7F5C9B0BEC322C1;
alter table projectIdea drop foreign key FKC7F5C9B0225C6E84;
alter table projectIdea drop foreign key FKC7F5C9B0B2B6081F;
alter table projectIdea drop foreign key FKC7F5C9B048F01CA1;
alter table projectIdea drop foreign key FKC7F5C9B0C1813915;

alter table projectIdea drop index FKC7F5C9B0BEC322C1;
alter table projectIdea drop index FKC7F5C9B0225C6E84;
alter table projectIdea drop index FKC7F5C9B0B2B6081F;
alter table projectIdea drop index FKC7F5C9B048F01CA1;
alter table projectIdea drop index FKC7F5C9B0C1813915;

delete from matchings;
delete from projectIdea;

drop table matchings;
drop table projectIdea;

CREATE TABLE IF NOT EXISTS `NonWorkDayPeriod` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `dateCreated` datetime NOT NULL,
  `lastModified` datetime NOT NULL,
  `version` int(11) NOT NULL,
  `comment` varchar(255) NOT NULL,
  `endDate` datetime NOT NULL,
  `startDate` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;