-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Dec 30, 2024 at 09:47 AM
-- Server version: 10.6.20-MariaDB-cll-lve
-- PHP Version: 8.1.29

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` int(11) NOT NULL,
  `status` varchar(50) NOT NULL,
  `description` varchar(255) NOT NULL,
  `rules` text NOT NULL,
  `created_on` timestamp NOT NULL DEFAULT current_timestamp(),
  `total_rooms_created` int(11) DEFAULT NULL
) 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)',
  `tickets` int(11) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `club_interest`
--

CREATE TABLE `club_interest` (
  `id` int(11) NOT NULL,
  `club_id` int(11) NOT NULL,
  `interest` int(11) NOT NULL
) 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',
  `status` tinyint(1) DEFAULT 1
) 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,
  `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,
  `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',
  `avion_room_id` varchar(255) DEFAULT NULL
) 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,
  `hand_raised` tinyint(1) DEFAULT NULL,
  `joined_status` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `room_interest`
--

CREATE TABLE `room_interest` (
  `id` int(11) NOT NULL,
  `room_id` int(11) NOT NULL,
  `interest` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `ticket_user`
--

CREATE TABLE `ticket_user` (
  `id` int(11) NOT NULL,
  `earned_tickets` int(11) DEFAULT NULL,
  `purchased_tickets` int(11) DEFAULT NULL,
  `uid` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `transaction`
--

CREATE TABLE `transaction` (
  `id` int(11) NOT NULL,
  `product_id` varchar(100) DEFAULT NULL,
  `transaction_id` varchar(100) DEFAULT NULL,
  `created_date` datetime DEFAULT NULL,
  `type` varchar(100) DEFAULT NULL,
  `amount` decimal(10,0) DEFAULT NULL,
  `uid` int(11) DEFAULT NULL,
  `status` varchar(100) DEFAULT NULL
) 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,
  `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;

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

--
-- Table structure for table `user_interest`
--

CREATE TABLE `user_interest` (
  `id` int(11) NOT NULL,
  `uid` int(11) NOT NULL,
  `interest` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `verification_request`
--

CREATE TABLE `verification_request` (
  `id` int(11) NOT NULL,
  `bank_detail` text DEFAULT NULL,
  `government_doc` text DEFAULT NULL,
  `uid` int(11) DEFAULT NULL,
  `status` varchar(100) DEFAULT NULL,
  `created_on` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `verified_user`
--

CREATE TABLE `verified_user` (
  `id` int(11) NOT NULL,
  `bank_detail` text DEFAULT NULL,
  `government_doc` text DEFAULT NULL,
  `uid` int(11) NOT NULL DEFAULT 0,
  `verified_on` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `withdrawal_request`
--

CREATE TABLE `withdrawal_request` (
  `id` int(11) NOT NULL,
  `status` varchar(100) DEFAULT NULL,
  `tickets` int(11) DEFAULT NULL,
  `uid` int(11) NOT NULL DEFAULT 0,
  `created_on` timestamp NOT NULL DEFAULT current_timestamp(),
  `per_ticket_value` decimal(10,3) DEFAULT 0.000
) 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 `club_interest`
--
ALTER TABLE `club_interest`
  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 `room_interest`
--
ALTER TABLE `room_interest`
  ADD PRIMARY KEY (`id`);

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

--
-- Indexes for table `transaction`
--
ALTER TABLE `transaction`
  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`);

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

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

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

--
-- Indexes for table `withdrawal_request`
--
ALTER TABLE `withdrawal_request`
  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 `club_interest`
--
ALTER TABLE `club_interest`
  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 `room_interest`
--
ALTER TABLE `room_interest`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

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

--
-- AUTO_INCREMENT for table `transaction`
--
ALTER TABLE `transaction`
  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;

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

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

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

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