admin

python.ds.com@gmail.com

Create Product Category Table for ecommerce

Posted on February 26, 2021



CREATE TABLE `master_category` (

`created_datetime` datetime(6) NOT NULL,

`updated_datetime` datetime(6) NOT NULL,

`status` varchar(10) NOT NULL,

`category_id` int NOT NULL,

`category_title` varchar(128) NOT NULL,

`slug` varchar(150) NOT NULL,

`sort_order` int DEFAULT NULL,

`parent_id` int DEFAULT NULL

)


--

-- Dumping data for table `master_category`

--

INSERT INTO `master_category` (`created_datetime`, `updated_datetime`, `status`, `category_id`, `category_title`, `slug`, `sort_order`, `parent_id`) VALUES

('2021-01-18 06:13:46.775498', '2021-01-18 06:13:46.775559', 'Active', 2, 'Indian & Fusion Wear', 'indian-&-fusion-wear', 0, NULL),

('2021-01-18 06:15:04.800319', '2021-01-18 06:15:04.800372', 'Active', 3, 'Ethnic Sets', 'ethnic-sets', 0, 2),

('2021-01-18 06:15:36.076440', '2021-01-18 06:15:36.076519', 'Active', 4, 'Kurta Sets', 'kurta-sets', 0, 3),

('2021-01-18 06:16:04.349098', '2021-01-18 06:16:04.349149', 'Active', 5, 'Ethnic Bottom', 'ethnic-bottom', 0, 3),

('2021-01-18 06:16:26.676249', '2021-01-18 06:16:26.676306', 'Active', 6, 'Western Wear', 'western-wear', 0, NULL),

('2021-01-18 06:16:46.576680', '2021-01-18 06:16:46.576734', 'Active', 7, 'Jumpsuite and Rompers', 'jumpsuite-and-rompers', 0, 6),

('2021-01-18 06:17:05.143047', '2021-01-18 06:17:05.143101', 'Active', 8, 'Dresses', 'dresses', 0, 6),

('2021-01-18 06:17:36.219680', '2021-01-18 06:17:36.219755', 'Active', 9, 'Dress', 'dress', 0, 8),

('2021-01-18 06:17:52.319460', '2021-01-18 06:17:52.319511', 'Active', 10, 'Rompers', 'rompers', 0, 7),

('2021-01-18 06:18:03.693877', '2021-01-18 06:18:03.693929', 'Active', 11, 'Jumpsuite', 'jumpsuite', 0, 7),

('2021-01-19 07:47:34.291383', '2021-01-19 07:47:34.291486', 'Active', 12, 'asd', 'asd', 0, NULL),

('2021-02-12 06:48:53.414654', '2021-02-12 06:48:53.414710', 'Active', 13, 'Jumpsuite', 'jumpsuite-zfwk', 0, 7),

('2021-02-12 06:50:26.829550', '2021-02-12 06:50:26.829603', 'Active', 14, 'Jumpsuite', 'jumpsuite-o7q5', 0, 7),

('2021-02-12 06:52:00.015627', '2021-02-12 06:52:00.015680', 'Active', 15, 'abc', 'abc', 0, 7),

('2021-02-12 06:52:40.197679', '2021-02-12 06:52:40.197767', 'Active', 16, 'Jumpsuite', 'jumpsuite-7nub', 0, 7),

('2021-02-12 06:58:44.859319', '2021-02-12 06:58:44.859377', 'Active', 17, 'abc', 'abc-jd1d', 0, 7),

('2021-02-12 07:03:29.085166', '2021-02-12 07:03:29.085221', 'Active', 18, 'abc', 'abc-5ifn', 0, 7),

('2021-02-23 11:55:01.030882', '2021-02-23 11:55:07.323311', 'Active', 19, 'test', 'kjkjkj', 0, 2),

('2021-02-23 11:57:12.106908', '2021-02-23 11:57:12.106990', 'Active', 20, 'TEST MAP', 'MAP_LUG', 0, 2);


--

-- Indexes for dumped tables

--

--

-- Indexes for table `master_category`

--

ALTER TABLE `master_category` ADD PRIMARY KEY (`category_id`), ADD UNIQUE KEY `slug` (`slug`), ADD KEY `master_category_parent_id_84c7169e_fk_master_ca` (`parent_id`)


--

-- AUTO_INCREMENT for table `master_category`

--

ALTER TABLE `master_category` MODIFY `category_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21


--

-- Constraints for table `master_category`

--

ALTER TABLE `master_category`

ADD CONSTRAINT `master_category_parent_id_84c7169e_fk_master_ca` FOREIGN KEY (`parent_id`) REFERENCES `master_category` (`category_id`);




 


Sign In for comment and like the post.