-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Feb 13, 2021 at 12:32 AM
-- Server version: 8.0.21
-- PHP Version: 7.4.9

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

--
-- Database: `skinexam_v1`
--

-- --------------------------------------------------------

--
-- Table structure for table `airesponse`
--

CREATE TABLE `airesponse` (
  `CaseId` int NOT NULL,
  `Response` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `answers`
--

CREATE TABLE `answers` (
  `DiseaseId` int NOT NULL,
  `Description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `Possible` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `NonPrescription` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `Prescription` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `ThingsToDo` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `ThingsNotToDo` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `bodyparts`
--

CREATE TABLE `bodyparts` (
  `BPartId` int NOT NULL,
  `BPartName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `cases`
--

CREATE TABLE `cases` (
  `CaseId` int NOT NULL,
  `UserId` int NOT NULL,
  `DrId` int DEFAULT NULL,
  `Title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `Description` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `BPartId` int NOT NULL,
  `Notified` tinyint(1) DEFAULT '0',
  `Answered` tinyint(1) DEFAULT '0',
  `Answer` int DEFAULT NULL,
  `DateSubmitted` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `DateAnswered` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `DateViewed` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `category`
--

CREATE TABLE `category` (
  `CategoryId` int NOT NULL,
  `CategoryName` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `diseasecategory`
--

CREATE TABLE `diseasecategory` (
  `CategoryId` int NOT NULL,
  `DiseaseId` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `diseases`
--

CREATE TABLE `diseases` (
  `DiseaseId` int NOT NULL,
  `DiseaseName` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `drinfo`
--

CREATE TABLE `drinfo` (
  `DrId` int NOT NULL,
  `FName` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `LName` varchar(22) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `MedSchoolName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `YearGrad` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `PaypalInfo` varchar(42) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `DateSignedUp` date NOT NULL,
  `LastSignIn` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `HowNotify` smallint DEFAULT '0',
  `Active` tinyint(1) DEFAULT '1',
  `CasesAnswerd` int DEFAULT '0',
  `CasesSkipped` int DEFAULT '0',
  `AmtPaid` double DEFAULT '0',
  `ToBePaid` double DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `drlog`
--

CREATE TABLE `drlog` (
  `DrLogId` int NOT NULL,
  `DrId` int NOT NULL,
  `LogInDate` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `drlogin`
--

CREATE TABLE `drlogin` (
  `DrId` int NOT NULL,
  `Email` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `HashValue` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `CreationDate` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `ModifiedDate` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `drpayhistory`
--

CREATE TABLE `drpayhistory` (
  `DrId` int NOT NULL,
  `Amount` double NOT NULL,
  `DateSent` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `PaypalEmail` varchar(42) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `drtoken`
--

CREATE TABLE `drtoken` (
  `DrId` int NOT NULL,
  `Token` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `CrDate` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `ExpDate` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `howtonotify`
--

CREATE TABLE `howtonotify` (
  `HowNotifyId` int NOT NULL,
  `MethodName` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `links`
--

CREATE TABLE `links` (
  `LinkId` int NOT NULL,
  `LinkDescription` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Link` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `CreationDate` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `ModifiedDate` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `pictures`
--

CREATE TABLE `pictures` (
  `PictureId` int NOT NULL,
  `CaseId` int DEFAULT NULL,
  `Picture` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `subscriptioncodes`
--

CREATE TABLE `subscriptioncodes` (
  `SCId` int NOT NULL,
  `SubLocation` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `userinfo`
--

CREATE TABLE `userinfo` (
  `UserId` int NOT NULL,
  `FName` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `LName` varchar(22) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `City` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `LocationLong` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `LocationLat` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `DOB` date NOT NULL,
  `Gender` varchar(6) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `SubscriptionType` int DEFAULT '0',
  `DateSignedUp` date NOT NULL,
  `LastSignIn` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `Active` tinyint(1) DEFAULT '1',
  `HowNotifyId` int DEFAULT '0',
  `TotalCases` int DEFAULT '0',
  `CasesAnswerd` int DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `userlog`
--

CREATE TABLE `userlog` (
  `UserLogId` int NOT NULL,
  `UserId` int NOT NULL,
  `LogInDate` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `userlogin`
--

CREATE TABLE `userlogin` (
  `UserId` int NOT NULL,
  `Email` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `HashValue` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `usersubscription`
--

CREATE TABLE `usersubscription` (
  `UserId` int NOT NULL,
  `StartDate` date NOT NULL,
  `EndDate` date DEFAULT NULL,
  `Token` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `usertoken`
--

CREATE TABLE `usertoken` (
  `UserId` int NOT NULL,
  `Token` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `CrDate` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `ExDate` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `airesponse`
--
ALTER TABLE `airesponse`
  ADD PRIMARY KEY (`CaseId`);

--
-- Indexes for table `answers`
--
ALTER TABLE `answers`
  ADD PRIMARY KEY (`DiseaseId`);

--
-- Indexes for table `bodyparts`
--
ALTER TABLE `bodyparts`
  ADD PRIMARY KEY (`BPartId`),
  ADD UNIQUE KEY `BPartName` (`BPartName`);

--
-- Indexes for table `cases`
--
ALTER TABLE `cases`
  ADD PRIMARY KEY (`CaseId`);

--
-- Indexes for table `category`
--
ALTER TABLE `category`
  ADD PRIMARY KEY (`CategoryId`),
  ADD UNIQUE KEY `CategoryName` (`CategoryName`);

--
-- Indexes for table `diseasecategory`
--
ALTER TABLE `diseasecategory`
  ADD PRIMARY KEY (`CategoryId`,`DiseaseId`);

--
-- Indexes for table `diseases`
--
ALTER TABLE `diseases`
  ADD PRIMARY KEY (`DiseaseId`),
  ADD UNIQUE KEY `DiseaseName` (`DiseaseName`);

--
-- Indexes for table `drinfo`
--
ALTER TABLE `drinfo`
  ADD PRIMARY KEY (`DrId`);

--
-- Indexes for table `drlog`
--
ALTER TABLE `drlog`
  ADD PRIMARY KEY (`DrLogId`);

--
-- Indexes for table `drlogin`
--
ALTER TABLE `drlogin`
  ADD PRIMARY KEY (`DrId`),
  ADD UNIQUE KEY `Email` (`Email`);

--
-- Indexes for table `drpayhistory`
--
ALTER TABLE `drpayhistory`
  ADD PRIMARY KEY (`DrId`);

--
-- Indexes for table `drtoken`
--
ALTER TABLE `drtoken`
  ADD PRIMARY KEY (`DrId`);

--
-- Indexes for table `howtonotify`
--
ALTER TABLE `howtonotify`
  ADD PRIMARY KEY (`HowNotifyId`);

--
-- Indexes for table `links`
--
ALTER TABLE `links`
  ADD PRIMARY KEY (`LinkId`);

--
-- Indexes for table `pictures`
--
ALTER TABLE `pictures`
  ADD PRIMARY KEY (`PictureId`);

--
-- Indexes for table `subscriptioncodes`
--
ALTER TABLE `subscriptioncodes`
  ADD PRIMARY KEY (`SCId`);

--
-- Indexes for table `userinfo`
--
ALTER TABLE `userinfo`
  ADD PRIMARY KEY (`UserId`);

--
-- Indexes for table `userlog`
--
ALTER TABLE `userlog`
  ADD PRIMARY KEY (`UserLogId`);

--
-- Indexes for table `userlogin`
--
ALTER TABLE `userlogin`
  ADD PRIMARY KEY (`UserId`),
  ADD UNIQUE KEY `Email` (`Email`);

--
-- Indexes for table `usersubscription`
--
ALTER TABLE `usersubscription`
  ADD PRIMARY KEY (`UserId`);

--
-- Indexes for table `usertoken`
--
ALTER TABLE `usertoken`
  ADD PRIMARY KEY (`UserId`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `bodyparts`
--
ALTER TABLE `bodyparts`
  MODIFY `BPartId` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `cases`
--
ALTER TABLE `cases`
  MODIFY `CaseId` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `category`
--
ALTER TABLE `category`
  MODIFY `CategoryId` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `diseases`
--
ALTER TABLE `diseases`
  MODIFY `DiseaseId` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `drlog`
--
ALTER TABLE `drlog`
  MODIFY `DrLogId` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `drlogin`
--
ALTER TABLE `drlogin`
  MODIFY `DrId` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `howtonotify`
--
ALTER TABLE `howtonotify`
  MODIFY `HowNotifyId` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `links`
--
ALTER TABLE `links`
  MODIFY `LinkId` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `pictures`
--
ALTER TABLE `pictures`
  MODIFY `PictureId` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `subscriptioncodes`
--
ALTER TABLE `subscriptioncodes`
  MODIFY `SCId` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `userlog`
--
ALTER TABLE `userlog`
  MODIFY `UserLogId` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `userlogin`
--
ALTER TABLE `userlogin`
  MODIFY `UserId` int 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 */;
