-- http://www.phpmyadmin.net
--




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

--
-- Table structure for table `challenges`
--

CREATE TABLE `challenges` (
  `id` int(10) UNSIGNED NOT NULL,
  `challengeType` varchar(255) DEFAULT NULL,
  `timeLeftToSubscribe` varchar(255) DEFAULT NULL,
  `locationName` varchar(255) DEFAULT NULL,
  `tooltipText` varchar(255) DEFAULT NULL,
  `pearlsReward` float DEFAULT NULL,
  `pearlsRequiredToSubscribe` float DEFAULT NULL,
  `latitude` varchar(255) DEFAULT NULL,
  `longitude` varchar(255) DEFAULT NULL,
  `locationPriority` varchar(255) DEFAULT NULL,
  `locationItem` varchar(255) DEFAULT NULL,
  `timeRequired` varchar(255) DEFAULT NULL,
  `pearlsRequiredToIncreaseTime` varchar(255) DEFAULT NULL,
  `timeRequiredToSolveThePuzzle` varchar(255) DEFAULT NULL,
  `puzzleAns` varchar(255) DEFAULT NULL,
  `startAt` varchar(255) DEFAULT NULL,
  `endAt` varchar(255) DEFAULT NULL,
  `createdAt` datetime DEFAULT NULL,
  `updatedAt` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `challenges`
--

INSERT INTO `challenges` (`id`, `challengeType`, `timeLeftToSubscribe`, `locationName`, `tooltipText`, `pearlsReward`, `pearlsRequiredToSubscribe`, `latitude`, `longitude`, `locationPriority`, `locationItem`, `timeRequired`, `pearlsRequiredToIncreaseTime`, `timeRequiredToSolveThePuzzle`, `puzzleAns`, `startAt`, `endAt`, `createdAt`, `updatedAt`) VALUES
(1, '2', NULL, NULL, NULL, NULL, 11, '+40.689060', '-74.044636', NULL, NULL, NULL, NULL, NULL, '123', '1405903889', '1605903889', NULL, NULL);

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

--
-- Table structure for table `locations`
--

CREATE TABLE `locations` (
  `id` int(10) UNSIGNED NOT NULL,
  `challengeId` varchar(255) DEFAULT NULL,
  `locationName` varchar(255) DEFAULT NULL,
  `latitude` varchar(255) DEFAULT NULL,
  `longitude` varchar(255) DEFAULT NULL,
  `locationItem` varchar(255) DEFAULT NULL,
  `locationPriority` varchar(255) DEFAULT NULL,
  `timeRequired` varchar(255) DEFAULT NULL,
  `createdAt` datetime DEFAULT NULL,
  `updatedAt` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `locations`
--

INSERT INTO `locations` (`id`, `challengeId`, `locationName`, `latitude`, `longitude`, `locationItem`, `locationPriority`, `timeRequired`, `createdAt`, `updatedAt`) VALUES
(1, '1', 'New name', '43', '55', 'vvv', '1', NULL, NULL, NULL);

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

--
-- Table structure for table `purchaseitems`
--

CREATE TABLE `purchaseitems` (
  `id` int(10) UNSIGNED NOT NULL,
  `productID` varchar(255) DEFAULT NULL,
  `price` varchar(255) DEFAULT NULL,
  `apply` varchar(255) DEFAULT NULL,
  `user_id` varchar(255) DEFAULT NULL,
  `createdAt` datetime DEFAULT NULL,
  `updatedAt` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `purchase_items`
--

CREATE TABLE `purchase_items` (
  `id` int(11) NOT NULL,
  `productID` int(11) NOT NULL,
  `price` varchar(500) NOT NULL,
  `apply` varchar(500) NOT NULL,
  `user_id` int(11) NOT NULL,
  `createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedAt` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `userchallenges`
--

CREATE TABLE `userchallenges` (
  `id` int(10) UNSIGNED NOT NULL,
  `challengeId` varchar(255) DEFAULT NULL,
  `userId` varchar(255) DEFAULT NULL,
  `timeTaken` varchar(255) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `startTime` varchar(255) DEFAULT NULL,
  `createdAt` datetime DEFAULT NULL,
  `updatedAt` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `userchallenges`
--

INSERT INTO `userchallenges` (`id`, `challengeId`, `userId`, `timeTaken`, `status`, `startTime`, `createdAt`, `updatedAt`) VALUES
(1, '1', '1', NULL, '2', '1505370176033', '2017-09-14 11:23:00', '2017-09-20 15:38:20');

--
-- Indexes for table `challenges`
--
ALTER TABLE `challenges`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `locations`
--
ALTER TABLE `locations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `purchaseitems`
--
ALTER TABLE `purchaseitems`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `purchase_items`
--
ALTER TABLE `purchase_items`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `id` (`id`);

--
-- Indexes for table `userchallenges`
--
ALTER TABLE `userchallenges`
  ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for table `challenges`
--
ALTER TABLE `challenges`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `locations`
--
ALTER TABLE `locations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `purchaseitems`
--
ALTER TABLE `purchaseitems`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `purchase_items`
--
ALTER TABLE `purchase_items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `userchallenges`
--
ALTER TABLE `userchallenges`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
