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

START TRANSACTION;



--
-- Database: `preksha_app`
--

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

--
-- Table structure for table `app_users`
--

CREATE TABLE `app_users` (
  `id` bigint(20) NOT NULL,
  `role_id` bigint(20) DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `gender` varchar(255) NOT NULL,
  `dob` date DEFAULT NULL,
  `email` varchar(255) NOT NULL,
  `mobile` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `created_by_id` bigint(20) DEFAULT NULL,
  `status` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `app_users`
--

INSERT INTO `app_users` (`id`, `role_id`, `name`, `gender`, `dob`, `email`, `mobile`, `city`, `created_by_id`, `status`, `created_at`, `updated_at`) VALUES
(1, 3, 'Mohd Zuber', 'male', NULL, 'zuber.ansari@attoinfotech.com', '8176028002', 'Mumbai', 1, 1, '2023-12-26 07:13:44', '2023-12-26 07:13:44'),
(2, 3, 'App user 1', 'male', NULL, 'nitin@gmail.com', '4223456722', 'Mumbai', 1, 1, '2023-12-26 23:05:11', '2023-12-26 23:05:11'),
(3, 3, 'App user 2', 'male', NULL, 'zuber2@gmail.com', '8965432345', 'Mumbai', 1, 1, '2023-12-26 23:07:01', '2023-12-26 23:07:01');

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

--
-- Table structure for table `assigned_app_users`
--

CREATE TABLE `assigned_app_users` (
  `id` bigint(20) NOT NULL,
  `app_admin_id` bigint(20) DEFAULT NULL,
  `app_user_id` bigint(20) DEFAULT NULL,
  `created_by_id` bigint(20) DEFAULT NULL,
  `status` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `assigned_app_users`
--

INSERT INTO `assigned_app_users` (`id`, `app_admin_id`, `app_user_id`, `created_by_id`, `status`, `created_at`, `updated_at`) VALUES
(11, 2, 3, 1, 1, '2023-12-27 01:14:51', '2023-12-27 01:14:51'),
(18, 2, 1, 1, 1, '2023-12-27 04:28:12', '2023-12-27 04:28:12'),
(19, 2, 2, 1, 1, '2023-12-28 03:58:37', '2023-12-28 03:58:37');

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

--
-- Table structure for table `journey_stages`
--

CREATE TABLE `journey_stages` (
  `id` bigint(20) NOT NULL,
  `name` varchar(255) NOT NULL,
  `status` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `journey_stages`
--

INSERT INTO `journey_stages` (`id`, `name`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Beginner', 1, '2023-12-01 05:09:05', '2023-12-03 23:21:56'),
(2, 'Intermediate', 1, '2023-12-05 23:58:27', '2023-12-06 03:57:59'),
(3, 'Advance', 1, '2023-12-05 23:58:27', '2023-12-05 23:58:27'),
(4, 'Proficient', 1, '2023-12-05 23:58:27', '2023-12-05 23:58:27');

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

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

CREATE TABLE `roles` (
  `id` bigint(20) NOT NULL,
  `name` varchar(255) NOT NULL,
  `status` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `roles` (`id`, `name`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Super Admin', 1, '2023-12-01 05:09:05', '2023-12-03 23:21:56'),
(2, 'App Admin', 1, '2023-12-05 23:58:27', '2023-12-06 03:57:59'),
(3, 'App User', 1, '2023-12-05 23:58:27', '2023-12-05 23:58:27');

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

--
-- Table structure for table `user_call_logs`
--

CREATE TABLE `user_call_logs` (
  `id` bigint(20) NOT NULL,
  `assign_id` bigint(20) DEFAULT NULL,
  `first_call_at` timestamp NULL DEFAULT current_timestamp(),
  `joined_one_hour_workshop` int(4) DEFAULT 0,
  `remark` text DEFAULT NULL,
  `journey_stage_id` bigint(20) DEFAULT NULL,
  `profile_picture_status` int(4) DEFAULT 0,
  `review_writing` text DEFAULT NULL,
  `app_registration_number` varchar(255) DEFAULT NULL,
  `flag` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `user_call_logs`
--

INSERT INTO `user_call_logs` (`id`, `assign_id`, `first_call_at`, `joined_one_hour_workshop`, `remark`, `journey_stage_id`, `profile_picture_status`, `review_writing`, `app_registration_number`, `flag`, `created_at`, `updated_at`) VALUES
(4, 11, '2023-12-26 18:30:00', 1, 'test', 1, 0, 'xzc mzkzjx', '12345', 1, '2023-12-27 01:14:51', '2023-12-28 09:56:53'),
(11, 18, '2023-12-27 18:30:00', 1, 'test', 1, 1, 'skjnclsak', '123456', 0, '2023-12-27 04:28:12', '2023-12-28 06:09:37'),
(12, 19, '2023-12-28 09:28:37', 0, NULL, NULL, 0, NULL, NULL, 0, '2023-12-28 03:58:37', '2023-12-28 06:11:39'),
(14, 19, '2023-12-27 18:30:00', 1, 'ZUber test', 2, 0, 'test by zuber', '123', 0, '2023-12-28 04:11:55', '2023-12-28 06:11:39'),
(15, 19, '2023-12-27 18:30:00', 1, 'ZUber test newwwwwww', 3, 0, 'test by zuber neww', '123456', 0, '2023-12-28 04:31:37', '2023-12-28 06:11:39'),
(16, 19, '2023-12-27 18:30:00', 1, 'ZUber test newwwwwww kjsxkjaskjc', 4, 0, 'test by zuber newwj kkjsa ckls', '123456789', 0, '2023-12-28 04:34:32', '2023-12-28 06:11:39'),
(17, 19, '2023-12-27 18:30:00', 1, 'ZUber test newwwwwww', 3, 0, 'test by zuber neww', '123456ssa', 0, '2023-12-28 04:36:48', '2023-12-28 06:11:39'),
(18, 19, '2023-12-27 18:30:00', 1, 'ZUber', 1, 0, 'test by zuber', '123', 0, '2023-12-28 04:49:25', '2023-12-28 06:11:39'),
(19, 19, '2023-12-27 18:30:00', 1, 'ZUber qwe', 1, 0, 'test by zuber', '123', 0, '2023-12-28 04:50:27', '2023-12-28 06:11:39'),
(20, 19, '2023-12-27 18:30:00', 1, 'ZUber qwe', 1, 0, 'test by zuber', '1232345', 0, '2023-12-28 04:51:22', '2023-12-28 06:11:39'),
(21, 19, '2023-12-27 18:30:00', 1, 'ZUber qwe', 1, 0, 'test by zuber', '123', 0, '2023-12-28 04:54:26', '2023-12-28 06:11:39'),
(22, 19, '2023-12-27 18:30:00', 1, 'ZUber', 1, 0, 'test by zuber', '123', 0, '2023-12-28 04:55:01', '2023-12-28 06:11:39'),
(23, 18, '2023-12-27 18:30:00', 1, 'test zuber', 1, 1, 'skjnclsak', '123456', 0, '2023-12-28 05:48:14', '2023-12-28 06:09:37'),
(24, 18, '2023-12-27 18:30:00', 0, 'test zuber', 1, 1, 'skjnclsak', '123456', 1, '2023-12-28 06:09:37', '2023-12-28 06:09:37'),
(25, 19, '2023-12-27 18:30:00', 0, 'ZUber', 1, 0, 'test by zuber', '123', 1, '2023-12-28 06:11:39', '2023-12-28 06:11:39');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `app_users`
--
ALTER TABLE `app_users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `email` (`email`),
  ADD UNIQUE KEY `mobile` (`mobile`),
  ADD KEY `role_id` (`role_id`);

--
-- Indexes for table `assigned_app_users`
--
ALTER TABLE `assigned_app_users`
  ADD PRIMARY KEY (`id`),
  ADD KEY `app_admin_id` (`app_admin_id`),
  ADD KEY `app_user_id` (`app_user_id`);

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

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

--
-- Indexes for table `user_call_logs`
--
ALTER TABLE `user_call_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `assign_id` (`assign_id`),
  ADD KEY `journey_stage_id` (`journey_stage_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `app_users`
--
ALTER TABLE `app_users`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `assigned_app_users`
--
ALTER TABLE `assigned_app_users`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;

--
-- AUTO_INCREMENT for table `journey_stages`
--
ALTER TABLE `journey_stages`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `roles`
--
ALTER TABLE `roles`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `user_call_logs`
--
ALTER TABLE `user_call_logs`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `app_users`
--
ALTER TABLE `app_users`
  ADD CONSTRAINT `app_users_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`);

--
-- Constraints for table `assigned_app_users`
--
ALTER TABLE `assigned_app_users`
  ADD CONSTRAINT `assigned_app_users_ibfk_1` FOREIGN KEY (`app_admin_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `assigned_app_users_ibfk_2` FOREIGN KEY (`app_user_id`) REFERENCES `app_users` (`id`);

--
-- Constraints for table `user_call_logs`
--
ALTER TABLE `user_call_logs`
  ADD CONSTRAINT `user_call_logs_ibfk_1` FOREIGN KEY (`assign_id`) REFERENCES `assigned_app_users` (`id`),
  ADD CONSTRAINT `user_call_logs_ibfk_2` FOREIGN KEY (`journey_stage_id`) REFERENCES `journey_stages` (`id`);
COMMIT;

