-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jan 30, 2024 at 06:35 AM
-- Server version: 10.6.16-MariaDB-cll-lve
-- PHP Version: 8.1.16

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: `i9633848_wp1`
--

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

--
-- Table structure for table `clubs`
--

CREATE TABLE `clubs` (
  `id` int(11) NOT NULL,
  `club_icon` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `owner` varchar(255) NOT NULL,
  `status` varchar(50) NOT NULL,
  `description` varchar(255) NOT NULL,
  `keywords` text NOT NULL,
  `rules` text NOT NULL,
  `created_on` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `clubs_member`
--

CREATE TABLE `clubs_member` (
  `id` int(11) NOT NULL,
  `club_id` int(11) NOT NULL COMMENT 'represents the userid of the user.\r\nFOREIGN KEY (club_id) REFERENCES Clubs(id)',
  `user_id` int(11) NOT NULL COMMENT 'represents the userid\r\nFOREIGN KEY (user_id) REFERENCES Users(id)',
  `role` varchar(255) NOT NULL COMMENT 'The role user is associated to\r\n(member, moderator, requested)'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `clubs_room`
--

CREATE TABLE `clubs_room` (
  `id` int(11) NOT NULL,
  `club_id` int(11) NOT NULL COMMENT 'represents the userid of the user.\r\nFOREIGN KEY (club_id) REFERENCES Clubs(id)',
  `room_id` int(11) NOT NULL COMMENT 'represents the userid\r\nFOREIGN KEY (room_id) REFERENCES Rooms(id)'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `fcm_details`
--

CREATE TABLE `fcm_details` (
  `id` int(11) NOT NULL,
  `fcm_id` varchar(255) NOT NULL,
  `uid` int(11) NOT NULL COMMENT 'User id for distinct  identity of user obtained from firebase'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `interest_categories`
--

CREATE TABLE `interest_categories` (
  `id` int(11) NOT NULL,
  `topic_name` varchar(255) NOT NULL COMMENT 'The interest name ',
  `icon` varchar(255) NOT NULL COMMENT 'This contains the url of the icon',
  `category_name` varchar(255) NOT NULL COMMENT 'This contains the name of the category this interest belongs'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

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

CREATE TABLE `notification` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL COMMENT 'represents the user id of the user for which the notification is sent.\r\nFOREIGN KEY (user_id) REFERENCES Users(id)',
  `notification_type` varchar(50) NOT NULL COMMENT 'This contains the tag for the notification\r\n(silient, club_follow, following_alert, ) ',
  `creation_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `is_read` tinyint(1) NOT NULL,
  `notification_text` text NOT NULL,
  `notification_title` varchar(255) NOT NULL,
  `icon_url` varchar(255) NOT NULL,
  `backlink` varchar(255) NOT NULL COMMENT 'The backlink associated with the notification.'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `reported`
--

CREATE TABLE `reported` (
  `id` int(11) NOT NULL,
  `reporting` int(11) NOT NULL,
  `reported` int(11) NOT NULL,
  `tag` varchar(50) NOT NULL,
  `reason` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `rooms`
--

CREATE TABLE `rooms` (
  `id` int(11) NOT NULL,
  `club_id` int(11) NOT NULL COMMENT 'id of the club associated  (this can be null or Empty)',
  `name` varchar(255) NOT NULL,
  `creator` int(11) NOT NULL COMMENT 'the id of the creator of the room',
  `status` varchar(50) NOT NULL COMMENT 'this will contain a keyword (public /private) this is in the context for the entry of the user',
  `description` text NOT NULL,
  `keywords` text NOT NULL COMMENT 'This will include the interest topics for the room for finding the users',
  `rules` text NOT NULL COMMENT 'This is the Section that the hpst of the  Room will set',
  `created_on` timestamp NOT NULL DEFAULT current_timestamp(),
  `started_on` timestamp NULL DEFAULT NULL,
  `started` tinyint(1) NOT NULL COMMENT 'This flag shows the status of the room weather its started or not',
  `url` varchar(255) NOT NULL COMMENT 'This will contain the url added',
  `hand_raised` text DEFAULT NULL COMMENT 'This is the array of the user_id that have raised hands'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `rooms_member`
--

CREATE TABLE `rooms_member` (
  `id` int(11) NOT NULL,
  `room_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `role` varchar(50) NOT NULL,
  `mic` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `trending_club`
--

CREATE TABLE `trending_club` (
  `id` int(11) NOT NULL,
  `club_id` int(11) NOT NULL COMMENT 'represents the userid of the user.\r\nFOREIGN KEY (club_id) REFERENCES Clubs(id)',
  `followers` int(11) NOT NULL COMMENT 'represents the number of the followers',
  `coins` int(11) NOT NULL COMMENT 'The number of Coins the User has',
  `rooms` int(11) NOT NULL COMMENT 'The numbers of rooms created'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `trending_user`
--

CREATE TABLE `trending_user` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL COMMENT 'represents the userid of the user.\r\nFOREIGN KEY (user_id) REFERENCES Users(id)',
  `followers` int(11) NOT NULL COMMENT 'represents the number of the followers',
  `coins` int(11) NOT NULL COMMENT 'The number of Coins the User has'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

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

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `uid` varchar(255) NOT NULL COMMENT 'User id for distinct  identity of user obtained from firebase',
  `first_name` varchar(255) NOT NULL,
  `last_name` varchar(255) NOT NULL,
  `user_name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `dob` date NOT NULL,
  `contact_no` varchar(25) NOT NULL,
  `interest` text DEFAULT NULL COMMENT 'Array of selected interest by the user',
  `social_links` text DEFAULT NULL COMMENT 'Array of Social Media Link { twitter_link, instagram_link}',
  `joined_on` timestamp NOT NULL DEFAULT current_timestamp(),
  `bio` text DEFAULT NULL COMMENT 'This can be a Empty String or null',
  `status` varchar(50) NOT NULL COMMENT 'this contains the tag for the status verfication',
  `user_icon` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `user_follower`
--

CREATE TABLE `user_follower` (
  `id` int(11) NOT NULL,
  `follower_id` int(11) NOT NULL COMMENT 'represents the user who is following.\r\nFOREIGN KEY (follower_id) REFERENCES Users(id)',
  `user_id` int(11) NOT NULL COMMENT 'represents the user who is followed.\r\nFOREIGN KEY (user_id) REFERENCES Users(id)'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Indexes for dumped tables
--

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

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

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

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

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

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

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

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

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

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

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

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

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

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

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

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

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

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

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

--
-- AUTO_INCREMENT for table `user_follower`
--
ALTER TABLE `user_follower`
  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 */;
