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

START TRANSACTION;



--
-- Database: `random_talk_db`
--

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

--
-- Table structure for table `admin`
--

CREATE TABLE IF NOT EXISTS `admin` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` text,
  `business_name` text,
  `email` varchar(255) DEFAULT NULL,
  `password` varchar(100) DEFAULT NULL,
  `role` varchar(100) DEFAULT NULL,
  `mobile_number` varchar(100) DEFAULT NULL,
  `country_code` varchar(5) DEFAULT NULL,
  PRIMARY KEY (`id`)
);

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

--
-- Table structure for table `app_settings`
--

CREATE TABLE IF NOT EXISTS `app_settings` (
  `id` int NOT NULL AUTO_INCREMENT,
  `key` varchar(255) DEFAULT NULL,
  `value` text ,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
);

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

--
-- Table structure for table `call_history`
--

CREATE TABLE IF NOT EXISTS `call_history` (
  `id` int NOT NULL AUTO_INCREMENT,
  `first_user` int DEFAULT NULL,
  `second_user` int DEFAULT NULL,
  `joined_time` datetime DEFAULT NULL,
  `left_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
);

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

--
-- Table structure for table `coins_pack`
--

CREATE TABLE `coins_pack` (
  `id` int NOT NULL AUTO_INCREMENT,
  `value` decimal(10,2) DEFAULT NULL,
  `coins` int DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
);

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

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

CREATE TABLE IF NOT EXISTS `fcm_details` (
  `id` int NOT NULL AUTO_INCREMENT,
  `fcm_id` varchar(255) NOT NULL,
  `uid` int NOT NULL COMMENT 'User id for distinct  identity of user obtained from firebase',
  `status` tinyint(1) DEFAULT '1',
  `device_type` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
);

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

--
-- Table structure for table `gifts`
--

CREATE TABLE IF NOT EXISTS `gifts` (
  `id` int NOT NULL AUTO_INCREMENT,
  `gift` varchar(255) DEFAULT NULL,
  `mask` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `name` text,
  `coins` int DEFAULT NULL,
  PRIMARY KEY (`id`)
);

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

--
-- Table structure for table `loading_texts`
--

CREATE TABLE IF NOT EXISTS `loading_texts` (
  `id` int NOT NULL AUTO_INCREMENT,
  `texts` text,
  `mask` int DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
);

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

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

CREATE TABLE IF NOT EXISTS `notification` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `notification_type` varchar(100) DEFAULT NULL,
  `creation_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `is_read` tinyint DEFAULT NULL,
  `notification_text` text,
  `notification_title` text,
  `icon_url` text,
  `backlink` text,
  PRIMARY KEY (`id`)
);

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

--
-- Table structure for table `product`
--

CREATE TABLE IF NOT EXISTS `plugins` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `installed` tinyint DEFAULT NULL,
  `downloaded` tinyint DEFAULT NULL,
  `version` int DEFAULT NULL,
  PRIMARY KEY (`id`)
);

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

--
-- Table structure for table `report`
--

CREATE TABLE IF NOT EXISTS `report` (
  `id` int NOT NULL AUTO_INCREMENT,
  `reportor_id` int DEFAULT NULL,
  `reported_id` int DEFAULT NULL,
  `reason` text ,
  `created_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
);

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

--
-- Table structure for table `report_reason`
--

CREATE TABLE IF NOT EXISTS `report_reason` (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` text,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
);

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

--
-- Table structure for table `subscription`
--

CREATE TABLE IF NOT EXISTS `subscription` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` text,
  `filter_both` int DEFAULT NULL,
  `filter_gender` int DEFAULT NULL,
  `filter_location` tinyint DEFAULT NULL,
  `exclusive_badge` tinyint DEFAULT NULL,
  `no_ads` tinyint DEFAULT NULL,
  `marketing_text` text,
  PRIMARY KEY (`id`)
);

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

--
-- Table structure for table `subscription_pricing`
--

CREATE TABLE IF NOT EXISTS `subscription_pricing` (
  `id` int NOT NULL AUTO_INCREMENT,
  `subscription_id` int DEFAULT NULL,
  `duration_days` int DEFAULT NULL,
  `price` decimal(10,0) DEFAULT NULL,
  `gateway_product_id` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
);

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

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

