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

START TRANSACTION;



--
-- Database: `hook_and_hanger`
--

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

--
-- Table structure for table `barcode`
--

CREATE TABLE `barcode` (
  `b_id` int(11) NOT NULL,
  `invid` int(11) NOT NULL,
  `custid` int(11) NOT NULL,
  `b_val` varchar(60) NOT NULL,
  `service` varchar(50) NOT NULL,
  `product` varchar(50) NOT NULL,
  `status` enum('0','1') NOT NULL COMMENT '0:active,1:cancle',
  `remarks` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `barcode`
--

INSERT INTO `barcode` (`b_id`, `invid`, `custid`, `b_val`, `service`, `product`, `status`, `remarks`) VALUES
(187, 21, 2, '21-1', 'steam-iron', 'Tshirt', '0', ''),
(188, 21, 2, '21-2', 'steam-iron', 'Tshirt', '0', ''),
(189, 21, 2, '21-3', 'steam-iron', 'Tshirt', '0', ''),
(190, 21, 2, '21-4', 'steam-iron', 'Tshirt', '0', ''),
(191, 21, 2, '21-5', 'steam-iron', 'Tshirt', '0', ''),
(192, 21, 2, '21-6', 'spa', 'boot', '0', ''),
(193, 21, 2, '21-7', 'spa', 'boot', '0', ''),
(194, 21, 2, '21-8', 'spa', 'boot', '0', ''),
(195, 21, 2, '21-9', 'dryclean', 'cousion', '0', ''),
(196, 21, 2, '21-10', 'dryclean', 'cousion', '0', ''),
(197, 22, 3, '22-1', 'wash-iron', 'shirt', '0', ''),
(198, 22, 3, '22-2', 'wash-iron', 'shirt', '0', ''),
(199, 22, 3, '22-3', 'wash-iron', 'shirt', '0', ''),
(200, 22, 3, '22-4', 'wash-iron', 'shirt', '0', ''),
(201, 22, 3, '22-5', 'wash-iron', 'shirt', '0', ''),
(202, 22, 3, '22-6', 'steam-iron', 'Tshirt', '0', ''),
(203, 22, 3, '22-7', 'steam-iron', 'Tshirt', '0', ''),
(204, 22, 3, '22-8', 'steam-iron', 'Tshirt', '0', ''),
(205, 22, 3, '22-9', 'steam-iron', 'Tshirt', '0', ''),
(206, 22, 3, '22-10', 'steam-iron', 'Tshirt', '0', ''),
(207, 23, 4, '23-1', 'spa', 'formal- shoes', '1', ''),
(208, 23, 4, '23-2', 'spa', 'formal- shoes', '1', ''),
(209, 23, 4, '23-3', 'spa', 'formal- shoes', '1', ''),
(210, 23, 4, '23-4', 'spa', 'formal- shoes', '1', ''),
(211, 23, 4, '23-5', 'spa', 'formal- shoes', '1', ''),
(212, 30, 3, '30-1', 'dryclean', 'cousion', '0', ''),
(213, 30, 3, '30-2', 'dryclean', 'cousion', '0', ''),
(221, 33, 2, '33-1', 'spa', 'boot', '0', ''),
(222, 33, 2, '33-2', 'spa', 'boot', '0', ''),
(223, 33, 2, '33-3', 'spa', 'boot', '0', ''),
(224, 33, 2, '33-4', 'spa', 'boot', '0', ''),
(225, 33, 2, '33-5', 'spa', 'boot', '0', ''),
(226, 33, 2, '33-6', 'spa', 'boot', '0', ''),
(227, 33, 2, '33-7', 'spa', 'boot', '0', ''),
(228, 33, 2, '33-8', 'spa', 'boot', '0', ''),
(229, 33, 2, '33-9', 'spa', 'boot', '0', ''),
(230, 33, 2, '33-10', 'spa', 'boot', '0', ''),
(231, 33, 2, '33-11', 'spa', 'boot', '0', ''),
(232, 33, 2, '33-12', 'spa', 'boot', '0', ''),
(233, 33, 2, '33-13', 'spa', 'boot', '0', ''),
(234, 33, 2, '33-14', 'spa', 'boot', '0', ''),
(235, 33, 2, '33-15', 'spa', 'boot', '0', ''),
(236, 33, 2, '33-16', 'spa', 'boot', '0', ''),
(237, 33, 2, '33-17', 'spa', 'boot', '0', ''),
(238, 33, 2, '33-18', 'spa', 'boot', '0', ''),
(239, 33, 2, '33-19', 'spa', 'boot', '0', ''),
(240, 33, 2, '33-20', 'spa', 'boot', '0', ''),
(241, 33, 2, '33-21', 'spa', 'boot', '0', ''),
(242, 33, 2, '33-22', 'spa', 'boot', '0', ''),
(243, 33, 2, '33-23', 'spa', 'boot', '0', ''),
(244, 34, 2, '34-1', 'wash-iron', 'cousion', '0', ''),
(245, 34, 2, '34-2', 'wash-iron', 'cousion', '0', ''),
(246, 34, 2, '34-3', 'wash-iron', 'cousion', '0', ''),
(247, 34, 2, '34-4', 'wash-iron', 'cousion', '0', ''),
(248, 34, 2, '34-5', 'wash-iron', 'cousion', '0', ''),
(249, 34, 2, '34-6', 'wash-iron', 'cousion', '0', ''),
(250, 34, 2, '34-7', 'wash-iron', 'cousion', '0', ''),
(251, 34, 2, '34-8', 'wash-iron', 'cousion', '0', ''),
(252, 34, 2, '34-9', 'wash-iron', 'cousion', '0', ''),
(253, 34, 2, '34-10', 'wash-iron', 'cousion', '0', ''),
(254, 34, 2, '34-11', 'wash-iron', 'cousion', '0', ''),
(255, 34, 2, '34-12', 'wash-iron', 'cousion', '0', ''),
(256, 34, 2, '34-13', 'wash-iron', 'cousion', '0', ''),
(257, 34, 2, '34-14', 'wash-iron', 'cousion', '0', ''),
(258, 34, 2, '34-15', 'wash-iron', 'cousion', '0', ''),
(259, 34, 2, '34-16', 'wash-iron', 'cousion', '0', ''),
(260, 34, 2, '34-17', 'wash-iron', 'cousion', '0', ''),
(290, 35, 2, '35-1', 'dryclean', 'shirt', '0', ''),
(291, 35, 2, '35-2', 'dryclean', 'shirt', '0', ''),
(292, 35, 2, '35-3', 'dryclean', 'shirt', '0', ''),
(293, 35, 2, '35-4', 'dryclean', 'shirt', '0', ''),
(294, 35, 2, '35-5', 'dryclean', 'shirt', '0', ''),
(295, 35, 2, '35-6', 'dryclean', 'shirt', '0', ''),
(296, 35, 2, '35-7', 'dryclean', 'shirt', '0', ''),
(297, 35, 2, '35-8', 'dryclean', 'shirt', '0', ''),
(298, 35, 2, '35-9', 'dryclean', 'shirt', '0', ''),
(299, 35, 2, '35-10', 'dryclean', 'shirt', '0', ''),
(303, 32, 2, '32-1', 'steam-iron', 'Tshirt', '0', ''),
(304, 32, 2, '32-2', 'steam-iron', 'Tshirt', '0', ''),
(305, 32, 2, '32-3', 'steam-iron', 'Tshirt', '0', ''),
(306, 36, 1, '36-1', 'steam-iron', 'shirt', '0', ''),
(307, 36, 1, '36-2', 'steam-iron', 'shirt', '0', ''),
(308, 36, 1, '36-3', 'steam-iron', 'shirt', '0', ''),
(309, 36, 1, '36-4', 'steam-iron', 'shirt', '0', ''),
(310, 36, 1, '36-5', 'steam-iron', 'shirt', '0', ''),
(311, 36, 1, '36-6', 'steam-iron', 'shirt', '0', ''),
(312, 36, 1, '36-7', 'steam-iron', 'shirt', '0', ''),
(313, 36, 1, '36-8', 'steam-iron', 'shirt', '0', ''),
(314, 36, 1, '36-9', 'steam-iron', 'shirt', '0', ''),
(315, 36, 1, '36-10', 'steam-iron', 'shirt', '0', ''),
(325, 37, 20, '37-1', 'spa', 'boot', '0', 'ASD'),
(326, 37, 20, '37-2', 'spa', 'boot', '0', 'ASD');

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

--
-- Table structure for table `customer_membership`
--

CREATE TABLE `customer_membership` (
  `cmbsp_id` int(11) NOT NULL,
  `custid` int(11) NOT NULL,
  `ms_id` int(11) NOT NULL,
  `date` timestamp NOT NULL DEFAULT current_timestamp(),
  `ex_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `avl_price` int(11) NOT NULL,
  `avl_point` int(11) NOT NULL,
  `day_ex` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `customer_membership`
--

INSERT INTO `customer_membership` (`cmbsp_id`, `custid`, `ms_id`, `date`, `ex_date`, `avl_price`, `avl_point`, `day_ex`) VALUES
(1, 1, 1, '2020-11-09 19:46:35', '2020-11-10 07:46:43', 2000, 200, 90),
(2, 2, 2, '2020-11-09 19:49:36', '2021-02-08 07:49:41', 0, 0, 90),
(3, 15, 4, '2020-11-09 22:21:34', '2021-02-08 10:21:48', 8000, 1500, 90);

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

--
-- Table structure for table `invoice`
--

CREATE TABLE `invoice` (
  `inv_id` int(11) NOT NULL,
  `cust_id` int(11) NOT NULL,
  `total_pic` smallint(10) NOT NULL,
  `date` timestamp NOT NULL DEFAULT current_timestamp(),
  `due_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `price` int(11) NOT NULL,
  `discount` int(11) NOT NULL,
  `net` int(11) NOT NULL,
  `payment_due` int(11) NOT NULL,
  `paid` int(11) NOT NULL,
  `payment_type` enum('0','1','2','3','4','5','6') NOT NULL COMMENT '0:pandding,1:cash,2:card,3:bank,4:gpay,5:Price,6:Point\r\n',
  `payment_status` enum('0','1') NOT NULL COMMENT '0:unpaid,1:paid',
  `cancle` enum('0','1') NOT NULL COMMENT '0:no,1:yes',
  `status` enum('0','1','2','3') NOT NULL COMMENT '0:unprocces 1:inprogress,2:ready,3:deliverd',
  `m_price` int(11) NOT NULL,
  `m_point` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `invoice`
--

INSERT INTO `invoice` (`inv_id`, `cust_id`, `total_pic`, `date`, `due_date`, `price`, `discount`, `net`, `payment_due`, `paid`, `payment_type`, `payment_status`, `cancle`, `status`, `m_price`, `m_point`) VALUES
(21, 2, 10, '2020-11-04 00:51:41', '2020-11-07 00:51:41', 585, 20, 565, 0, 565, '0', '1', '0', '1', 0, 0),
(22, 3, 10, '2020-11-04 00:56:27', '2020-11-07 00:56:27', 160, 50, 110, 0, 110, '1', '1', '0', '1', 0, 0),
(23, 4, 5, '2020-11-04 01:58:17', '2020-11-05 03:40:00', 750, 12, 738, 738, 0, '0', '0', '1', '1', 0, 0),
(30, 3, 2, '2020-11-06 00:07:38', '2020-11-06 06:30:00', 100, 0, 100, 100, 0, '0', '0', '0', '0', 0, 0),
(32, 2, 3, '2020-11-10 02:23:11', '2020-11-10 06:30:00', 15, 0, 15, 15, 0, '0', '0', '0', '0', 0, 0),
(33, 2, 23, '2020-11-11 05:56:37', '2020-11-11 06:30:00', 3450, 0, 3450, 0, 3450, '5', '1', '0', '0', 3450, 0),
(34, 2, 17, '2020-11-11 06:06:44', '2020-11-11 06:30:00', 425, 0, 425, 0, 425, '5', '1', '0', '0', 425, 0),
(35, 2, 10, '2020-11-11 06:08:14', '2020-11-11 06:30:00', 500, 0, 500, 0, 500, '6', '1', '0', '0', 0, 500),
(36, 1, 10, '2020-11-10 20:22:41', '2020-11-11 06:30:00', 60, 0, 60, 60, 0, '0', '0', '0', '0', 0, 0),
(37, 20, 2, '2020-11-10 23:32:51', '2020-11-11 06:30:00', 300, 0, 300, 300, 0, '0', '0', '0', '0', 0, 0);

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

--
-- Table structure for table `iteam_price`
--

CREATE TABLE `iteam_price` (
  `ip_id` int(11) NOT NULL,
  `type` varchar(15) NOT NULL,
  `service` varchar(50) NOT NULL,
  `cloth_type` varchar(15) NOT NULL,
  `price` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `iteam_price`
--

INSERT INTO `iteam_price` (`ip_id`, `type`, `service`, `cloth_type`, `price`) VALUES
(1, 'men', 'steam-iron', 'Tshirt', '7'),
(2, 'men', 'wash-iron', 'Tshirt', '25'),
(3, 'men', 'dryclean', 'Tshirt', '50'),
(4, 'woman', 'steam-iron', 'Tshirt', '7'),
(5, 'woman', 'wash-iron', 'Tshirt', '25'),
(6, 'woman', 'dryclean', 'Tshirt', '50'),
(7, 'kids', 'steam-iron', 'Tshirt', '5'),
(8, 'kids', 'wash-iron', 'Tshirt', '25'),
(9, 'kids', 'dryclean', 'Tshirt', '50'),
(10, 'shoes-spa', 'spa', 'shoes', '150'),
(11, 'shoes-spa', 'spa', 'formal- shoes', '150'),
(12, 'household', 'steam-iron', 'bedsheet', '15'),
(13, 'household', 'wash-iron', 'bedsheet', '50'),
(14, 'household', 'dryclean', 'bedsheet', '90'),
(15, 'men', 'steam-iron', 'shirt', '7'),
(16, 'men', 'wash-iron', 'shirt', '25'),
(17, 'men', 'dryclean', 'shirt', '50'),
(18, 'woman', 'steam-iron', 'shirt', '7'),
(19, 'woman', 'wash-iron', 'shirt', '25'),
(20, 'woman', 'dryclean', 'shirt', '50'),
(21, 'kids', 'steam-iron', 'shirt', '5'),
(22, 'kids', 'wash-iron', 'shirt', '25'),
(23, 'kids', 'dryclean', 'shirt', '50'),
(24, 'shoes-spa', 'spa', 'boot', '150'),
(25, 'shoes-spa', 'spa', 'sandal', '150'),
(26, 'household', 'steam-iron', 'cousion', '7'),
(27, 'household', 'wash-iron', 'cousion', '25'),
(28, 'household', 'dryclean', 'cousion', '50');

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

--
-- Table structure for table `membership`
--

CREATE TABLE `membership` (
  `mbs_id` int(11) NOT NULL,
  `mbsp_amount` int(11) NOT NULL,
  `validity` varchar(50) NOT NULL,
  `price` int(11) NOT NULL,
  `point` int(11) NOT NULL,
  `service` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `membership`
--

INSERT INTO `membership` (`mbs_id`, `mbsp_amount`, `validity`, `price`, `point`, `service`) VALUES
(1, 2000, '3-month', 2000, 200, '2200'),
(2, 4000, '3-month', 4000, 500, '4500'),
(3, 6000, '3-month', 6000, 800, '6800'),
(4, 8000, '3-month', 8000, 1500, '9500');

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

--
-- Table structure for table `migration`
--

CREATE TABLE `migration` (
  `version` varchar(180) NOT NULL,
  `apply_time` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `migration`
--

INSERT INTO `migration` (`version`, `apply_time`) VALUES
('m000000_000000_base', 1602412342),
('m130524_201442_init', 1602412347),
('m160516_095943_init', 1602943074),
('m161109_124936_rename_cart_table', 1602943074),
('m161119_153348_alter_cart_data', 1602943076),
('m190124_110200_add_verification_token_column_to_user_table', 1602412347);

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

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

CREATE TABLE `notification` (
  `n_id` int(11) NOT NULL,
  `type` enum('1','2') NOT NULL COMMENT '1:birthday,2:order',
  `receivear` int(11) NOT NULL,
  `content` varchar(255) NOT NULL,
  `status` enum('0','1') NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `order_detail`
--

CREATE TABLE `order_detail` (
  `oid` int(11) NOT NULL,
  `custid` int(11) NOT NULL,
  `invid` int(11) NOT NULL,
  `type` varchar(50) NOT NULL,
  `service` varchar(50) NOT NULL,
  `product` varchar(30) NOT NULL,
  `price` int(11) NOT NULL,
  `no_iteam` smallint(10) NOT NULL,
  `total_price` mediumint(30) NOT NULL,
  `ip_id` int(11) NOT NULL,
  `remarks` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `order_detail`
--

INSERT INTO `order_detail` (`oid`, `custid`, `invid`, `type`, `service`, `product`, `price`, `no_iteam`, `total_price`, `ip_id`, `remarks`) VALUES
(39, 2, 21, 'men', 'steam-iron', 'Tshirt', 7, 5, 35, 1, ''),
(40, 2, 21, 'shoes-spa', 'spa', 'boot', 150, 3, 450, 24, ''),
(41, 2, 21, 'household', 'dryclean', 'cousion', 50, 2, 100, 28, ''),
(42, 3, 22, 'kids', 'wash-iron', 'shirt', 25, 5, 125, 22, ''),
(43, 3, 22, 'men', 'steam-iron', 'Tshirt', 7, 5, 35, 1, ''),
(44, 4, 23, 'shoes-spa', 'spa', 'formal shoes', 150, 5, 750, 11, ''),
(48, 3, 30, 'household', 'dryclean', 'cousion', 50, 2, 100, 28, ''),
(50, 2, 32, 'kids', 'steam-iron', 'Tshirt', 5, 3, 15, 7, ''),
(51, 2, 33, 'shoes-spa', 'spa', 'boot', 150, 23, 3450, 24, ''),
(52, 2, 34, 'household', 'wash-iron', 'cousion', 25, 17, 425, 27, ''),
(53, 2, 35, 'men', 'dryclean', 'shirt', 50, 10, 500, 17, ''),
(54, 1, 36, 'men', 'steam-iron', 'shirt', 7, 5, 35, 15, '123'),
(55, 1, 36, 'kids', 'steam-iron', 'shirt', 5, 5, 25, 21, ''),
(56, 20, 37, 'shoes-spa', 'spa', 'boot', 150, 2, 300, 24, 'ASD');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `barcode`
--
ALTER TABLE `barcode`
  ADD PRIMARY KEY (`b_id`),
  ADD KEY `invid` (`invid`),
  ADD KEY `custid` (`custid`);

--
-- Indexes for table `customer_membership`
--
ALTER TABLE `customer_membership`
  ADD PRIMARY KEY (`cmbsp_id`),
  ADD KEY `custid` (`custid`),
  ADD KEY `ms_id` (`ms_id`);

--
-- Indexes for table `invoice`
--
ALTER TABLE `invoice`
  ADD PRIMARY KEY (`inv_id`),
  ADD KEY `cust_id` (`cust_id`);

--
-- Indexes for table `iteam_price`
--
ALTER TABLE `iteam_price`
  ADD PRIMARY KEY (`ip_id`);

--
-- Indexes for table `membership`
--
ALTER TABLE `membership`
  ADD PRIMARY KEY (`mbs_id`);

--
-- Indexes for table `migration`
--
ALTER TABLE `migration`
  ADD PRIMARY KEY (`version`);

--
-- Indexes for table `notification`
--
ALTER TABLE `notification`
  ADD PRIMARY KEY (`n_id`);

--
-- Indexes for table `order_detail`
--
ALTER TABLE `order_detail`
  ADD PRIMARY KEY (`oid`),
  ADD KEY `custid` (`custid`),
  ADD KEY `ip_id` (`ip_id`),
  ADD KEY `order_detail_ibfk_2` (`invid`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `barcode`
--
ALTER TABLE `barcode`
  MODIFY `b_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=327;

--
-- AUTO_INCREMENT for table `customer_membership`
--
ALTER TABLE `customer_membership`
  MODIFY `cmbsp_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `invoice`
--
ALTER TABLE `invoice`
  MODIFY `inv_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38;

--
-- AUTO_INCREMENT for table `iteam_price`
--
ALTER TABLE `iteam_price`
  MODIFY `ip_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;

--
-- AUTO_INCREMENT for table `membership`
--
ALTER TABLE `membership`
  MODIFY `mbs_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `notification`
--
ALTER TABLE `notification`
  MODIFY `n_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `order_detail`
--
ALTER TABLE `order_detail`
  MODIFY `oid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=57;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `barcode`
--
ALTER TABLE `barcode`
  ADD CONSTRAINT `barcode_ibfk_1` FOREIGN KEY (`invid`) REFERENCES `invoice` (`inv_id`),
  ADD CONSTRAINT `barcode_ibfk_2` FOREIGN KEY (`custid`) REFERENCES `customer_detail` (`id`);

--
-- Constraints for table `customer_membership`
--
ALTER TABLE `customer_membership`
  ADD CONSTRAINT `customer_membership_ibfk_1` FOREIGN KEY (`custid`) REFERENCES `customer_detail` (`id`),
  ADD CONSTRAINT `customer_membership_ibfk_2` FOREIGN KEY (`ms_id`) REFERENCES `membership` (`mbs_id`);

--
-- Constraints for table `invoice`
--
ALTER TABLE `invoice`
  ADD CONSTRAINT `invoice_ibfk_1` FOREIGN KEY (`cust_id`) REFERENCES `customer_detail` (`id`);

--
-- Constraints for table `order_detail`
--
ALTER TABLE `order_detail`
  ADD CONSTRAINT `order_detail_ibfk_1` FOREIGN KEY (`custid`) REFERENCES `customer_detail` (`id`),
  ADD CONSTRAINT `order_detail_ibfk_2` FOREIGN KEY (`invid`) REFERENCES `invoice` (`inv_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `order_detail_ibfk_3` FOREIGN KEY (`ip_id`) REFERENCES `iteam_price` (`ip_id`);
COMMIT;

