DROP TABLE IF EXISTS PROJECT_SUBMISSION;
CREATE TABLE PROJECT_SUBMISSION (
  ID_INTERNAL INT(11) NOT NULL auto_increment,
  SUBMISSION_DATE_TIME TIMESTAMP NOT NULL,
  KEY_PROJECT INT(11) NOT NULL,
  KEY_STUDENT_GROUP INT(11) NOT NULL,
  KEY_ATTENDS INT(11) NOT NULL,
  KEY_PROJECT_SUBMISSION_FILE INT(11) NOT NULL,
  KEY_ROOT_DOMAIN_OBJECT INT(11) NOT NULL DEFAULT 1,
  PRIMARY KEY (ID_INTERNAL)
) ENGINE=InnoDB;


DROP TABLE IF EXISTS PROJECT_SUBMISSION_LOG;
CREATE TABLE PROJECT_SUBMISSION_LOG (
  ID_INTERNAL INT(11) NOT NULL auto_increment,
  SUBMISSION_DATE_TIME TIMESTAMP NOT NULL,
  FILENAME VARCHAR(255) NOT NULL,
  FILE_MIME_TYPE VARCHAR(48) NOT NULL,
  FILE_CHECKSUM VARCHAR(64) NOT NULL,
  FILE_CHECKSUM_ALGORITHM VARCHAR(32) NOT NULL,	
  FILE_SIZE INT(11) NOT NULL,
  KEY_PROJECT INT(11) NOT NULL,
  KEY_STUDENT_GROUP INT(11) NOT NULL,
  KEY_ATTENDS INT(11) NOT NULL,
  KEY_ROOT_DOMAIN_OBJECT INT(11) NOT NULL DEFAULT 1,
  PRIMARY KEY (ID_INTERNAL)
) ENGINE=InnoDB;
