
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";

/*!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 utf8mb4 */;


CREATE TABLE `relatorio` (
  `id` int(11) NOT NULL,
  `email` varchar(64) DEFAULT NULL,
  `rawData` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '(DC2Type:json)' CHECK (json_valid(`rawData`)),
  `ageGroup` varchar(6) NOT NULL,
  `gender` varchar(1) DEFAULT NULL,
  `howPersonFeels` varchar(8) NOT NULL,
  `isPregnant` tinyint(1) DEFAULT NULL,
  `diagnosedDiseasesCount` int(11) NOT NULL,
  `isInMenopause` tinyint(1) DEFAULT NULL,
  `healthConcernsCount` int(11) NOT NULL,
  `familyHistoryHeartProblems` tinyint(1) NOT NULL,
  `familyHistoryOncologicalProblems` tinyint(1) NOT NULL,
  `familyHistoryNeurologicalProblems` tinyint(1) NOT NULL,
  `weight` int(11) DEFAULT NULL,
  `height` double DEFAULT NULL,
  `bodyMassIndex` double DEFAULT NULL,
  `bodyFatConcentration` varchar(14) NOT NULL,
  `diseases` tinytext DEFAULT NULL COMMENT '(DC2Type:simple_array)',
  `healthConcerns` tinytext DEFAULT NULL COMMENT '(DC2Type:simple_array)',
  `foodHabitsSelfEvaluation` varchar(15) NOT NULL,
  `exerciceFrequency` varchar(11) NOT NULL,
  `alcoholConsumptionFrequency` varchar(20) NOT NULL,
  `smokesOrUsedToSmoke` varchar(20) NOT NULL,
  `cigarettesPerDay` int(11) DEFAULT NULL,
  `yearsWhileSmoking` int(11) DEFAULT NULL,
  `yearsSinceSmoking` double DEFAULT NULL,
  `sleepQuality` varchar(15) NOT NULL,
  `responseToStress` varchar(9) NOT NULL,
  `monitorsHealthParametersWithApp` tinyint(1) NOT NULL,
  `healthImprovements` tinytext DEFAULT NULL COMMENT '(DC2Type:simple_array)',
  `doctorVisits` varchar(16) NOT NULL,
  `dentistVisits` varchar(14) NOT NULL,
  `specialtyDoctor` varchar(13) DEFAULT NULL,
  `emailWasSent` tinyint(1) DEFAULT NULL,
  `publicId` varchar(255) NOT NULL,
  `otherDisease` varchar(64) DEFAULT NULL,
  `otherHealthConcern` varchar(64) DEFAULT NULL,
  `createdAt` datetime DEFAULT NULL,
  `updatedAt` datetime DEFAULT NULL,
  `language` varchar(5) NOT NULL,
  `wasSubmittedToLuzApi` tinyint(1) NOT NULL,
  `submittedToLuzApiAt` datetime DEFAULT NULL,
  `reportVersion` varchar(12) DEFAULT NULL,
  `acceptedMarketing` tinyint(1) NOT NULL,
  `otherLanguagePdfs` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '(DC2Type:json)' CHECK (json_valid(`otherLanguagePdfs`)),
  `externalId` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;


ALTER TABLE `relatorio`
  ADD PRIMARY KEY (`id`);


ALTER TABLE `relatorio`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;

/*!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 */;