CREATE TABLE IF NOT EXISTS `transaction` (
  `id` int NOT NULL AUTO_INCREMENT,
  `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 DEFAULT NULL,
  `status` varchar(100) DEFAULT NULL,
  `transaction_direction` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
);

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

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

CREATE TABLE IF NOT EXISTS `users` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` varchar(255) NOT NULL COMMENT 'User id for distinct  identity of user obtained from firebase',
  `name` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `dob` date DEFAULT NULL,
  `joined_on` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `user_icon` varchar(255) DEFAULT NULL,
  `location` varchar(255) DEFAULT NULL,
  `gender` varchar(100) DEFAULT NULL,
  `active_plan` varchar(100) DEFAULT NULL,
  `live` smallint DEFAULT NULL,
  `description` text,
  `coins` int DEFAULT NULL,
  `gender_filter` tinyint DEFAULT NULL,
  PRIMARY KEY (`id`)
);

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

--
-- Table structure for table `user_live`
--

CREATE TABLE IF NOT EXISTS `user_live` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `started_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `ended_at` timestamp NULL DEFAULT NULL,
  `is_live` tinyint DEFAULT NULL,
  PRIMARY KEY (`id`)
);

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

--
-- Table structure for table `user_search`
--

CREATE TABLE IF NOT EXISTS `user_search` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `gender_filter` varchar(100) DEFAULT NULL,
  `location_filter` varchar(100) DEFAULT NULL,
  `is_vip` tinyint DEFAULT NULL,
  PRIMARY KEY (`id`)
);

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

--
-- Table structure for table `user_subscription`
--

CREATE TABLE IF NOT EXISTS `user_subscription` (
  `id` int NOT NULL AUTO_INCREMENT,
  `subscription_pricing_id` int DEFAULT NULL,
  `user_id` int DEFAULT NULL,
  `start_date` timestamp NULL DEFAULT NULL,
  `end_date` timestamp NULL DEFAULT NULL,
  `auto_renew` tinyint DEFAULT NULL,
  PRIMARY KEY (`id`)
);

/*
 Insert into coins_pack
*/
INSERT INTO coins_pack (id, value, coins, name) VALUES(1, 1, 10, 'Starter Pack');
INSERT INTO coins_pack (id, value, coins, name) VALUES(2, 3, 20, 'Bronze Pack');
INSERT INTO coins_pack (id, value, coins, name) VALUES(3, 6, 40, 'Silver Pack');
INSERT INTO coins_pack (id, value, coins, name) VALUES(4, 9, 60, 'Gold Pack');
INSERT INTO coins_pack (id, value, coins, name) VALUES(5, 12, 80, 'Platinum Pack');
INSERT INTO coins_pack (id, value, coins, name) VALUES(6, 15, 100, 'Diamond Pack');
INSERT INTO coins_pack (id, value, coins, name) VALUES(7, 22, 150, 'Elite Pack');
INSERT INTO coins_pack (id, value, coins, name) VALUES(8, 30, 200, 'Master Pack');
INSERT INTO coins_pack (id, value, coins, name) VALUES(9, 37, 250, 'Legend Pack');
INSERT INTO coins_pack (id, value, coins, name) VALUES(10, 45, 300, 'Ultimate Pack');
INSERT INTO coins_pack (id, value, coins, name) VALUES(11, 75, 500, 'Mega Pack');

/*
Insert into subscription
*/
INSERT INTO subscription (id, name, filter_both, filter_gender, filter_location, exclusive_badge, no_ads, marketing_text) VALUES(1, 'VIP', -1, 150, 0, 1, 1, 'Take up the VIP Package');
INSERT INTO subscription (id, name, filter_both, filter_gender, filter_location, exclusive_badge, no_ads, marketing_text) VALUES(2, 'VIP', -1, -1, 1, 1, 1, 'Take up the VIP + Package');

/*
Insert into subscription_pricing
*/
INSERT INTO subscription_pricing (id, subscription_id, duration_days, price, gateway_product_id) VALUES(1, 1, 7, 10, 'vip_weak');
INSERT INTO subscription_pricing (id, subscription_id, duration_days, price, gateway_product_id) VALUES(2, 1, 30, 20, 'vip_month');
INSERT INTO subscription_pricing (id, subscription_id, duration_days, price, gateway_product_id) VALUES(3, 2, 7, 15, 'vip_plus_weak');
INSERT INTO subscription_pricing (id, subscription_id, duration_days, price, gateway_product_id) VALUES(4, 2, 30, 30, 'vip_plus_month');

/*
Insert into loading_texts
*/
INSERT INTO loading_texts (id, texts, mask, created_at) VALUES(1, 'Hang tight, loading your experience...', 0, NULL);
INSERT INTO loading_texts (id, texts, mask, created_at) VALUES(2, 'Just a moment... good things take time!', 0, NULL);
INSERT INTO loading_texts (id, texts, mask, created_at) VALUES(3, 'Preparing something awesome for you...', 0, NULL);
INSERT INTO loading_texts (id, texts, mask, created_at) VALUES(4, 'Loading... please wait patiently.', 0, NULL);
INSERT INTO loading_texts (id, texts, mask, created_at) VALUES(5, 'Summoning the data gods...', 0, NULL);
INSERT INTO loading_texts (id, texts, mask, created_at) VALUES(6, 'Polishing pixels...', 0, NULL);
INSERT INTO loading_texts (id, texts, mask, created_at) VALUES(7, 'Optimizing for awesomeness...', 0, NULL);
INSERT INTO loading_texts (id, texts, mask, created_at) VALUES(8, 'Bringing things to life...', 0, NULL);
INSERT INTO loading_texts (id, texts, mask, created_at) VALUES(9, 'Good vibes are on the way...', 0, NULL);
INSERT INTO loading_texts (id, texts, mask, created_at) VALUES(10, 'Your content is coming right up!', 0, NULL);
INSERT INTO loading_texts (id, texts, mask, created_at) VALUES(11, 'Rendering magic..', 0, NULL);
INSERT INTO loading_texts (id, texts, mask, created_at) VALUES(12, 'Let’s get things rolling...', 0, NULL);
INSERT INTO loading_texts (id, texts, mask, created_at) VALUES(13, 'This won’t take long... hopefully.', 0, NULL);
INSERT INTO loading_texts (id, texts, mask, created_at) VALUES(14, 'Brewing your results...', 0, NULL);
INSERT INTO loading_texts (id, texts, mask, created_at) VALUES(15, 'Still faster than your coffee machine...', 0, NULL);

/*
Insert into app_settings
*/
INSERT INTO app_settings (id, `key`, value, updated_at) VALUES(1, 'playstore_link', NULL, NULL);
INSERT INTO app_settings (id, `key`, value, updated_at) VALUES(2, 'appstore_link', NULL, NULL);
INSERT INTO app_settings (id, `key`, value, updated_at) VALUES(3, 'privacy_policy', NULL, NULL);
INSERT INTO app_settings (id, `key`, value, updated_at) VALUES(4, 'terms_and_condition', NULL, NULL);
INSERT INTO app_settings (id, `key`, value, updated_at) VALUES(5, 'admob_android_reward_id', NULL, NULL);
INSERT INTO app_settings (id, `key`, value, updated_at) VALUES(6, 'admob_ios_reward_id', NULL, NULL);
INSERT INTO app_settings (id, `key`, value, updated_at) VALUES(7, 'admob_ios_banner_id', NULL, NULL);
INSERT INTO app_settings (id, `key`, value, updated_at) VALUES(8, 'admob_ios_interstitial_id', NULL, NULL);
INSERT INTO app_settings (id, `key`, value, updated_at) VALUES(9, 'admob_android_banner_id', NULL, NULL);
INSERT INTO app_settings (id, `key`, value, updated_at) VALUES(10, 'admob_android_interstitial_id', NULL, NULL);
INSERT INTO app_settings (id, `key`, value, updated_at) VALUES(11, 'email', NULL, NULL);
INSERT INTO app_settings (id, `key`, value, updated_at) VALUES(12, 'social_facebook', NULL, NULL);
INSERT INTO app_settings (id, `key`, value, updated_at) VALUES(13, 'social_instagram', NULL, NULL);
INSERT INTO app_settings (id, `key`, value, updated_at) VALUES(14, 'social_twitter', NULL, NULL);
INSERT INTO app_settings (id, `key`, value, updated_at) VALUES(15, 'social_youtube', NULL, NULL);
INSERT INTO app_settings (id, `key`, value, updated_at) VALUES(16, 'paypal_client_id', NULL, NULL);
INSERT INTO app_settings (id, `key`, value, updated_at) VALUES(17, 'paypal_secreat_key', NULL, NULL);
INSERT INTO app_settings (id, `key`, value, updated_at) VALUES(18, 'server_status', '1', NULL);
INSERT INTO app_settings (id, `key`, value, updated_at) VALUES(19, 'community_guidelines', NULL, NULL);
INSERT INTO app_settings (id, `key`, value, updated_at) VALUES(20, 'revenuecat_sdk_key', NULL, NULL);
INSERT INTO app_settings (id, `key`, value, updated_at) VALUES(21, 'revenuecat_entilement_id', NULL, NULL);

COMMIT;

