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

--
-- Table structure for table `qc_user_embroideries`
--

CREATE TABLE `qc_user_embroideries` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `design_id` varchar(50) DEFAULT NULL,
  `file_name` varchar(100) NOT NULL,
  `query` text NOT NULL,
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `qc_user_embroideries`
--

INSERT INTO `qc_user_embroideries` (`id`, `user_id`, `design_id`, `file_name`, `query`, `created`, `updated`) VALUES
(4, 1, 'JWXEGD1I', '1560595995.png', 'cg nf fgj gj rtj rt jdfgh duk fghn fhj mfghm fgh mfghm fghn', '2019-06-15 10:53:15', NULL);

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

--
-- Table structure for table `qc_user_expense`
--

CREATE TABLE `qc_user_expense` (
  `id` int(10) NOT NULL,
  `user_id` int(10) NOT NULL,
  `user_name` varchar(100) DEFAULT NULL,
  `expense_date` timestamp NULL DEFAULT NULL,
  `amount` float NOT NULL DEFAULT '0',
  `description` longtext,
  `monthly_or_not` int(2) NOT NULL DEFAULT '0',
  `monthly_date` varchar(10) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `qc_user_reports`
--

CREATE TABLE `qc_user_reports` (
  `id` int(10) NOT NULL,
  `user_id` int(11) NOT NULL,
  `order_id` int(20) UNSIGNED NOT NULL DEFAULT '0',
  `order_product_id` int(20) UNSIGNED NOT NULL DEFAULT '0',
  `order_sku` varchar(50) DEFAULT NULL,
  `qty` int(5) NOT NULL DEFAULT '0',
  `size` varchar(5) DEFAULT NULL,
  `design_id` int(10) NOT NULL DEFAULT '0',
  `design_sku` varchar(50) DEFAULT NULL,
  `product_id` int(10) NOT NULL DEFAULT '0',
  `product_name` varchar(100) DEFAULT NULL,
  `sale_price` float NOT NULL DEFAULT '0',
  `price_per_product` float NOT NULL DEFAULT '0',
  `total_cost` float NOT NULL DEFAULT '0',
  `margin` float NOT NULL DEFAULT '0',
  `upload_share` float NOT NULL DEFAULT '0',
  `upload_fee` float NOT NULL DEFAULT '0',
  `upload_fee_plus_vat` float NOT NULL DEFAULT '0',
  `goods_fee` float NOT NULL DEFAULT '0',
  `profit` float NOT NULL DEFAULT '0',
  `monthly_date` varchar(10) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `qc_user_reports`
--

INSERT INTO `qc_user_reports` (`id`, `user_id`, `order_id`, `order_product_id`, `order_sku`, `qty`, `size`, `design_id`, `design_sku`, `product_id`, `product_name`, `sale_price`, `price_per_product`, `total_cost`, `margin`, `upload_share`, `upload_fee`, `upload_fee_plus_vat`, `goods_fee`, `profit`, `monthly_date`, `created`, `updated`) VALUES
(852, 6, 12814, 13455, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'July 2019', '2019-07-01 17:05:11', NULL),
(853, 6, 12815, 13456, 'TWO/001', 2, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 6.04, 13.94, 40, 5.58, 6.7, 7.25, 6.03, 'July 2019', '2019-07-01 14:26:55', NULL),
(854, 6, 12816, 13457, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-07-01 02:05:58', NULL),
(855, 6, 12817, 13458, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-30 17:20:32', NULL),
(856, 6, 12818, 13459, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-30 05:06:28', NULL),
(857, 6, 12819, 13460, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-30 01:39:17', NULL),
(858, 6, 12820, 13461, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-29 02:09:23', NULL),
(859, 6, 12821, 13462, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-27 18:55:40', NULL),
(860, 6, 12822, 13463, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-27 07:38:22', NULL),
(861, 6, 12824, 13465, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-27 03:38:15', NULL),
(862, 6, 12826, 13467, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-26 02:42:38', NULL),
(863, 6, 12828, 13469, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-25 22:19:27', NULL),
(864, 6, 12829, 13470, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-25 05:12:22', NULL),
(865, 6, 12830, 13471, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-25 01:46:13', NULL),
(866, 6, 12832, 13473, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-24 02:02:05', NULL),
(867, 6, 12833, 13474, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-23 19:14:56', NULL),
(868, 6, 12834, 13475, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-23 16:31:50', NULL),
(869, 6, 12835, 13476, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-23 16:20:26', NULL),
(870, 6, 12836, 13478, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-23 04:39:27', NULL),
(871, 6, 12837, 13479, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-22 19:26:40', NULL),
(872, 6, 12839, 13482, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-22 01:17:11', NULL),
(873, 6, 12859, 13502, 'TWO/003/S', 1, 'S', 6, 'GILDAN4100/WHITE', 15, 'Gildan Premium', 21, 1.78, 11.44, 9.56, 40, 3.82, 4.58, 13.73, 2.24, 'June 2019', '2019-06-17 17:45:54', NULL),
(874, 6, 12860, 13503, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-17 15:12:23', NULL),
(875, 6, 12861, 13504, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-17 05:32:08', NULL),
(876, 6, 12862, 13505, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-17 04:25:32', NULL),
(877, 6, 12863, 13506, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-17 03:16:19', NULL),
(878, 6, 12864, 13507, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-17 02:31:42', NULL),
(879, 6, 12865, 13508, 'TWO/003/M', 1, 'M', 6, 'GILDAN4100/WHITE', 15, 'Gildan Premium', 21, 1.78, 11.44, 9.56, 40, 3.82, 4.58, 13.73, 2.69, 'June 2019', '2019-06-17 02:12:52', NULL),
(880, 6, 12866, 13509, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-17 00:50:33', NULL),
(881, 6, 12867, 13510, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-17 00:39:55', NULL),
(882, 6, 12868, 13511, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-17 00:36:21', NULL),
(883, 6, 12869, 13512, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-16 23:24:11', NULL),
(884, 6, 12870, 13513, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-16 22:02:49', NULL),
(885, 6, 12871, 13514, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-16 17:11:44', NULL),
(886, 6, 12872, 13515, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-16 16:25:30', NULL),
(887, 6, 12873, 13516, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-16 15:47:57', NULL),
(888, 6, 12874, 13517, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-16 09:01:16', NULL),
(889, 6, 12875, 13518, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-16 04:39:53', NULL),
(890, 6, 12876, 13519, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-16 03:41:43', NULL),
(891, 6, 12877, 13520, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-16 02:58:28', NULL),
(892, 6, 12878, 13521, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-16 02:27:58', NULL),
(893, 6, 12879, 13522, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-16 02:24:43', NULL),
(894, 6, 12880, 13523, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-16 02:11:37', NULL),
(895, 6, 12881, 13524, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-16 01:37:20', NULL),
(896, 6, 12882, 13525, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-16 01:20:46', NULL),
(897, 6, 12883, 13526, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-16 01:20:31', NULL),
(898, 6, 12884, 13527, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-16 01:07:15', NULL),
(899, 6, 12885, 13528, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-16 01:01:24', NULL),
(900, 6, 12886, 13529, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-16 00:34:44', NULL),
(901, 6, 12887, 13530, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-16 00:02:04', NULL),
(902, 6, 12887, 13531, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-16 00:02:04', NULL),
(903, 6, 12888, 13532, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-15 23:39:53', NULL),
(904, 6, 12889, 13533, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-15 22:45:18', NULL),
(905, 6, 12890, 13534, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-15 22:21:15', NULL),
(906, 6, 12891, 13535, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-15 22:20:03', NULL),
(907, 6, 12892, 13536, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-15 22:11:20', NULL),
(908, 6, 12893, 13537, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 3.02, 'June 2019', '2019-06-15 22:01:33', NULL),
(909, 6, 12894, 13538, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-15 21:57:26', NULL),
(910, 6, 12895, 13539, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-15 21:54:49', NULL),
(911, 6, 12896, 13540, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 3.02, 'June 2019', '2019-06-15 21:40:02', NULL),
(912, 6, 12897, 13541, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-15 21:18:53', NULL),
(913, 6, 12898, 13542, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-15 21:15:42', NULL),
(914, 6, 12899, 13543, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-15 21:02:36', NULL),
(915, 6, 12900, 13544, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-15 20:21:04', NULL),
(916, 6, 12901, 13545, 'TWO/003/M', 1, 'M', 6, 'GILDAN4100/WHITE', 15, 'Gildan Premium', 21, 1.78, 11.44, 9.56, 40, 3.82, 4.58, 13.73, 2.69, 'June 2019', '2019-06-15 12:05:55', NULL),
(917, 6, 12901, 13546, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 3.02, 'June 2019', '2019-06-15 12:05:55', NULL),
(918, 6, 12902, 13547, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-15 05:28:49', NULL),
(919, 6, 12903, 13548, 'TWO/002', 2, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 6.04, 13.94, 40, 5.58, 6.7, 7.25, 5.03, 'June 2019', '2019-06-15 05:16:36', NULL),
(920, 6, 12904, 13549, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-15 03:54:53', NULL),
(921, 6, 12905, 13550, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-15 03:34:06', NULL),
(922, 6, 12906, 13551, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-15 03:31:36', NULL),
(923, 6, 12907, 13552, 'TWO/002', 1, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-15 02:57:21', NULL),
(924, 6, 12908, 13553, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-15 02:50:26', NULL),
(925, 6, 12909, 13554, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-15 02:43:00', NULL),
(926, 6, 12910, 13555, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-15 02:41:20', NULL),
(927, 6, 12911, 13556, 'TWO/002', 2, 'Defau', 5, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 6.04, 13.94, 40, 5.58, 6.7, 7.25, 5.03, 'June 2019', '2019-06-15 02:40:26', NULL),
(928, 6, 12912, 13557, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-15 02:15:16', NULL),
(929, 6, 12913, 13558, 'TWO/001', 1, 'Defau', 4, 'MUG/WHITE', 18, 'Standard Mug', 9.99, 0.6, 3.02, 6.97, 40, 2.79, 3.35, 3.62, 2.51, 'June 2019', '2019-06-15 02:03:15', NULL),
(930, 6, 12914, 13559, 'TWO/003/M', 1, 'M', 6, 'GILDAN4100/WHITE', 15, 'Gildan Premium', 21, 1.78, 11.44, 9.56, 40, 3.82, 4.58, 13.73, 2.24, 'June 2019', '2019-06-15 01:57:26', NULL),
(952, 1, 57314, 59792, 'DEEP/004', 1, 'Defau', 8, 'MUG/WHITE', 18, 'Standard Mug', 8.33, 0.9, 3.32, 5.01, 60, 3.01, 3.61, 3.98, 0.74, 'July 2019', '2019-07-01 22:07:59', NULL),
(953, 1, 57316, 59794, 'DEEP/003/L', 1, 'L', 7, 'GILDAN4100/WHITE', 15, 'Gildan Premium', 29.17, 1.78, 11.44, 17.73, 60, 10.64, 12.77, 13.73, 2.67, 'June 2019', '2019-06-29 15:32:36', NULL),
(954, 1, 57317, 59795, 'DEEP/003/S', 1, 'S', 7, 'GILDAN4100/WHITE', 15, 'Gildan Premium', 29.17, 1.78, 11.44, 17.73, 60, 10.64, 12.77, 13.73, 2.67, 'June 2019', '2019-06-29 13:40:01', NULL),
(955, 1, 57318, 59796, 'DEEP/003/XL', 1, 'XL', 7, 'GILDAN4100/WHITE', 15, 'Gildan Premium', 17.5, 1.78, 11.44, 6.06, 60, 3.64, 4.37, 13.73, -0.6, 'June 2019', '2019-06-28 19:11:31', NULL),
(956, 1, 57319, 59797, 'DEEP/003/L', 1, 'L', 7, 'GILDAN4100/WHITE', 15, 'Gildan Premium', 17.5, 1.78, 11.44, 6.06, 60, 3.64, 4.37, 13.73, -0.6, 'June 2019', '2019-06-28 19:10:27', NULL),
(957, 1, 57320, 59798, 'DEEP/003/M', 1, 'M', 7, 'GILDAN4100/WHITE', 15, 'Gildan Premium', 17.5, 1.78, 11.44, 6.06, 60, 3.64, 4.37, 13.73, -0.6, 'June 2019', '2019-06-28 19:09:11', NULL),
(958, 1, 57321, 59799, 'DEEP/003/S', 1, 'S', 7, 'GILDAN4100/WHITE', 15, 'Gildan Premium', 17.5, 1.78, 11.44, 6.06, 60, 3.64, 4.37, 13.73, -0.6, 'June 2019', '2019-06-28 18:50:30', NULL);

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

--
-- Table structure for table `qc_user_review`
--

CREATE TABLE `qc_user_review` (
  `id` int(10) NOT NULL,
  `user_id` int(10) NOT NULL,
  `user_full_name` varchar(50) DEFAULT NULL,
  `product_id` int(10) NOT NULL DEFAULT '0',
  `design_id` int(10) NOT NULL DEFAULT '0',
  `stars` int(2) NOT NULL DEFAULT '0',
  `title` varchar(50) DEFAULT NULL,
  `description` varchar(500) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `qc_user_review`
--

INSERT INTO `qc_user_review` (`id`, `user_id`, `user_full_name`, `product_id`, `design_id`, `stars`, `title`, `description`, `created`, `updated`) VALUES
(1, 1, 'deep rathod', 15, 0, 4, 'good', 'test test test', '2019-08-30 14:19:09', '2019-08-31 05:31:20'),
(2, 1, 'deep rathod', 14, 0, 4, 'good', 'test test', '2019-08-30 14:19:33', '2019-08-31 05:55:07'),
(3, 12, 'mayur devmurari', 15, 0, 4, 'saras', 'test', '2019-08-31 05:33:25', '2019-08-31 05:55:10'),
(4, 4, 'Memeulous', 15, 0, 3, 'good', 'test', '2019-08-31 05:33:25', '2019-08-31 05:56:33'),
(6, 6, 'John Duo', 15, 0, 5, 'saras', 'test', '2019-08-31 05:36:32', '2019-08-31 05:56:12'),
(7, 7, 'John Duo', 15, 0, 5, 'saras', 'test', '2019-08-31 05:36:32', '2019-08-31 05:56:05'),
(8, 8, 'John Duo', 14, 0, 5, 'saras', 'test', '2019-08-31 05:36:32', '2019-08-31 07:55:29'),
(9, 10, 'John Duo', 14, 0, 3, 'saras', 'test', '2019-08-31 05:36:32', '2019-08-31 07:51:12'),
(10, 11, 'John Duo', 14, 0, 2, 'saras', 'test', '2019-08-31 05:36:32', '2019-08-31 07:40:42'),
(11, 5, 'John Duo', 14, 0, 1, 'good', 'test', '2019-08-31 05:36:32', '2019-08-31 07:50:20'),
(13, 3, NULL, 15, 0, 3, 'good', 'test', '2019-08-31 07:20:28', NULL),
(14, 3, NULL, 14, 0, 4, 'good', NULL, '2019-08-31 07:33:21', NULL);

--
-- Triggers `qc_user_review`
--
DELIMITER $$
CREATE TRIGGER `calculate_review_after_insert` AFTER INSERT ON `qc_user_review` FOR EACH ROW BEGIN
	DECLARE review_count varchar(10);
    DECLARE review_sum varchar(10);
    SET review_count = 0;
    SET review_sum = 0;
    
	 IF (NEW.design_id = 0) THEN
     	
        SELECT 
        ROUND(AVG(stars), 1) INTO review_count
        FROM qc_user_review
        WHERE product_id = NEW.product_id;
        
        UPDATE qc_products
        SET review = review_count
        WHERE id = NEW.product_id;
     END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `calculate_review_after_update` AFTER UPDATE ON `qc_user_review` FOR EACH ROW BEGIN
	DECLARE review_count varchar(10);
    SET review_count = 0;
    
	 IF (NEW.design_id = 0) THEN
        SELECT 
        ROUND(AVG(stars), 1) INTO review_count
        FROM qc_user_review
        WHERE product_id = NEW.product_id;
        
        UPDATE qc_products
        SET review = review_count
        WHERE id = NEW.product_id;
     END IF;
END
$$
DELIMITER ;

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

--
-- Table structure for table `qc_user_tokens`
--

CREATE TABLE `qc_user_tokens` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `token` varchar(255) NOT NULL,
  `is_active` int(11) NOT NULL DEFAULT '1',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `countrycodes`
--
ALTER TABLE `countrycodes`
  ADD PRIMARY KEY (`cid`);

--
-- Indexes for table `postagelabels`
--
ALTER TABLE `postagelabels`
  ADD PRIMARY KEY (`pid`);

--
-- Indexes for table `qc_add_delivery`
--
ALTER TABLE `qc_add_delivery`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_delivery_variation_id` (`variation_id`);

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

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

--
-- Indexes for table `qc_admin_users_groups`
--
ALTER TABLE `qc_admin_users_groups`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uc_users_groups` (`user_id`,`group_id`),
  ADD KEY `fk_users_groups_users1_idx` (`user_id`),
  ADD KEY `fk_users_groups_groups1_idx` (`group_id`);

--
-- Indexes for table `qc_bugs`
--
ALTER TABLE `qc_bugs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id` (`id`),
  ADD KEY `status` (`status`),
  ADD KEY `created` (`created`),
  ADD KEY `updated` (`updated`),
  ADD KEY `fk_user_other_request_id` (`user_id`);

--
-- Indexes for table `qc_cart`
--
ALTER TABLE `qc_cart`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_cart_product_id` (`product_id`),
  ADD KEY `fk_cart_user_id` (`user_id`);

--
-- Indexes for table `qc_categories`
--
ALTER TABLE `qc_categories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id` (`id`),
  ADD KEY `parent` (`parent`),
  ADD KEY `active` (`active`),
  ADD KEY `order` (`order`);

--
-- Indexes for table `qc_categories_reference`
--
ALTER TABLE `qc_categories_reference`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id` (`id`),
  ADD KEY `category_id` (`category_id`),
  ADD KEY `item_id` (`item_id`);

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

--
-- Indexes for table `qc_cliparts`
--
ALTER TABLE `qc_cliparts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id` (`id`),
  ADD KEY `price` (`price`),
  ADD KEY `active` (`active`),
  ADD KEY `created` (`created`),
  ADD KEY `order` (`order`),
  ADD KEY `updated` (`updated`);

--
-- Indexes for table `qc_designs`
--
ALTER TABLE `qc_designs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id` (`id`),
  ADD KEY `aid` (`aid`),
  ADD KEY `pid` (`pid`),
  ADD KEY `active` (`active`),
  ADD KEY `created` (`created`),
  ADD KEY `updated` (`updated`);

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

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

--
-- Indexes for table `qc_fonts`
--
ALTER TABLE `qc_fonts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id` (`id`),
  ADD KEY `active` (`active`),
  ADD KEY `created` (`created`),
  ADD KEY `updated` (`updated`);

--
-- Indexes for table `qc_guests`
--
ALTER TABLE `qc_guests`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id` (`id`),
  ADD KEY `phone` (`phone`),
  ADD KEY `created` (`created`),
  ADD KEY `updated` (`updated`);

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

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

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

--
-- Indexes for table `qc_orders`
--
ALTER TABLE `qc_orders`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id` (`id`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `updated` (`updated`),
  ADD KEY `created` (`created`),
  ADD KEY `fk_shopify_store_id` (`store_id`);

--
-- Indexes for table `qc_order_products`
--
ALTER TABLE `qc_order_products`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id` (`id`),
  ADD KEY `product_id` (`product_id`),
  ADD KEY `product_base` (`product_base`),
  ADD KEY `created` (`created`),
  ADD KEY `updated` (`updated`),
  ADD KEY `fk_order_id` (`order_id`);

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

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

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

--
-- Indexes for table `qc_printings`
--
ALTER TABLE `qc_printings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id` (`id`),
  ADD KEY `active` (`active`),
  ADD KEY `created` (`created`),
  ADD KEY `updated` (`updated`);

--
-- Indexes for table `qc_products`
--
ALTER TABLE `qc_products`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id` (`id`),
  ADD KEY `price` (`price`),
  ADD KEY `product` (`product`),
  ADD KEY `active` (`active`),
  ADD KEY `order` (`order`),
  ADD KEY `created` (`created`),
  ADD KEY `updated` (`updated`);

--
-- Indexes for table `qc_product_attributes`
--
ALTER TABLE `qc_product_attributes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `product_id` (`product_id`);

--
-- Indexes for table `qc_product_variations`
--
ALTER TABLE `qc_product_variations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_product_variation_id` (`product_id`);

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

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

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

--
-- Indexes for table `qc_shapes`
--
ALTER TABLE `qc_shapes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id` (`id`),
  ADD KEY `active` (`active`);

--
-- Indexes for table `qc_shares`
--
ALTER TABLE `qc_shares`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id` (`id`),
  ADD KEY `product` (`product`),
  ADD KEY `product_cms` (`product_cms`),
  ADD KEY `active` (`active`),
  ADD KEY `created` (`created`);

--
-- Indexes for table `qc_shopify_products`
--
ALTER TABLE `qc_shopify_products`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id` (`id`),
  ADD KEY `fk_design_shopify_product_id` (`design_id`);

--
-- Indexes for table `qc_shopify_stores`
--
ALTER TABLE `qc_shopify_stores`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_user_store_id` (`user_id`);

--
-- Indexes for table `qc_shopify_variants`
--
ALTER TABLE `qc_shopify_variants`
  ADD PRIMARY KEY (`id`),
  ADD KEY `shopify_product_id` (`shopify_product_id`);

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

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

--
-- Indexes for table `qc_templates`
--
ALTER TABLE `qc_templates`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id` (`id`),
  ADD KEY `created` (`created`),
  ADD KEY `price` (`price`),
  ADD KEY `featured` (`featured`);

--
-- Indexes for table `qc_user_designs`
--
ALTER TABLE `qc_user_designs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_user_design_id` (`user_id`);

--
-- Indexes for table `qc_user_embroideries`
--
ALTER TABLE `qc_user_embroideries`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_user_embro_id` (`user_id`);

--
-- Indexes for table `qc_user_expense`
--
ALTER TABLE `qc_user_expense`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_user_expense_id` (`user_id`);

--
-- Indexes for table `qc_user_reports`
--
ALTER TABLE `qc_user_reports`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_user_report_id` (`user_id`),
  ADD KEY `fk_order_report_id` (`order_id`),
  ADD KEY `fk_order_product_report_id` (`order_product_id`);

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

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `countrycodes`
--
ALTER TABLE `countrycodes`
  MODIFY `cid` int(3) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=249;

--
-- AUTO_INCREMENT for table `postagelabels`
--
ALTER TABLE `postagelabels`
  MODIFY `pid` int(7) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4573;

--
-- AUTO_INCREMENT for table `qc_add_delivery`
--
ALTER TABLE `qc_add_delivery`
  MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `qc_admin_groups`
--
ALTER TABLE `qc_admin_groups`
  MODIFY `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `qc_admin_login_attempts`
--
ALTER TABLE `qc_admin_login_attempts`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `qc_admin_users_groups`
--
ALTER TABLE `qc_admin_users_groups`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

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

--
-- AUTO_INCREMENT for table `qc_cart`
--
ALTER TABLE `qc_cart`
  MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

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

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

--
-- AUTO_INCREMENT for table `qc_category_products`
--
ALTER TABLE `qc_category_products`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `qc_cliparts`
--
ALTER TABLE `qc_cliparts`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `qc_designs`
--
ALTER TABLE `qc_designs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `qc_designs_category_reference`
--
ALTER TABLE `qc_designs_category_reference`
  MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `qc_eligible_country`
--
ALTER TABLE `qc_eligible_country`
  MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=251;

--
-- AUTO_INCREMENT for table `qc_fonts`
--
ALTER TABLE `qc_fonts`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

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

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

--
-- AUTO_INCREMENT for table `qc_languages`
--
ALTER TABLE `qc_languages`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

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

--
-- AUTO_INCREMENT for table `qc_orders`
--
ALTER TABLE `qc_orders`
  MODIFY `id` int(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=57323;

--
-- AUTO_INCREMENT for table `qc_order_products`
--
ALTER TABLE `qc_order_products`
  MODIFY `id` int(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Primary Id', AUTO_INCREMENT=59802;

--
-- AUTO_INCREMENT for table `qc_pages`
--
ALTER TABLE `qc_pages`
  MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;

--
-- AUTO_INCREMENT for table `qc_post`
--
ALTER TABLE `qc_post`
  MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `qc_post_meta`
--
ALTER TABLE `qc_post_meta`
  MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;

--
-- AUTO_INCREMENT for table `qc_printings`
--
ALTER TABLE `qc_printings`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `qc_products`
--
ALTER TABLE `qc_products`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;

--
-- AUTO_INCREMENT for table `qc_product_attributes`
--
ALTER TABLE `qc_product_attributes`
  MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `qc_product_variations`
--
ALTER TABLE `qc_product_variations`
  MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;

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

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

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

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

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

--
-- AUTO_INCREMENT for table `qc_shopify_products`
--
ALTER TABLE `qc_shopify_products`
  MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `qc_shopify_stores`
--
ALTER TABLE `qc_shopify_stores`
  MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=37;

--
-- AUTO_INCREMENT for table `qc_shopify_variants`
--
ALTER TABLE `qc_shopify_variants`
  MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;

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

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

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

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

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

--
-- AUTO_INCREMENT for table `qc_user_expense`
--
ALTER TABLE `qc_user_expense`
  MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `qc_user_reports`
--
ALTER TABLE `qc_user_reports`
  MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=959;

--
-- AUTO_INCREMENT for table `qc_user_review`
--
ALTER TABLE `qc_user_review`
  MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `qc_user_tokens`
--
ALTER TABLE `qc_user_tokens`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `qc_add_delivery`
--
ALTER TABLE `qc_add_delivery`
  ADD CONSTRAINT `fk_delivery_variation_id` FOREIGN KEY (`variation_id`) REFERENCES `qc_product_variations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `qc_admin_users_groups`
--
ALTER TABLE `qc_admin_users_groups`
  ADD CONSTRAINT `fk_users_groups_groups1` FOREIGN KEY (`group_id`) REFERENCES `qc_admin_groups` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,
  ADD CONSTRAINT `fk_users_groups_users1` FOREIGN KEY (`user_id`) REFERENCES `qc_admin_users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

--
-- Constraints for table `qc_bugs`
--
ALTER TABLE `qc_bugs`
  ADD CONSTRAINT `fk_user_other_request_id` FOREIGN KEY (`user_id`) REFERENCES `qc_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `qc_cart`
--
ALTER TABLE `qc_cart`
  ADD CONSTRAINT `fk_cart_product_id` FOREIGN KEY (`product_id`) REFERENCES `qc_products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_cart_user_id` FOREIGN KEY (`user_id`) REFERENCES `qc_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `qc_orders`
--
ALTER TABLE `qc_orders`
  ADD CONSTRAINT `fk_shopify_store_id` FOREIGN KEY (`store_id`) REFERENCES `qc_shopify_stores` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `qc_order_products`
--
ALTER TABLE `qc_order_products`
  ADD CONSTRAINT `fk_order_id` FOREIGN KEY (`order_id`) REFERENCES `qc_orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `qc_product_attributes`
--
ALTER TABLE `qc_product_attributes`
  ADD CONSTRAINT `fk_product_attr_id` FOREIGN KEY (`product_id`) REFERENCES `qc_products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `qc_product_variations`
--
ALTER TABLE `qc_product_variations`
  ADD CONSTRAINT `fk_product_variation_id` FOREIGN KEY (`product_id`) REFERENCES `qc_products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `qc_shopify_stores`
--
ALTER TABLE `qc_shopify_stores`
  ADD CONSTRAINT `fk_user_store_id` FOREIGN KEY (`user_id`) REFERENCES `qc_users` (`id`);

--
-- Constraints for table `qc_shopify_variants`
--
ALTER TABLE `qc_shopify_variants`
  ADD CONSTRAINT `fk_shopify_product_id` FOREIGN KEY (`shopify_product_id`) REFERENCES `qc_shopify_products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `qc_user_designs`
--
ALTER TABLE `qc_user_designs`
  ADD CONSTRAINT `fk_user_design_id` FOREIGN KEY (`user_id`) REFERENCES `qc_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `qc_user_embroideries`
--
ALTER TABLE `qc_user_embroideries`
  ADD CONSTRAINT `fk_user_embro_id` FOREIGN KEY (`user_id`) REFERENCES `qc_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `qc_user_expense`
--
ALTER TABLE `qc_user_expense`
  ADD CONSTRAINT `fk_user_expense_id` FOREIGN KEY (`user_id`) REFERENCES `qc_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `qc_user_reports`
--
ALTER TABLE `qc_user_reports`
  ADD CONSTRAINT `fk_order_product_report_id` FOREIGN KEY (`order_product_id`) REFERENCES `qc_order_products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_order_report_id` FOREIGN KEY (`order_id`) REFERENCES `qc_orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_user_report_id` FOREIGN KEY (`user_id`) REFERENCES `qc_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;

