-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `circleSocial`
--

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

--
-- Table structure for table `adminDetail`
--

CREATE TABLE `adminDetail` (
  `id` int(11) NOT NULL,
  `userId` int(11) NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `image` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created` int(11) NOT NULL,
  `updated` int(11) NOT NULL,
  `createdAt` timestamp NOT NULL DEFAULT current_timestamp(),
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `adminDetail`
--

INSERT INTO `adminDetail` (`id`, `userId`, `name`, `image`, `created`, `updated`, `createdAt`, `updatedAt`) VALUES
(1, 1, 'Admin', 'ff152997-2bec-4e99-a31b-4e8930b5cfc3.jpeg', 0, 1654762671, '2022-05-01 16:55:27', '2022-06-09 08:17:50');

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

--
-- Table structure for table `notification`
--

CREATE TABLE `notification` (
  `id` int(11) NOT NULL,
  `type` tinyint(4) NOT NULL,
  `byUserId` int(11) NOT NULL,
  `toUserId` int(11) NOT NULL,
  `challengeId` int(11) NOT NULL,
  `text` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `notificationData` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `isRead` tinyint(4) NOT NULL COMMENT '0=>not_read, 1=>read',
  `createdAt` timestamp NOT NULL DEFAULT current_timestamp(),
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `page`
--

CREATE TABLE `page` (
  `id` int(11) NOT NULL,
  `accessor` varchar(100) NOT NULL,
  `title` varchar(255) NOT NULL,
  `content` text NOT NULL,
  `created` int(11) NOT NULL,
  `updated` int(11) NOT NULL,
  `createdAt` timestamp NOT NULL DEFAULT current_timestamp(),
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `page`
--

INSERT INTO `page` (`id`, `accessor`, `title`, `content`, `created`, `updated`, `createdAt`, `updatedAt`) VALUES
(1, 'aboutUs', 'About Us', '<p><strong>About Us&nbsp;</strong></p>\n<p></p>', 1591716283, 1600680855, '2020-03-23 15:32:10', '2020-09-21 09:34:15'),
(2, 'termsAndConditions', 'Terms & Conditions', '<p><b><span style=\"font-size: 36px;\">Terms And&nbsp; Conditions</span> </b></p><p><br></p><p>Terms and Conditions</p><p><br></p><p><br></p>\n<p></p>\n<p></p>\n<p></p>', 1591716283, 1629263437, '2020-03-23 15:32:39', '2021-08-18 05:10:37'),
(3, 'privacyPolicy', 'Privacy Policy', '<p><strong>Privacy Policy</strong></p>\n<p></p>\n<p>content goes here..</p>', 1591716283, 1651427838, '2020-03-23 15:33:04', '2022-05-01 17:57:18');

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

--
-- Table structure for table `setting`
--

CREATE TABLE `setting` (
  `id` int(11) NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `comment` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created` int(11) NOT NULL,
  `updated` int(11) NOT NULL,
  `createdAt` timestamp NOT NULL DEFAULT current_timestamp(),
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `setting`
--

INSERT INTO `setting` (`id`, `name`, `value`, `comment`, `created`, `updated`, `createdAt`, `updatedAt`) VALUES
(1, 'notification_email', 'test@gmail.com', 'email for notification and updates', 1592274435, 1592274435, '2020-06-16 02:27:15', '2022-09-22 05:38:25');

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

--
-- Table structure for table `userDetail`
--

CREATE TABLE `userDetail` (
  `id` int(11) NOT NULL,
  `userId` int(11) NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `image` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `latitude` decimal(10,8) NOT NULL,
  `longitude` decimal(11,8) NOT NULL,
  `location` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `city` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `howHearAboutUs` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `stepsCompleted` tinyint(4) NOT NULL COMMENT '1=>signup, 2=>initializeProfile',
  `created` int(11) NOT NULL,
  `updated` int(11) NOT NULL,
  `createdAt` timestamp NOT NULL DEFAULT current_timestamp(),
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `userDetail`
--

INSERT INTO `userDetail` (`id`, `userId`, `name`, `image`, `latitude`, `longitude`, `location`, `city`, `howHearAboutUs`, `stepsCompleted`, `created`, `updated`, `createdAt`, `updatedAt`) VALUES
(3, 4, 'carl max', '5408cd6f-1ae6-48c2-bae0-2e828decb363.jpeg', '30.01241251', '76.09351315', 'Mohali', 'Los Angeles', 'Friend', 1, 1663828392, 1663828723, '2022-09-22 06:33:11', '2022-09-22 06:38:42');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `adminDetail`
--
ALTER TABLE `adminDetail`
  ADD PRIMARY KEY (`id`),
  ADD KEY `adminDetail_userId_foreign_idx` (`userId`);

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

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

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

--
-- Indexes for table `userDetail`
--
ALTER TABLE `userDetail`
  ADD PRIMARY KEY (`id`),
  ADD KEY `cascade_delete_user_detail_user_idx` (`userId`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `adminDetail`
--
ALTER TABLE `adminDetail`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `notification`
--
ALTER TABLE `notification`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `page`
--
ALTER TABLE `page`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `setting`
--
ALTER TABLE `setting`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

--
-- AUTO_INCREMENT for table `userDetail`
--
ALTER TABLE `userDetail`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `adminDetail`
--
ALTER TABLE `adminDetail`
  ADD CONSTRAINT `adminDetail_userId_foreign_idx` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `userDetail`
--
ALTER TABLE `userDetail`
  ADD CONSTRAINT `cascade_delete_user_detail_user_idx` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;

