-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version	5.1.42


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI_QUOTES' */;


--
-- Create schema debgenbiobanktest
--

CREATE DATABASE IF NOT EXISTS debgenbiobanktest;
USE debgenbiobanktest;

--
-- Definition of table "debgen_analysis_common"
--

DROP TABLE IF EXISTS "debgen_analysis_common";
CREATE TABLE "debgen_analysis_common" (
  "id" bigint(20) NOT NULL AUTO_INCREMENT,
  "DNAIndex" varchar(255) DEFAULT NULL,
  "diagnosis" varchar(255) DEFAULT NULL,
  "financialCategory" int(11) NOT NULL,
  "immuneFenotypeFAB" varchar(255) DEFAULT NULL,
  "nameOfSenderInstitute" varchar(255) DEFAULT NULL,
  "numberOfWhiteCorpuscles" bigint(20) NOT NULL,
  "objectType" varchar(255) DEFAULT NULL,
  "senderCode" varchar(255) DEFAULT NULL,
  "startOfTherapy" datetime DEFAULT NULL,
  "patient_id" bigint(20) DEFAULT NULL,
  "DTYPE" varchar(31) DEFAULT NULL,
  "createdOn" date DEFAULT NULL,
  "KBA" varchar(255) DEFAULT NULL,
  "blastBoneMarrow" varchar(255) DEFAULT NULL,
  "blastPeripheria" varchar(255) DEFAULT NULL,
  "caseNumber" varchar(255) DEFAULT NULL,
  "comment" varchar(255) DEFAULT NULL,
  "doctor" varchar(255) DEFAULT NULL,
  "orderType" varchar(255) DEFAULT NULL,
  "sampleMaterial" varchar(255) DEFAULT NULL,
  "bdCitogenetic" bit(1) DEFAULT NULL,
  "bdCitogeneticalAnalysis" bit(1) DEFAULT NULL,
  "bdComment" varchar(255) DEFAULT NULL,
  "bdDNAPreparation" bit(1) DEFAULT NULL,
  "bdDNAStoredSample" bit(1) DEFAULT NULL,
  "bdDNAStoredSampleDate" date DEFAULT NULL,
  "bdDiGeorge" bit(1) DEFAULT NULL,
  "bdDoctor" varchar(255) DEFAULT NULL,
  "bdFGFR2OrFGFR3" bit(1) DEFAULT NULL,
  "bdFamilyAnamnesis" varchar(255) DEFAULT NULL,
  "bdFish" bit(1) DEFAULT NULL,
  "bdFragX" bit(1) DEFAULT NULL,
  "bdMolecular" bit(1) DEFAULT NULL,
  "bdMulticolorFish" bit(1) DEFAULT NULL,
  "bdPatientAnamnesis" varchar(255) DEFAULT NULL,
  "bdPraderWilli" bit(1) DEFAULT NULL,
  "bdPrenatalisAnamnesis" varchar(255) DEFAULT NULL,
  "bdSCE" bit(1) DEFAULT NULL,
  "bdSRY" bit(1) DEFAULT NULL,
  "bdSmithMagenis" bit(1) DEFAULT NULL,
  "bdSubtelomericFish" bit(1) DEFAULT NULL,
  "bdTurnerMozaicizm" bit(1) DEFAULT NULL,
  "bdTurnerRemainingY" bit(1) DEFAULT NULL,
  "bdWilliams" bit(1) DEFAULT NULL,
  "onCitBlood" bit(1) DEFAULT NULL,
  "onCitBone" bit(1) DEFAULT NULL,
  "onCitFirst" bit(1) DEFAULT NULL,
  "onCitPreviousDate" date DEFAULT NULL,
  "onCitPreviousResult" varchar(255) DEFAULT NULL,
  "onCitTumor" bit(1) DEFAULT NULL,
  "onCitogenetical" bit(1) DEFAULT NULL,
  "onComment" varchar(255) DEFAULT NULL,
  "onDNAPreparation" bit(1) DEFAULT NULL,
  "onDNAStoredSample" bit(1) DEFAULT NULL,
  "onDNAStoredSampleDate" date DEFAULT NULL,
  "onDoctor" varchar(255) DEFAULT NULL,
  "onFish" bit(1) DEFAULT NULL,
  "onFishALL1" bit(1) DEFAULT NULL,
  "onFishALL2" bit(1) DEFAULT NULL,
  "onFishALL3" bit(1) DEFAULT NULL,
  "onFishALL4" bit(1) DEFAULT NULL,
  "onFishALL5" bit(1) DEFAULT NULL,
  "onFishALL6" bit(1) DEFAULT NULL,
  "onFishALL7" bit(1) DEFAULT NULL,
  "onFishAML1" bit(1) DEFAULT NULL,
  "onFishAML2" bit(1) DEFAULT NULL,
  "onFishAML3" bit(1) DEFAULT NULL,
  "onFishAML4" bit(1) DEFAULT NULL,
  "onFishAML5" bit(1) DEFAULT NULL,
  "onFishAML6" bit(1) DEFAULT NULL,
  "onFishAML7" bit(1) DEFAULT NULL,
  "onFishAML8" bit(1) DEFAULT NULL,
  "onFishCLL1" bit(1) DEFAULT NULL,
  "onFishCLL2" bit(1) DEFAULT NULL,
  "onFishCLL3" bit(1) DEFAULT NULL,
  "onFishCLL4" bit(1) DEFAULT NULL,
  "onFishCML1" bit(1) DEFAULT NULL,
  "onFishCML2" bit(1) DEFAULT NULL,
  "onFishCML3" bit(1) DEFAULT NULL,
  "onFishCML4" bit(1) DEFAULT NULL,
  "onFishFirst" bit(1) DEFAULT NULL,
  "onFishMDS1" bit(1) DEFAULT NULL,
  "onFishMDS2" bit(1) DEFAULT NULL,
  "onFishMDS3" bit(1) DEFAULT NULL,
  "onFishMDS4" bit(1) DEFAULT NULL,
  "onFishMDS5" bit(1) DEFAULT NULL,
  "onFishMDS6" bit(1) DEFAULT NULL,
  "onFishMyeloma1" bit(1) DEFAULT NULL,
  "onFishMyeloma2" bit(1) DEFAULT NULL,
  "onFishMyeloma3" bit(1) DEFAULT NULL,
  "onFishMyeloma4" bit(1) DEFAULT NULL,
  "onFishPreviousDate" date DEFAULT NULL,
  "onFishPreviousResult" varchar(255) DEFAULT NULL,
  "onRTPCR" bit(1) DEFAULT NULL,
  "coCaseNumber" varchar(255) DEFAULT NULL,
  "coDoctor" varchar(255) DEFAULT NULL,
  "coHead" int(11) DEFAULT NULL,
  "coHeight" int(11) DEFAULT NULL,
  "coKBA" varchar(255) DEFAULT NULL,
  "coOrderType" varchar(255) DEFAULT NULL,
  "coWeight" int(11) DEFAULT NULL,
  "BNOCode" varchar(255) DEFAULT NULL,
  "result_id" bigint(20) DEFAULT NULL,
  PRIMARY KEY ("id"),
  KEY "FK7BC95C1ED86F33B3" ("patient_id"),
  KEY "FK7BC95C1EE9688EA8" ("result_id"),
  CONSTRAINT "FK7BC95C1ED86F33B3" FOREIGN KEY ("patient_id") REFERENCES "debgen_patients" ("id"),
  CONSTRAINT "FK7BC95C1EE9688EA8" FOREIGN KEY ("result_id") REFERENCES "debgen_modules_results" ("id")
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

--
-- Dumping data for table "debgen_analysis_common"
--

/*!40000 ALTER TABLE "debgen_analysis_common" DISABLE KEYS */;
/*!40000 ALTER TABLE "debgen_analysis_common" ENABLE KEYS */;


--
-- Definition of table "debgen_anonymousdata"
--

DROP TABLE IF EXISTS "debgen_anonymousdata";
CREATE TABLE "debgen_anonymousdata" (
  "anonymousId" bigint(20) NOT NULL AUTO_INCREMENT,
  "monogram" varchar(255) DEFAULT NULL,
  PRIMARY KEY ("anonymousId")
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

--
-- Dumping data for table "debgen_anonymousdata"
--

/*!40000 ALTER TABLE "debgen_anonymousdata" DISABLE KEYS */;
/*!40000 ALTER TABLE "debgen_anonymousdata" ENABLE KEYS */;


--
-- Definition of table "debgen_forgottenpassword"
--

DROP TABLE IF EXISTS "debgen_forgottenpassword";
CREATE TABLE "debgen_forgottenpassword" (
  "id" bigint(20) NOT NULL AUTO_INCREMENT,
  "cancelCode" varchar(255) DEFAULT NULL,
  "confirmCode" varchar(255) DEFAULT NULL,
  "requestTime" datetime DEFAULT NULL,
  "userName" varchar(255) DEFAULT NULL,
  PRIMARY KEY ("id")
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

--
-- Dumping data for table "debgen_forgottenpassword"
--

/*!40000 ALTER TABLE "debgen_forgottenpassword" DISABLE KEYS */;
/*!40000 ALTER TABLE "debgen_forgottenpassword" ENABLE KEYS */;


--
-- Definition of table "debgen_modules_results"
--

DROP TABLE IF EXISTS "debgen_modules_results";
CREATE TABLE "debgen_modules_results" (
  "DTYPE" varchar(31) NOT NULL,
  "id" bigint(20) NOT NULL AUTO_INCREMENT,
  "createdOn" date DEFAULT NULL,
  "indicationOfAnalysis" varchar(255) DEFAULT NULL,
  "objectType" varchar(255) DEFAULT NULL,
  "sampleOfAnalysis" varchar(255) DEFAULT NULL,
  "template" bit(1) NOT NULL,
  "templateName" varchar(255) DEFAULT NULL,
  "citAnalysedMetaPhases" int(11) DEFAULT NULL,
  "citCountedMetaPhases" int(11) DEFAULT NULL,
  "citKaryotype" varchar(255) DEFAULT NULL,
  "citNumberOfMetaPhases" int(11) DEFAULT NULL,
  "citResultInformation" text,
  "citTenyesztesiIdo" varchar(255) DEFAULT NULL,
  "citTrackingTechnique" varchar(255) DEFAULT NULL,
  "patient_id" bigint(20) DEFAULT NULL,
  "fishOpinion" text,
  "fishResult" text,
  "fishSampleTakenOn" date DEFAULT NULL,
  "fishTenyesztesiIdo" varchar(255) DEFAULT NULL,
  "fishUsedTest" varchar(255) DEFAULT NULL,
  PRIMARY KEY ("id"),
  KEY "FK56E7AAAED86F33B3" ("patient_id"),
  CONSTRAINT "FK56E7AAAED86F33B3" FOREIGN KEY ("patient_id") REFERENCES "debgen_patients" ("id")
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

--
-- Dumping data for table "debgen_modules_results"
--

/*!40000 ALTER TABLE "debgen_modules_results" DISABLE KEYS */;
/*!40000 ALTER TABLE "debgen_modules_results" ENABLE KEYS */;


--
-- Definition of table "debgen_patients"
--

DROP TABLE IF EXISTS "debgen_patients";
CREATE TABLE "debgen_patients" (
  "id" bigint(20) NOT NULL AUTO_INCREMENT,
  "dateOfBirth" datetime DEFAULT NULL,
  "patientCode" varchar(255) DEFAULT NULL,
  "patientType" int(11) NOT NULL,
  "anonymousData_anonymousId" bigint(20) DEFAULT NULL,
  "identity_personalId" bigint(20) DEFAULT NULL,
  PRIMARY KEY ("id"),
  UNIQUE KEY "patientCode" ("patientCode"),
  CONSTRAINT "anonymousFK" FOREIGN KEY ("anonymousData_anonymousId") REFERENCES "debgen_anonymousdata" ("anonymousId") ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT "identityFK" FOREIGN KEY ("identity_personalId") REFERENCES "debgen_personalidentity" ("personalId") ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

--
-- Dumping data for table "debgen_patients"
--

/*!40000 ALTER TABLE "debgen_patients" DISABLE KEYS */;
/*!40000 ALTER TABLE "debgen_patients" ENABLE KEYS */;


--
-- Definition of table "debgen_personalidentity"
--

DROP TABLE IF EXISTS "debgen_personalidentity";
CREATE TABLE "debgen_personalidentity" (
  "personalId" bigint(20) NOT NULL AUTO_INCREMENT,
  "address" varchar(255) DEFAULT NULL,
  "city" varchar(255) DEFAULT NULL,
  "logNumber" varchar(255) DEFAULT NULL,
  "maidenName" varchar(255) DEFAULT NULL,
  "mothersName" varchar(255) DEFAULT NULL,
  "patientName" varchar(255) DEFAULT NULL,
  "tajNumber" varchar(255) DEFAULT NULL,
  "zipCode" int(11) NOT NULL,
  PRIMARY KEY ("personalId"),
  UNIQUE KEY "tajNumber" ("tajNumber")
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

--
-- Dumping data for table "debgen_personalidentity"
--

/*!40000 ALTER TABLE "debgen_personalidentity" DISABLE KEYS */;
/*!40000 ALTER TABLE "debgen_personalidentity" ENABLE KEYS */;


--
-- Definition of table "debgen_sampletype"
--

DROP TABLE IF EXISTS "debgen_sampletype";
CREATE TABLE "debgen_sampletype" (
  "id" bigint(20) NOT NULL AUTO_INCREMENT,
  "oneLetterCode" varchar(2) NOT NULL,
  "sampleCategoryName" varchar(255) NOT NULL,
  PRIMARY KEY ("id"),
  UNIQUE KEY "oneLetterCode" ("oneLetterCode")
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

--
-- Dumping data for table "debgen_sampletype"
--

/*!40000 ALTER TABLE "debgen_sampletype" DISABLE KEYS */;
/*!40000 ALTER TABLE "debgen_sampletype" ENABLE KEYS */;


--
-- Definition of table "debgen_users"
--

DROP TABLE IF EXISTS "debgen_users";
CREATE TABLE "debgen_users" (
  "id" bigint(20) NOT NULL AUTO_INCREMENT,
  "activeUser" bit(1) NOT NULL,
  "dataRecorder" bit(1) NOT NULL,
  "email" varchar(255) DEFAULT NULL,
  "fullName" varchar(255) DEFAULT NULL,
  "hashedPassword" varchar(255) DEFAULT NULL,
  "lastLogin" datetime DEFAULT NULL,
  "mustChangePass" bit(1) NOT NULL,
  "researcher" bit(1) NOT NULL,
  "userAdministrator" bit(1) NOT NULL,
  "userName" varchar(255) DEFAULT NULL,
  "languageCode" varchar(5) DEFAULT 'EN',
  PRIMARY KEY ("id"),
  UNIQUE KEY "email" ("email"),
  UNIQUE KEY "userName" ("userName")
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

--
-- Dumping data for table "debgen_users"
--

/*!40000 ALTER TABLE "debgen_users" DISABLE KEYS */;
/*!40000 ALTER TABLE "debgen_users" ENABLE KEYS */;


--
-- Definition of table "emptytable"
--

DROP TABLE IF EXISTS "emptytable";
CREATE TABLE "emptytable" (
  "none" varchar(10) NOT NULL DEFAULT '',
  PRIMARY KEY ("none")
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table "emptytable"
--

/*!40000 ALTER TABLE "emptytable" DISABLE KEYS */;
/*!40000 ALTER TABLE "emptytable" ENABLE KEYS */;




/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
