DROP DATABASE IF EXISTS `jad-app-dev`;
CREATE DATABASE `jad-app-dev`;
USE `jad-app-dev`;


CREATE TABLE `subscription_packages` (
  `id` int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `title` varchar(80) DEFAULT NULL,
  `duration` varchar(80) DEFAULT NULL,
  `description` varchar(254) DEFAULT NULL,
  `magnifiers_count` int DEFAULT NULL,
  `re_reviews_count` int DEFAULT NULL,
  `double_likes_count` int DEFAULT NULL,
  `custom_location` tinyint(1) DEFAULT NULL,
  `message_add_on_count` int DEFAULT NULL,
  `messages_per_add_on_count` int DEFAULT NULL,
  `show_liked_list` tinyint(1) DEFAULT NULL,
  `show_profile_liked` tinyint(1) DEFAULT NULL,
  `alert_on_double_like` tinyint(1) DEFAULT NULL,
  `remove_video_ads` tinyint(1) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)
INSERT INTO `subscription_packages` (`id`, `title`, `duration`, `description`, `magnifiers_count`, `re_reviews_count`, `double_likes_count`, `custom_location`, `message_add_on_count`, `messages_per_add_on_count`, `show_liked_list`, `show_profile_liked`, `alert_on_double_like`, `remove_video_ads`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 'JAD Gold', 'monthly', NULL, 9999, 9999, 9999, 1, 30, 50, 1, 1, 1, 1, 1, '2021-07-14 11:36:40', '2021-07-14 11:37:35'),
(2, 'JAD Gold', 'yearly', NULL, 9999, 9999, 9999, 1, 30, 50, 1, 1, 1, 1, 1, '2021-07-14 11:38:26', '2021-07-14 11:38:26'),
(3, 'JAD Premium', 'monthly', NULL, 9999, 9999, 9999, 1, 30, 50, 0, 1, 1, 1, 1, '2021-07-14 11:39:51', '2021-07-14 11:39:51'),
(4, 'JAD Premium', 'yearly', NULL, 9999, 9999, 9999, 1, 30, 50, 0, 1, 1, 1, 1, '2021-07-14 11:39:59', '2021-07-14 11:39:59'),
(5, 'JAD Standard', 'monthly', NULL, 9999, 9999, 9999, 1, 30, 50, 0, 0, 0, 0, 1, '2021-07-14 11:41:00', '2021-07-14 11:41:00'),
(6, 'JAD Standard', 'yearly', NULL, 9999, 9999, 9999, 1, 30, 50, 0, 0, 0, 0, 1, '2021-07-14 11:41:07', '2021-07-14 11:41:07');
CREATE TABLE `date_schedules` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `user_id` int unsigned DEFAULT NULL,
  `day` varchar(50) DEFAULT NULL,
  `time_from` varchar(50) DEFAULT NULL,
  `time_to` varchar(50) DEFAULT NULL,
  `duration` varchar(50) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
)


CREATE TABLE `dates` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `user_id` int unsigned DEFAULT NULL,
  `opponent_id` int unsigned DEFAULT NULL,
  `channel_id` varchar(50) DEFAULT NULL,
  `date` date DEFAULT NULL,
  `time` time DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
)


CREATE TABLE `interests_and_hobbies` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `name` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
)

INSERT INTO `interests_and_hobbies` (`id`, `name`, `is_active`, `created_at`, `updated_at`) VALUES
(1,	'Sports',	1,	'2021-03-15 20:28:01',	'2021-03-15 20:28:01'),
(2,	'Party',	1,	'2021-03-15 20:28:01',	'2021-03-15 20:28:01'),
(3,	'Swimming',	1,	'2021-03-15 20:28:01',	'2021-03-15 20:28:01'),
(4,	'Clubbing',	1,	'2021-03-15 20:28:01',	'2021-03-15 20:28:01'),
(5,	'Hiking',	1,	'2021-03-15 20:28:01',	'2021-03-15 20:28:01'),
(6,	'Music',	1,	'2021-03-15 20:28:01',	'2021-03-15 20:28:01'),
(7,	'Studies',	1,	'2021-03-15 20:28:01',	'2021-03-15 20:28:01'),
(8,	'Science',	1,	'2021-03-15 20:28:01',	'2021-03-15 20:28:01'),
(9,	'Hanging Out',	1,	'2021-03-15 20:28:01',	'2021-03-15 20:28:01'),
(10,	'Travel',	1,	'2021-03-15 20:28:01',	'2021-03-15 20:28:01'),
(11,	'Movies',	1,	'2021-03-15 20:28:01',	'2021-03-15 20:28:01'),
(12,	'Art',	1,	'2021-03-15 20:28:01',	'2021-03-15 20:28:01'),
(13,	'Politics',	1,	'2021-03-15 20:28:01',	'2021-03-15 20:28:01'),
(14,	'Cooking',	1,	'2021-03-15 20:28:01',	'2021-03-15 20:28:01'),
(15,	'Learning',	1,	'2021-03-15 20:28:01',	'2021-03-15 20:28:01'),
(16,	'Pet',	1,	'2021-03-15 20:28:01',	'2021-03-15 20:28:01'),
(17,	'Photography',	1,	'2021-03-15 20:28:01',	'2021-03-15 20:28:01'),
(18,	'Dancing',	1,	'2021-03-15 20:28:01',	'2021-03-15 20:28:01'),
(19,	'Play',	1,	'2021-03-17 09:58:44',	'2021-03-17 09:58:44'),
(20,	'Singing',	1,	'2021-03-17 09:58:44',	'2021-03-17 09:58:44');

CREATE TABLE `match_prefernces` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `user_id` int unsigned DEFAULT NULL,
  `age_from` tinyint(1) DEFAULT NULL,
  `age_to` tinyint(1) DEFAULT NULL,
  `gender_prefernces` varchar(50) DEFAULT NULL,
  `radius_in_miles_from` tinyint(1) DEFAULT NULL,
  `radius_in_miles_to` tinyint(1) DEFAULT NULL,
  `location` tinyint(1) DEFAULT '0',
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
)


CREATE TABLE `notification_settings` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `user_id` int unsigned DEFAULT NULL,
  `profile_like` tinyint(1) DEFAULT '1',
  `match_created` tinyint(1) DEFAULT '1',
  `message_received` tinyint(1) DEFAULT '1',
  `date_schuduled` tinyint(1) DEFAULT '1',
  `asked_for_date` tinyint(1) DEFAULT '1',
  `date_is_cancelled` tinyint(1) DEFAULT '1',
  `date_confirmation` tinyint(1) DEFAULT '1',
  `date_updated` tinyint(1) DEFAULT '1',
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
)

alter table notifications add column `video _request_id` int unsigned DEFAULT NULL,
CREATE TABLE `user_interests` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `user_id` int unsigned DEFAULT NULL,
  `interest_id` int unsigned DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
)


