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

START TRANSACTION;



--
-- Triggers `gmail_app_password`
--
DELIMITER $$
    IF row_count >= 1 THEN
        SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Only one row is allowed in this table.';
    END IF;
END
$$
DELIMITER ;

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

--
-- Table structure for table `selected_plan`
--

CREATE TABLE `selected_plan` (
  `id` int(11) NOT NULL,
  `uid` int(11) NOT NULL,
  `plan_type` enum('Subscription','Trial','','') NOT NULL,
  `plan_duration` varchar(20) NOT NULL,
  `plan_status` enum('Requested','Accepted','Rejected','') NOT NULL DEFAULT 'Requested'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Indexes for table `selected_plan`
--
ALTER TABLE `selected_plan`
  ADD PRIMARY KEY (`id`),
  ADD KEY `selected_paln_uid_w_user_id` (`uid`);

--
-- AUTO_INCREMENT for table `selected_plan`
--
ALTER TABLE `selected_plan`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

--
-- Constraints for table `selected_plan`
--
ALTER TABLE `selected_plan`
  ADD CONSTRAINT `selected_paln_uid_w_user_id` FOREIGN KEY (`uid`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;

