-- phpMyAdmin SQL Dump
-- version 4.9.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Nov 17, 2021 at 04:49 PM
-- Server version: 10.2.41-MariaDB
-- PHP Version: 7.3.32

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
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: `hardhita_thhpdb`
--

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

--
-- Table structure for table `articles`
--

CREATE TABLE `articles` (
  `ARTICLE_ID` varchar(20) NOT NULL,
  `TITLE` varchar(255) NOT NULL,
  `PROFILE_ID_PUBLISHER` varchar(20) NOT NULL,
  `CATEGORY_ID` varchar(20) NOT NULL,
  `PROFILE_ID_MENTOR` varchar(20) DEFAULT NULL,
  `CONTENT` text NOT NULL,
  `TAGS` varchar(500) NOT NULL,
  `EXTRACT` varchar(1000) NOT NULL,
  `RATING_OVERALL` decimal(10,0) DEFAULT NULL,
  `ARTICLE_STATUS` enum('PUBLISHED','NEW','ASSIGNED','REVISION','ARCHIVED') NOT NULL DEFAULT 'NEW',
  `PUBLISHED_DATE` datetime DEFAULT current_timestamp(),
  `MEDIA_PATH` text DEFAULT NULL,
  `ARTICLE_VIEWS` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `articles`
--

INSERT INTO `articles` (`ARTICLE_ID`, `TITLE`, `PROFILE_ID_PUBLISHER`, `CATEGORY_ID`, `PROFILE_ID_MENTOR`, `CONTENT`, `TAGS`, `EXTRACT`, `RATING_OVERALL`, `ARTICLE_STATUS`, `PUBLISHED_DATE`, `MEDIA_PATH`, `ARTICLE_VIEWS`) VALUES
('AR617ff72fb53f1', 'Cement imports rocket by 51%', 'US617f73a118f25', 'CT617ff581bd9fa', NULL, '<p>Cement imports increased by 51% to 749 671 tons with a free on board (FOB) value of R445 million in the first eight months of this year compared to the same period in 2020, but that was when Covid-19 lockdown restrictions hampered imports.</p><p>However, cement imports during this eight-month period were also 3% higher than for the same pre-Covid period in 2019.</p><p>Elsie Snyman, CEO of construction market intelligence firm Industry Insight, said 1 256 984 tons of cement were imported into South Africa over the last 12 months and imports are well on track to reach the peak of early 2015 when more than 1.4 million tons were imported over the 12-month period up to February 2015.</p><p>However, Snyman said the designation of cement, which bans the use of imported cement on public sector projects, will have a major impact on suppliers of imported cement.</p>', 'Cement, Infrastructure, South Africa', 'Sa cement imports were hampered by lockdown restrictions in 2020 – but the ban on their use on public sector projects from november 4 is expected to have major impact.', NULL, 'PUBLISHED', '2021-11-01 14:18:23', '', NULL),
('AR618003bc95601', 'Recommendation by moosa mahomed', 'US617fc04387a1d', 'CT617ff4fa6740e', NULL, '<p>I am professionally registered as a Construction Project Manager (with the South African Council for the Project and Construction Management Profession), Chartered Project Management Surveyor (with Royal Institute of Chartered Surveyors), Chartered Building Surveyor (with the South African Council for Architect Profession), and a member of Project Management South Africa.&nbsp;</p><ul><li>I enjoy the relationship of Safety and Leadership, the book further simply articulate cold hard facts which we often miss.&nbsp;</li><li>Open my eyes to &quot;unknown knows&quot; about safety and leadership.</li><li>Safety applies everywhere not just at work and home.</li><li>To make a difference, as the book puts it &quot;A short story with Big Lessons for Home and Work&quot;. The book has certainly achieved its mark and more as it wisely provides leadership and safety insights.</li></ul>', 'Labels, Bookshelf', 'Moosa mahomed a health and safety professional tells us about his recommendation for the hardhatbookshelf that taught him how to recognize when he is his own worst enemy.', NULL, 'PUBLISHED', '2021-11-01 15:11:56', '', NULL),
('AR6180040bb955c', 'What is the difference between various engineering degrees?', 'US617fc04387a1d', 'CT617ff53c6688c', NULL, '<p>The biggest separator between the three degrees is in my view the reliance on practical, technical and theoretical content in the curriculum of each. The difference between BSc and BEng is its viewpoint. Bachelor of Science includes mainly science subjects that are more general, while BEng covers subjects that are more centered around engineering. Also, BSc is more theoretical based, while BEng is more practical based.&nbsp;</p><ul><li><p>To elaborate a little bit more on this, B. Tech deals with the in-depth&nbsp;practicality of the concepts of engineering and has more technical aspects in the curriculum. BEng is a bit more theoretical and more emphasis is given to the theoretical concepts rather than practical knowledge.&nbsp;</p><p>&nbsp;</p><p>Both BTech and BEng are of 4 years duration. BSc is 3 years duration and dives into the depth of theoretical concepts. Where the content of the courses of BTech and BEng are designed specifically for engineering students, BSc curriculum is more general. BSc can be considered to be the non-technical side of the technical concepts of engineering.</p></li></ul>', 'CareerTips, engineering, Mycareertip', 'Nester mokhojane a built environment professional who is in both academia and consulting shares my careertips  with herve-noel kimpwene a btech structural engineering graduate who made an observation', NULL, 'PUBLISHED', '2021-11-01 15:13:15', '', NULL),
('AR6180f444d18d3', 'Becoming a civil engineer', 'US6180f26fe7af1', 'CT617ff53c6688c', NULL, '<p>You need to get a degree at an accredited institution, do internships and lastly land a real job</p>', 'Civil engineer, career', '\"with a little a patience you  can get here too\"', NULL, 'REVISION', '2021-11-02 08:18:12', '', NULL),
('AR618f6a07c38ec', 'Title of my article', 'US617fc04387a1d', 'CT617ff53c6688c', NULL, '<p>my content is not big at all</p>', 'To test', 'This article is about testing', NULL, 'ASSIGNED', '2021-11-13 07:32:23', '', NULL);

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

--
-- Table structure for table `article_reactions`
--

CREATE TABLE `article_reactions` (
  `ARTICLE_REACTION_ID` varchar(20) NOT NULL,
  `ARTICLE_ID` varchar(20) NOT NULL,
  `REACTION_ID` varchar(20) NOT NULL,
  `PROFILE_ID` varchar(20) NOT NULL,
  `REACTION_DATE` datetime NOT NULL DEFAULT current_timestamp(),
  `REACTION_STATUS` enum('HIDDEN','ARCHIVED','ACTIVE','') NOT NULL DEFAULT 'ACTIVE'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `article_reactions`
--

INSERT INTO `article_reactions` (`ARTICLE_REACTION_ID`, `ARTICLE_ID`, `REACTION_ID`, `PROFILE_ID`, `REACTION_DATE`, `REACTION_STATUS`) VALUES
('AT6193fa787def3', 'AR6180040bb955c', 'Rt617fe9393a88f', 'US617fc04387a1d', '2021-11-16 20:37:44', 'ACTIVE'),
('AT6194a8433a58b', 'AR618003bc95601', 'Rt617fe9b24663a', 'US617fc04387a1d', '2021-11-17 08:59:15', 'ACTIVE'),
('AT6194ac915459a', 'AR6180040bb955c', 'Rt617fe8d6732fd', 'US617fcb3a0ad33', '2021-11-17 09:17:37', 'ACTIVE');

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

--
-- Table structure for table `badges`
--

CREATE TABLE `badges` (
  `BADGE_ID` varchar(20) NOT NULL,
  `BADGE_NAME` varchar(25) NOT NULL,
  `BADGE_DESCRIPTION` text DEFAULT NULL,
  `BADGE_STATUS` enum('ACTIVE','ARCHIVED') NOT NULL DEFAULT 'ACTIVE',
  `BADGE_IMAGE` text DEFAULT NULL,
  `BADGE_DATE` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `badges`
--

INSERT INTO `badges` (`BADGE_ID`, `BADGE_NAME`, `BADGE_DESCRIPTION`, `BADGE_STATUS`, `BADGE_IMAGE`, `BADGE_DATE`) VALUES
('BG619109725fae4', 'Ordinary', 'The entry level badge', 'ACTIVE', 'BG619109725fae4.jpeg', '2021-11-14 13:04:50');

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

--
-- Table structure for table `badge_assignments`
--

CREATE TABLE `badge_assignments` (
  `BADGE_ASSIGNMENT_ID` varchar(20) NOT NULL,
  `BADGE_ID` varchar(20) NOT NULL,
  `PROFILE_ID` varchar(20) NOT NULL,
  `BADGE_ASSIGNMENT_DATE` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `categories`
--

CREATE TABLE `categories` (
  `CATEGORY_ID` varchar(20) NOT NULL,
  `CATEGORY_NAME` varchar(40) NOT NULL,
  `CATEGORY_DESCRIPTION` text DEFAULT NULL,
  `CATEGORY_STATUS` enum('ACTIVE','ARCHIVED') NOT NULL DEFAULT 'ACTIVE',
  `MEDIA_PATH` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `categories`
--

INSERT INTO `categories` (`CATEGORY_ID`, `CATEGORY_NAME`, `CATEGORY_DESCRIPTION`, `CATEGORY_STATUS`, `MEDIA_PATH`) VALUES
('CT617ff4fa6740e', 'Bookshelf', 'To share relevant book titles that would assist Hardhat Professionals navigate to their careers', 'ACTIVE', 'CT617ff4fa6740e.jpeg'),
('CT617ff53c6688c', 'CareerTips', 'To share tips on how to create a successful career in the Construction and Built Environment Industry', 'ACTIVE', 'CT617ff53c6688c.jpeg'),
('CT617ff581bd9fa', 'News', 'For industry related news', 'ACTIVE', 'CT617ff581bd9fa.jpeg'),
('CT6180f67cbe861', 'Opinion', 'Description for category', 'ACTIVE', 'CT6180f67cbe861.jpeg');

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

--
-- Table structure for table `comments`
--

CREATE TABLE `comments` (
  `COMMENT_ID` varchar(20) NOT NULL,
  `ARTICLE_ID` varchar(20) NOT NULL,
  `PROFILE_ID` varchar(20) NOT NULL,
  `COMMENT_CONTENT` text NOT NULL,
  `COMMENT_DATE` datetime NOT NULL DEFAULT current_timestamp(),
  `COMMENT_STATUS` enum('HIDDEN','ACTIVE','ACHIVED','') DEFAULT 'ACTIVE'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `comments`
--

INSERT INTO `comments` (`COMMENT_ID`, `ARTICLE_ID`, `PROFILE_ID`, `COMMENT_CONTENT`, `COMMENT_DATE`, `COMMENT_STATUS`) VALUES
('CM6180078c31680', 'AR6180040bb955c', 'US617fc04387a1d', 'LHi, thank you for this wonderful recommendation...surly will check this book out', '2021-11-01 15:28:12', 'ACTIVE'),
('CM61800807aab3a', 'AR6180040bb955c', 'US617fc04387a1d', 'Nice one!!', '2021-11-01 15:30:15', 'ACTIVE'),
('CM6180089dc22d1', 'AR6180040bb955c', 'US617fc04387a1d', 'Very great', '2021-11-01 15:32:45', 'ACTIVE'),
('CM6180f48d0a03b', 'AR6180f444d18d3', 'US6180f26fe7af1', 'This article is very informative', '2021-11-02 08:19:25', 'ACTIVE'),
('CM618f921ab5050', 'AR6180040bb955c', 'US617fcb3a0ad33', 'Good article', '2021-11-13 10:23:22', 'ACTIVE'),
('CM618fe24199583', 'AR6180040bb955c', 'US617fcb3a0ad33', 'Draw your own company or where you want', '2021-11-13 16:05:21', 'ACTIVE'),
('CM618fe2abc7b88', 'AR6180040bb955c', 'US617fcb3a0ad33', 'Draw your attention', '2021-11-13 16:07:07', 'ACTIVE'),
('CM619149a3a10e8', 'AR6180040bb955c', 'US617fcb3a0ad33', 'Draw your attention', '2021-11-14 17:38:43', 'ACTIVE'),
('CM6193771f4d16b', 'AR6180040bb955c', 'US617fcb3a0ad33', 'We shall overcome', '2021-11-16 11:17:19', 'ACTIVE'),
('CM6194ed779b5b4', 'AR6180040bb955c', 'US617fc04387a1d', 'Eza normal tse', '2021-11-17 13:54:31', 'ACTIVE');

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

--
-- Table structure for table `contacts`
--

CREATE TABLE `contacts` (
  `CONTACT_ID` varchar(20) NOT NULL,
  `CONTACT_FIRSTNAME` varchar(255) NOT NULL,
  `CONTACT_LASTNAME` varchar(255) DEFAULT NULL,
  `CONTACT_EMAIL` varchar(320) NOT NULL,
  `CONTACT_MESSAGE` text NOT NULL,
  `CONTACT_REPLY` text DEFAULT NULL,
  `CONTACT_DATE` datetime NOT NULL DEFAULT current_timestamp(),
  `CONTACT_STATUS` enum('NEW','PENDING','RESPONDED','ARCHIVED') DEFAULT 'NEW'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `contacts`
--

INSERT INTO `contacts` (`CONTACT_ID`, `CONTACT_FIRSTNAME`, `CONTACT_LASTNAME`, `CONTACT_EMAIL`, `CONTACT_MESSAGE`, `CONTACT_REPLY`, `CONTACT_DATE`, `CONTACT_STATUS`) VALUES
('CT6183dd15316b2', 'Elodie', 'Ngoie', 'ngoie.mutombo.elodie@gmail.com', 'Hello testing contact', NULL, '2021-11-04 13:16:05', 'NEW'),
('CT61864b705e509', 'Elodie', 'Ngoie', 'ngoie.mutombo.elodie@gmail.com', 'Hello testing contact', NULL, '2021-11-06 09:31:28', 'NEW'),
('CT61867cac66241', 'Ketsya', 'Kabedi', 'ketsyadyk@hotmail.com', 'I love my hair', NULL, '2021-11-06 13:01:32', 'NEW'),
('CT6193ba92f3fd5', 'Ketsya', 'Diyoka', 'ketsyadyk@gmail.com', 'I have difficulties to login. please provide e some assistance', NULL, '2021-11-16 16:05:07', 'NEW'),
('CT6193ca2c5f068', 'Ketsya', 'Diyoka', 'ketsyadyk@gmail.com', 'Help me reset my password', NULL, '2021-11-16 17:11:40', 'NEW');

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

--
-- Table structure for table `followings`
--

CREATE TABLE `followings` (
  `FOLLOWING_ID` varchar(20) NOT NULL,
  `PROFILE_ID_FOLLOWER` varchar(20) NOT NULL,
  `PROFILE_ID_FOLLOWING` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `mentorship`
--

CREATE TABLE `mentorship` (
  `MENTORSHIP_ID` varchar(20) NOT NULL,
  `PROFILE_ID_MENTOR` varchar(20) NOT NULL,
  `PROFILE_ID_MENTEE` varchar(20) NOT NULL,
  `MENTORSHIP_DATE` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `ratings`
--

CREATE TABLE `ratings` (
  `RATING_ID` varchar(20) NOT NULL,
  `PROFILE_ID_MODERATOR` varchar(20) NOT NULL,
  `ARTICLE_ID` varchar(20) NOT NULL,
  `GRADE` decimal(10,0) DEFAULT NULL,
  `FEEDBACK` text DEFAULT NULL,
  `ASSIGNMENT_DATE` datetime DEFAULT current_timestamp(),
  `RATING_DATE` datetime DEFAULT NULL,
  `REVIEW_STATUS` enum('ASSIGNED','ACCEPTED','DECLINED','RATED','REVISION') NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `ratings`
--

INSERT INTO `ratings` (`RATING_ID`, `PROFILE_ID_MODERATOR`, `ARTICLE_ID`, `GRADE`, `FEEDBACK`, `ASSIGNMENT_DATE`, `RATING_DATE`, `REVIEW_STATUS`) VALUES
('RM618f6dbd44ecb', 'US6180f26fe7af1', 'AR618f6a07c38ec', NULL, NULL, '2021-11-13 07:48:13', NULL, 'ASSIGNED'),
('RM618f6e5acfd9b', 'US6180f26fe7af1', 'AR618f6a07c38ec', NULL, NULL, '2021-11-13 07:50:50', NULL, 'ASSIGNED'),
('RM6193afb2eb054', 'US6180f26fe7af1', 'AR618f6a07c38ec', NULL, NULL, '2021-11-16 15:18:42', NULL, 'ASSIGNED'),
('RM6193afe70a9db', 'US616993a498f65', 'AR618f6a07c38ec', NULL, NULL, '2021-11-16 15:19:35', NULL, 'ASSIGNED'),
('RM6193b073b4b29', 'US616993a498f65', 'AR6168499522dc1', NULL, NULL, '2021-11-16 15:21:55', NULL, 'ASSIGNED');

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

--
-- Table structure for table `reactions`
--

CREATE TABLE `reactions` (
  `REACTION_ID` varchar(20) NOT NULL,
  `REACTION_NAME` varchar(30) NOT NULL,
  `REACTION_DESCRIPTION` text NOT NULL,
  `REACTION_EMOJI` varchar(30) NOT NULL,
  `REACTION_STATUS` enum('ARCHIVED','ACTIVE','HIDDEN','') NOT NULL DEFAULT 'ACTIVE'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `reactions`
--

INSERT INTO `reactions` (`REACTION_ID`, `REACTION_NAME`, `REACTION_DESCRIPTION`, `REACTION_EMOJI`, `REACTION_STATUS`) VALUES
('RT6161f5c6793a8', 'Applaud', 'This reaction is suitable when a user is satisfied and admires the opinion that an article or forum thread is treating', 'U+1F44D', 'ARCHIVED'),
('RT616a867f56566', 'Agree', 'A reaction of disagreement that one may have regarding an article or a thread.', '', 'ARCHIVED'),
('RT6176d18961797', 'Love', 'Love', 'U+1F970', 'ARCHIVED'),
('RT617fe8d6732fd', 'Agreeing', 'This reaction may be used on an article by users when they are in agreement with whatever the article is about.', '1F44D', 'ACTIVE'),
('RT617fe9393a88f', 'Disagree', 'This reaction is used when by users that disagree with the opinion stated in the article.', '1F44E', 'ACTIVE'),
('RT617fe9b24663a', 'Applaud', 'This reaction is used to admire the article and shows as well agreement with what the article is about.', '1F44F', 'ACTIVE');

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

--
-- Table structure for table `roles`
--

CREATE TABLE `roles` (
  `ROLE_ID` varchar(20) NOT NULL,
  `ROLE_NAME` varchar(25) NOT NULL,
  `ROLE_DESCRIPTION` text NOT NULL,
  `ROLE_STATUS` enum('ACTIVE','ARCHIVED') NOT NULL DEFAULT 'ACTIVE'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` (`ROLE_ID`, `ROLE_NAME`, `ROLE_DESCRIPTION`, `ROLE_STATUS`) VALUES
('RL61605e9121a51', 'Administrator', 'All privileges', 'ACTIVE'),
('RL61660b26d3d86', 'Default', 'This role allows individual who created an account on the platform to log in to access their dashboard and perform a set of functionalities', 'ACTIVE'),
('RL616c67a2d1aff', 'Moderator', 'Special type of user that has been granted to privileges of reviewing and rating other users\' articles before it get published.', 'ARCHIVED'),
('RL616c67e5e4722', 'Mentor', 'Special type of user that has been granted to privileges of assisting and mentoring other users in writing articles before it get submitted for review.', 'ACTIVE'),
('RL617fe77e87138', 'Moderator', 'Moderators will review the new articles to verify whether it has the standard of being published. moderator can as well published articles', 'ACTIVE'),
('RL618d55c74612d', 'Document Agent', 'Test', 'ARCHIVED');

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

--
-- Table structure for table `role_applications`
--

CREATE TABLE `role_applications` (
  `ROLE_APPLICATION_ID` varchar(20) NOT NULL,
  `PROFILE_ID` varchar(20) NOT NULL,
  `ROLE_ID` varchar(20) NOT NULL,
  `CATEGORY_ID` varchar(20) NOT NULL,
  `ROLE_APPLICATION_STATUS` enum('ACCEPTED','DECLINED','PENDING','ARCHIVED') NOT NULL,
  `ROLE_APPLICATION_DATE` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `role_assignments`
--

CREATE TABLE `role_assignments` (
  `ROLE_ASSIGNMENT_ID` varchar(20) NOT NULL,
  `ROLE_ID` varchar(20) NOT NULL,
  `PROFILE_ID` varchar(20) NOT NULL,
  `ROLE_ASSIGNMENT_DATE` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `role_assignments`
--

INSERT INTO `role_assignments` (`ROLE_ASSIGNMENT_ID`, `ROLE_ID`, `PROFILE_ID`, `ROLE_ASSIGNMENT_DATE`) VALUES
('RA616993a88ca62', 'RL61660b26d3d86', 'US616993a498f65', '2021-10-15 16:43:52'),
('RA616c10004d8f8', 'RL616c67e5e4722', 'US616c0ff824ecd', '2021-10-17 13:58:56'),
('RA6178131a0a8b5', 'RL616c67a2d1aff', 'US616993a498f65', '2021-10-26 16:39:22'),
('RA617ef71bdcaa5', 'RL61605e9121a51', 'US617ef71b4b3e0', '2021-10-31 22:05:47'),
('RA617f0f56682cd', 'RL61660b26d3d86', 'US617f0f562797e', '2021-10-31 23:49:10'),
('RA617f73a19a8d7', 'RL61605e9121a51', 'US617f73a118f25', '2021-11-01 06:57:05'),
('RA617fc04409876', 'RL61660b26d3d86', 'US617fc04387a1d', '2021-11-01 12:24:04'),
('RA617fcb3a3f744', 'RL61660b26d3d86', 'US617fcb3a0ad33', '2021-11-01 13:10:50'),
('RA6180f2707d093', 'RL616c67a2d1aff', 'US6180f26fe7af1', '2021-11-02 10:10:24'),
('RA6180fc0ed957d', 'RL61660b26d3d86', 'US6180fc0e63d59', '2021-11-02 10:51:26'),
('RA6180fc0f909bf', 'RL61660b26d3d86', 'US6180fc0f16cdd', '2021-11-02 10:51:27'),
('RA6180fc2043223', 'RL61660b26d3d86', 'US6180fc200e7cf', '2021-11-02 10:51:44'),
('RA6180fca879417', 'RL61660b26d3d86', 'US6180fca8415b6', '2021-11-02 10:54:00'),
('RA618217571ba85', 'RL61660b26d3d86', 'US61821756d147a', '2021-11-03 07:00:07'),
('RA618217a7bfaab', 'RL61660b26d3d86', 'US618217a798fdb', '2021-11-03 07:01:27'),
('RA618647e42e1ea', 'RL61660b26d3d86', 'US618647e3e38aa', '2021-11-06 11:16:20'),
('RA6188fe9b44f27', 'RL61660b26d3d86', 'US6188fe9b0b4c2', '2021-11-08 12:40:27'),
('RA618ac586a6d16', 'RL61660b26d3d86', 'US618ac58670665', '2021-11-09 21:01:26'),
('RA618b8007d0f24', 'RL61660b26d3d86', 'US618b80079ebca', '2021-11-10 10:17:11'),
('RA618c2448e3c8a', 'RL61660b26d3d86', 'US618c2448a8d82', '2021-11-10 21:58:00'),
('RA61929e390256f', 'RL61660b26d3d86', 'US61929e385f529', '2021-11-15 19:51:53'),
('RA6193c11dba153', 'RL61660b26d3d86', 'US6193c11d95564', '2021-11-16 16:33:01'),
('RA6193c256e4c91', 'RL61660b26d3d86', 'US6193c256c5467', '2021-11-16 16:38:14'),
('RA6193c4649ce7c', 'RL61660b26d3d86', 'US6193c464823db', '2021-11-16 16:47:00'),
('RA6193c534ec679', 'RL61660b26d3d86', 'US6193c534d0f15', '2021-11-16 16:50:28'),
('RA6193c61dad7f3', 'RL61660b26d3d86', 'US6193c61d90da9', '2021-11-16 16:54:21'),
('RA6193c6a74ecbc', 'RL61660b26d3d86', 'US6193c6a7217a8', '2021-11-16 16:56:39'),
('RA6193ca6882883', 'RL61660b26d3d86', 'US6193ca686d1fb', '2021-11-16 18:58:36');

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

--
-- Table structure for table `threads`
--

CREATE TABLE `threads` (
  `THREAD_ID` varchar(20) NOT NULL,
  `PROFILE_ID` varchar(20) NOT NULL,
  `THREAD_CONTENT` text NOT NULL,
  `THREAD_DATE` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `thread_reactions`
--

CREATE TABLE `thread_reactions` (
  `THREAD_REACTION_ID` varchar(20) NOT NULL,
  `REACTION_ID` varchar(20) NOT NULL,
  `PROFILE_ID` varchar(20) NOT NULL,
  `THREAD_ID` varchar(20) NOT NULL,
  `THREAD_DATE` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `thread_replies`
--

CREATE TABLE `thread_replies` (
  `REPLY_ID` varchar(20) NOT NULL,
  `PROFILE_ID` varchar(20) NOT NULL,
  `THREAD_ID` varchar(20) NOT NULL,
  `REPLY_CONTENT` text NOT NULL,
  `REPLY_DATE` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `PROFILE_ID` varchar(20) NOT NULL,
  `USER_PASSWORD` varchar(255) NOT NULL,
  `USER_DEFAULT_PASSWORD` varchar(20) NOT NULL,
  `FIRSTNAME` varchar(50) DEFAULT NULL,
  `LASTNAME` varchar(100) DEFAULT NULL,
  `GENDER` enum('MALE','FEMALE','OTHER','') DEFAULT NULL,
  `EMAIL` text DEFAULT NULL,
  `CELLPHONE` bigint(20) DEFAULT NULL,
  `DOB` date DEFAULT NULL,
  `PHYSICAL_ADDRESS` text DEFAULT NULL,
  `PROFILE_IMAGE` text DEFAULT NULL,
  `JOINING_DATE` datetime NOT NULL DEFAULT current_timestamp(),
  `USER_STATUS` enum('ACTIVE','INACTIVE','LOCKED','DELETED') DEFAULT NULL,
  `USER_LAST_LOGIN` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`PROFILE_ID`, `USER_PASSWORD`, `USER_DEFAULT_PASSWORD`, `FIRSTNAME`, `LASTNAME`, `GENDER`, `EMAIL`, `CELLPHONE`, `DOB`, `PHYSICAL_ADDRESS`, `PROFILE_IMAGE`, `JOINING_DATE`, `USER_STATUS`, `USER_LAST_LOGIN`) VALUES
('US616993a498f65', '$2y$10$7hZzDJicrvjwoi6Lo5.JkesHPlLDGngj4X2RgdjVZNAVBT42LFpJu', 'SvRcJ2KH', 'Nathan', 'Kanda', NULL, 'nathkanda72@gmail.com', 0, NULL, NULL, NULL, '2021-10-15 16:43:48', 'INACTIVE', NULL),
('US616c0ff824ecd', '$2y$10$7ZmnDwQAB21UCHxXDbYJjeXgMCvWt/QzSdYzb9Z2VMmm0EaHnpRTO', 'MODIFIED', 'Avatar', NULL, NULL, 'kfdykxmg3@vossie.net', 0, NULL, NULL, 'US616c0ff824ecd.jpeg', '2021-10-17 13:58:48', 'ACTIVE', NULL),
('US617ef71b4b3e0', '$2y$10$mMeXoP5IsjCJu5ChMMpyF.e6yliFvxEXaQKQnwOSxX9ezy.NwVK6K', 'MODIFIED', 'Ndundecode', NULL, NULL, 'ndundecode@gmail.com', NULL, NULL, NULL, 'US617ef71b4b3e0.jpeg', '2021-10-31 20:05:47', 'ACTIVE', '2021-11-17 15:43:18'),
('US617f0f562797e', '$2y$10$k7Pio7HvvxVP4jDxgs.ar.9ZdcaK6mFSr8Mzf3TqOyCpbDsyUZ78q', 'MODIFIED', 'Nathaniel', NULL, NULL, 'nathanmwaluke72@gmail.com', NULL, NULL, NULL, NULL, '2021-10-31 21:49:10', 'ACTIVE', NULL),
('US617f73a118f25', '$2y$10$vJsZWbbtXe6iZof0XUrIy.ODEVUJbUzQFqgclerpStnSEUJI6gftW', 'MODIFIED', 'Admin', NULL, NULL, 'thhp2021@gmail.com', NULL, NULL, NULL, 'US617f73a118f25.jpeg', '2021-11-01 04:57:05', 'ACTIVE', '2021-11-17 15:01:18'),
('US617fc04387a1d', '$2y$10$uwVWM8rh3VAQ7KTlH8i.2.Q7HEGEZbyCm4ESqTAp/kzH.JTMbLBQy', 'MODIFIED', 'Ketsya', NULL, NULL, 'ketsyadyk@gmail.com', NULL, NULL, NULL, 'US617fc04387a1d.jpeg', '2021-11-01 10:24:04', 'ACTIVE', '2021-11-17 14:42:01'),
('US617fcb3a0ad33', '$2y$10$wJYaOaax2.xCjlf1qELo1eMp1vGmhwOLHF1JxZRwaXPN7ZQV3WbQS', 'MODIFIED', 'Thami mthethwa', NULL, NULL, 'hardhatprof@gmail.com', NULL, NULL, NULL, 'US617fcb3a0ad33.jpeg', '2021-11-01 11:10:50', 'ACTIVE', '2021-11-17 16:36:31'),
('US6180f26fe7af1', '$2y$10$GvfervJNiO4k.czgIbd6jeVvfnr7QiK3LHjQj3c/25W7UY7ucVmce', 'MODIFIED', 'Imbelani', NULL, NULL, 'imbelani99.im@gmail.com', NULL, NULL, NULL, 'US6180f26fe7af1.jpeg', '2021-11-02 08:10:24', 'ACTIVE', '2021-11-16 15:00:08'),
('US6180fc0e63d59', '$2y$10$tt6uQach2fun.YTOLx.vIOrGApEEdErekBY6Lvsa4Xj4pfN/pncDK', 'OqhmUfvu', 'Jennifer', NULL, NULL, 'jennifer.mafemba@eduvos.com', NULL, NULL, NULL, NULL, '2021-11-02 08:51:26', 'INACTIVE', NULL),
('US6180fc0f16cdd', '$2y$10$8VU1Ktj2R5oxBP4nMlm07uCIrmCoUuJP3voyROPNA4I44zWKn8yJC', '6PmJNcSu', 'K', NULL, NULL, 'kebashnee.moodley@eduvos.com', NULL, NULL, NULL, NULL, '2021-11-02 08:51:27', 'INACTIVE', NULL),
('US6180fc200e7cf', '$2y$10$mcIXh4zRzAA/LojhIcT7nuNJzXoYGbUfAvr9fsW0w3uR7Y90dX3Ki', '7CokqOph', 'Nathan kanda', NULL, NULL, 'pd51jg6j6@vossie.net', NULL, NULL, NULL, NULL, '2021-11-02 08:51:44', 'INACTIVE', NULL),
('US6180fca8415b6', '$2y$10$uIoeqZrI8rGX9QA5ZOsLcODrCogM4tNeV1yH68LQ8ukY7fEpCR8QS', 'phKfBdce', 'Jennifer', NULL, NULL, 'jennifertmafemba@gmail.com', NULL, NULL, NULL, NULL, '2021-11-02 08:54:00', 'INACTIVE', NULL),
('US61821756d147a', '$2y$10$6uDsnUzAYaoVK5Tg9s/9UOUR.5pMj283UbNpn2/WgEkeACqTCDwse', 'GAcKPJeb', 'John doe', NULL, NULL, 'johndoe@mail.com', NULL, NULL, NULL, NULL, '2021-11-03 05:00:07', 'INACTIVE', NULL),
('US618217a798fdb', '$2y$10$ogJ5Ec5lLHmbCz.i2SYcF.RIhGx5XkxVe9i6I6N7SCLqwqu/RfsMa', 'MODIFIED', 'Trey johnson', NULL, NULL, 'thegoodgroupsa@gmail.com', NULL, NULL, NULL, NULL, '2021-11-03 05:01:27', 'ACTIVE', NULL),
('US618647e3e38aa', '$2y$10$6vgR4EVCNf0FqlYC346AUuG06kYq80hAMBSgcm0SYTXxoLY9Q9nEi', 'kD5uCYAt', 'Kaybee', NULL, NULL, 'kariboba@cyberlinx.co.za', NULL, NULL, NULL, NULL, '2021-11-06 09:16:20', 'INACTIVE', NULL),
('US6188fe9b0b4c2', '$2y$10$nys0CbBXa6aPv1al2ZvIy.yLSYWeGalxVaDWqOnf0aXabRPtYSeY2', 'MODIFIED', 'Nat', NULL, NULL, 'natikanda12@gmail.com', NULL, NULL, NULL, 'US6188fe9b0b4c2.jpeg', '2021-11-08 10:40:27', 'ACTIVE', '2021-11-16 19:24:32'),
('US618ac58670665', '$2y$10$gpW4a6.ztNsyYuhME43N5..0yacd6eQjI1KpPMvfuDZHN5thEE6SO', 'qwbEVUzh', 'Kabedi', NULL, NULL, 'ketsyadyk@hotmail.com', NULL, NULL, NULL, NULL, '2021-11-09 19:01:26', 'INACTIVE', '2021-11-09 21:24:15'),
('US618b80079ebca', '$2y$10$pzGG7FsDJmoc9EyBpragd.QWbWYC9MpmA65gNXy3DDRze8rnDdM/C', 'MODIFIED', 'Fabrice pierre', NULL, NULL, 'FKADIMA.FK@GMAIL.COM', NULL, NULL, NULL, NULL, '2021-11-10 08:17:11', 'ACTIVE', '2021-11-10 10:21:20'),
('US6193ca686d1fb', '$2y$10$sywSRbulCkVVWRtR6B.e/eoes.sJQC0J/gz9TGlMb8uz7WaOTqRUi', 'MODIFIED', 'Elodie', NULL, NULL, 'ngoie.mutombo.elodie@gmail.com', NULL, NULL, NULL, 'US6193ca686d1fb.jpeg', '2021-11-16 17:12:40', 'ACTIVE', '2021-11-17 16:41:57');

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

--
-- Table structure for table `users_online`
--

CREATE TABLE `users_online` (
  `USER_ONLINE_ID` varchar(20) NOT NULL,
  `PROFILE_ID` varchar(20) NOT NULL,
  `USER_ONLINE_SESSION_START` datetime NOT NULL,
  `USER_ONLINE_SESSION_END` datetime DEFAULT NULL,
  `USER_ONLINE_SOURCE_IP` varchar(45) DEFAULT NULL,
  `USER_ONLINE_STATUS` enum('ACTIVE','INACTIVE') NOT NULL DEFAULT 'ACTIVE',
  `USER_ONLINE_COUNT` int(11) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `users_online`
--

INSERT INTO `users_online` (`USER_ONLINE_ID`, `PROFILE_ID`, `USER_ONLINE_SESSION_START`, `USER_ONLINE_SESSION_END`, `USER_ONLINE_SOURCE_IP`, `USER_ONLINE_STATUS`, `USER_ONLINE_COUNT`) VALUES
('UO6189769145bd5', 'US617fc04387a1d', '2021-11-17 14:42:01', '2021-11-17 14:41:39', '197.185.105.224', 'ACTIVE', 45),
('UO618977a3989e4', 'US617f73a118f25', '2021-11-17 15:01:18', '2021-11-17 16:06:03', '197.185.105.224', 'INACTIVE', 73),
('UO6189f8814b503', 'US617fcb3a0ad33', '2021-11-17 16:36:31', '2021-11-17 16:35:35', '105.225.80.41', 'ACTIVE', 23),
('UO618a69c8f2304', 'US6188fe9b0b4c2', '2021-11-16 19:24:32', '2021-11-16 10:57:33', '41.243.1.181', 'ACTIVE', 9),
('UO618a8d8e9ce71', 'US617ef71b4b3e0', '2021-11-17 15:43:18', '2021-11-16 08:23:48', '197.185.105.224', 'ACTIVE', 12),
('UO618ac6226c6b7', 'US618ac58670665', '2021-11-09 21:24:15', NULL, '197.185.105.143', 'INACTIVE', 3),
('UO618b806a51fcf', 'US618b80079ebca', '2021-11-10 10:21:20', NULL, '41.77.221.225', 'INACTIVE', 2),
('UO618bcfd298c86', 'US6180f26fe7af1', '2021-11-16 15:00:08', '2021-11-12 22:54:10', '41.144.92.78', 'INACTIVE', 14),
('UO618c247ceed9e', 'US618c2448a8d82', '2021-11-16 14:40:20', '2021-11-16 16:26:55', '197.185.105.224', 'INACTIVE', 17),
('UO61929e9b011a3', 'US61929e385f529', '2021-11-15 19:53:31', NULL, '197.185.98.116', 'INACTIVE', 1),
('UO6193e32826f83', 'US6193ca686d1fb', '2021-11-17 16:41:57', '2021-11-17 14:44:49', '197.185.105.224', 'ACTIVE', 7);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `articles`
--
ALTER TABLE `articles`
  ADD PRIMARY KEY (`ARTICLE_ID`),
  ADD KEY `user_articlesFK` (`PROFILE_ID_PUBLISHER`),
  ADD KEY `category_articlesFK` (`CATEGORY_ID`),
  ADD KEY `user_roleassignment_articlesFK` (`PROFILE_ID_MENTOR`);

--
-- Indexes for table `article_reactions`
--
ALTER TABLE `article_reactions`
  ADD PRIMARY KEY (`ARTICLE_REACTION_ID`),
  ADD KEY `user_articlereactionsFK` (`PROFILE_ID`),
  ADD KEY `article_articlereactionsFK` (`ARTICLE_ID`),
  ADD KEY `reaction_articlereactionsFK` (`REACTION_ID`);

--
-- Indexes for table `badges`
--
ALTER TABLE `badges`
  ADD PRIMARY KEY (`BADGE_ID`);

--
-- Indexes for table `badge_assignments`
--
ALTER TABLE `badge_assignments`
  ADD KEY `badge_badgeassignment` (`BADGE_ID`),
  ADD KEY `user_badgeassignment` (`PROFILE_ID`);

--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
  ADD PRIMARY KEY (`CATEGORY_ID`);

--
-- Indexes for table `comments`
--
ALTER TABLE `comments`
  ADD PRIMARY KEY (`COMMENT_ID`),
  ADD KEY `user_articlecommentsFK` (`PROFILE_ID`),
  ADD KEY `article_commentFK` (`ARTICLE_ID`);

--
-- Indexes for table `contacts`
--
ALTER TABLE `contacts`
  ADD PRIMARY KEY (`CONTACT_ID`);

--
-- Indexes for table `followings`
--
ALTER TABLE `followings`
  ADD KEY `user_followerfollowingsFK` (`PROFILE_ID_FOLLOWER`),
  ADD KEY `user_followedfollowingsFK` (`PROFILE_ID_FOLLOWING`);

--
-- Indexes for table `mentorship`
--
ALTER TABLE `mentorship`
  ADD KEY `user_menteementorshipFK` (`PROFILE_ID_MENTEE`),
  ADD KEY `user_mentormentorshipFK` (`PROFILE_ID_MENTOR`);

--
-- Indexes for table `ratings`
--
ALTER TABLE `ratings`
  ADD PRIMARY KEY (`RATING_ID`),
  ADD KEY `article_ratingsFK` (`ARTICLE_ID`),
  ADD KEY `user_ratingsFK` (`PROFILE_ID_MODERATOR`);

--
-- Indexes for table `reactions`
--
ALTER TABLE `reactions`
  ADD PRIMARY KEY (`REACTION_ID`);

--
-- Indexes for table `roles`
--
ALTER TABLE `roles`
  ADD PRIMARY KEY (`ROLE_ID`);

--
-- Indexes for table `role_applications`
--
ALTER TABLE `role_applications`
  ADD PRIMARY KEY (`ROLE_APPLICATION_ID`),
  ADD KEY `user_roleapplicationsFK` (`PROFILE_ID`),
  ADD KEY `role_roleapplicationsFK` (`ROLE_ID`),
  ADD KEY `category_roleApplicationsFK` (`CATEGORY_ID`);

--
-- Indexes for table `role_assignments`
--
ALTER TABLE `role_assignments`
  ADD PRIMARY KEY (`ROLE_ASSIGNMENT_ID`),
  ADD UNIQUE KEY `ROLE_ID` (`ROLE_ID`,`PROFILE_ID`),
  ADD KEY `user_roleassignmentsFK` (`PROFILE_ID`),
  ADD KEY `role_roleassignmentsFK` (`ROLE_ID`);

--
-- Indexes for table `threads`
--
ALTER TABLE `threads`
  ADD PRIMARY KEY (`THREAD_ID`),
  ADD KEY `user_threadFK` (`PROFILE_ID`);

--
-- Indexes for table `thread_reactions`
--
ALTER TABLE `thread_reactions`
  ADD KEY `user_threadreactionsFK` (`PROFILE_ID`),
  ADD KEY `threads_threadreactionsFK` (`REACTION_ID`),
  ADD KEY `thread_threadreactionsFK` (`THREAD_ID`);

--
-- Indexes for table `thread_replies`
--
ALTER TABLE `thread_replies`
  ADD KEY `user_threadrepliesFK` (`PROFILE_ID`),
  ADD KEY `threads_threadrepliesFK` (`THREAD_ID`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`PROFILE_ID`);

--
-- Indexes for table `users_online`
--
ALTER TABLE `users_online`
  ADD PRIMARY KEY (`USER_ONLINE_ID`),
  ADD KEY `users_usersOnlineFK` (`PROFILE_ID`);

--
-- Constraints for dumped tables
--

--
-- Constraints for table `articles`
--
ALTER TABLE `articles`
  ADD CONSTRAINT `category_articlesFK` FOREIGN KEY (`CATEGORY_ID`) REFERENCES `categories` (`CATEGORY_ID`) ON UPDATE CASCADE,
  ADD CONSTRAINT `user_articlesFK` FOREIGN KEY (`PROFILE_ID_PUBLISHER`) REFERENCES `users` (`PROFILE_ID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `user_roleassignment_articlesFK` FOREIGN KEY (`PROFILE_ID_MENTOR`) REFERENCES `role_assignments` (`PROFILE_ID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `article_reactions`
--
ALTER TABLE `article_reactions`
  ADD CONSTRAINT `article_articlereactionsFK` FOREIGN KEY (`ARTICLE_ID`) REFERENCES `articles` (`ARTICLE_ID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `reaction_articlereactionsFK` FOREIGN KEY (`REACTION_ID`) REFERENCES `reactions` (`REACTION_ID`),
  ADD CONSTRAINT `user_articlereactionsFK` FOREIGN KEY (`PROFILE_ID`) REFERENCES `users` (`PROFILE_ID`) ON DELETE CASCADE ON UPDATE CASCADE;
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 */;
