Skip to content
Snippets Groups Projects
Commit f256342a authored by Gisli Nielsen's avatar Gisli Nielsen
Browse files

Made ids be auto incrementing

parent 25ceee07
No related branches found
No related tags found
No related merge requests found
...@@ -83,11 +83,11 @@ CREATE TABLE `order_item` ( ...@@ -83,11 +83,11 @@ CREATE TABLE `order_item` (
-- --
INSERT INTO `order_item` (`quantity`, `subtotal`, `product_id`, `order_id`) VALUES INSERT INTO `order_item` (`quantity`, `subtotal`, `product_id`, `order_id`) VALUES
(2, 2400, 1, 1),
(1, 800, 2, 1), (1, 800, 2, 1),
(3, 450, 3, 2), (3, 450, 3, 2),
(1, 300, 4, 3), (1, 300, 4, 3),
(2, 400, 5, 4); (2, 400, 5, 4),
(2, 2400, 1, 5);
-- -------------------------------------------------------- -- --------------------------------------------------------
...@@ -228,7 +228,8 @@ INSERT INTO `user_order` (`order_id`, `order_date`, `total_amount`, `status`, `u ...@@ -228,7 +228,8 @@ INSERT INTO `user_order` (`order_id`, `order_date`, `total_amount`, `status`, `u
(1, '2024-04-08 00:00:00', 3200, 'Pending', 1), (1, '2024-04-08 00:00:00', 3200, 'Pending', 1),
(2, '2024-04-09 00:00:00', 450, 'Shipped', 2), (2, '2024-04-09 00:00:00', 450, 'Shipped', 2),
(3, '2024-04-09 00:00:00', 300, 'Delivered', 3), (3, '2024-04-09 00:00:00', 300, 'Delivered', 3),
(4, '2024-04-10 00:00:00', 400, 'Pending', 4); (4, '2024-04-10 00:00:00', 400, 'Pending', 4),
(5, '2024-04-11 00:00:00', 200, 'Pending', 1);
-- --
-- Indexes for dumped tables -- Indexes for dumped tables
...@@ -238,12 +239,14 @@ INSERT INTO `user_order` (`order_id`, `order_date`, `total_amount`, `status`, `u ...@@ -238,12 +239,14 @@ INSERT INTO `user_order` (`order_id`, `order_date`, `total_amount`, `status`, `u
-- Indexes for table `brand` -- Indexes for table `brand`
-- --
ALTER TABLE `brand` ALTER TABLE `brand`
MODIFY `brand_id` int(11) NOT NULL AUTO_INCREMENT,
ADD PRIMARY KEY (`brand_id`); ADD PRIMARY KEY (`brand_id`);
-- --
-- Indexes for table `category` -- Indexes for table `category`
-- --
ALTER TABLE `category` ALTER TABLE `category`
MODIFY `category_id` int(11) NOT NULL AUTO_INCREMENT,
ADD PRIMARY KEY (`category_id`); ADD PRIMARY KEY (`category_id`);
-- --
...@@ -263,6 +266,7 @@ ALTER TABLE `payment` ...@@ -263,6 +266,7 @@ ALTER TABLE `payment`
-- Indexes for table `product` -- Indexes for table `product`
-- --
ALTER TABLE `product` ALTER TABLE `product`
MODIFY `product_id` int(11) NOT NULL AUTO_INCREMENT,
ADD PRIMARY KEY (`product_id`), ADD PRIMARY KEY (`product_id`),
ADD KEY `category_id` (`category_id`), ADD KEY `category_id` (`category_id`),
ADD KEY `brand_id` (`brand_id`); ADD KEY `brand_id` (`brand_id`);
...@@ -292,6 +296,7 @@ ALTER TABLE `user_details` ...@@ -292,6 +296,7 @@ ALTER TABLE `user_details`
-- Indexes for table `user_order` -- Indexes for table `user_order`
-- --
ALTER TABLE `user_order` ALTER TABLE `user_order`
MODIFY `order_id` int(11) NOT NULL AUTO_INCREMENT,
ADD PRIMARY KEY (`order_id`), ADD PRIMARY KEY (`order_id`),
ADD KEY `user_id` (`user_id`); ADD KEY `user_id` (`user_id`);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment