Skip to content

Commit

Permalink
Added a new boolean column to the table to allow marking certain prod…
Browse files Browse the repository at this point in the history
…ucts as featured. (#63)

Co-authored-by: GitHub Gen Changes <>
  • Loading branch information
ariga-bot authored Jul 18, 2024
1 parent 3daf001 commit 020ad8f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions dirs/ecommerce/migrations/20240718130908.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Modify "products" table
ALTER TABLE `products` ADD COLUMN `featured` bool NOT NULL DEFAULT 0;
3 changes: 2 additions & 1 deletion dirs/ecommerce/migrations/atlas.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
h1:3Y5UyAO0EWVjofutUTLT+dg6dC3FdbV7YDFnyhBIvck=
h1:/KsdgRwdumA7SBicv8/wFaoNf+u8mmPxtthvFbC74zw=
20230316085611.sql h1:br6W6LPEnnsejlz/7hRm9zthwStCzjN2vZkqVPxlmvo=
20230316090502.sql h1:GfeRjkSeoCt3JVRtLQNa/r50lRfpAPXS7AqTU2ZNFgY=
20230531091333_products_categories.sql h1:59q2M59dV5dJNv4Lyb2TAJz8V6HekgkLn9z4DoL98jA=
Expand All @@ -23,3 +23,4 @@ h1:3Y5UyAO0EWVjofutUTLT+dg6dC3FdbV7YDFnyhBIvck=
20240711130912.sql h1:ySpUVLDyz5QCRpeB3kaDVarV0hwqHEmwK9S5BEkG7Zo=
20240714132123.sql h1:lv0PHzxnTJyy62qY4O7uWPZ4nJHzuODG0PklM77dqtg=
20240716130659.sql h1:/Dz+XBDPkPvfnBuS9JbsQ8lZN3GfjWtcn3p1WeDtRvk=
20240718130908.sql h1:48TPrpE8Tr3qkT0Gkt1d4mjY3vVAIziSfr6Dswia9MQ=
3 changes: 2 additions & 1 deletion dirs/ecommerce/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ CREATE TABLE `products` (
`price` decimal(10,2) NOT NULL,
`category_id` int NULL,
`description` text NULL,
`featured` bool NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
INDEX `category_id` (`category_id`),
UNIQUE INDEX `product_name` (`product_name`),
Expand Down Expand Up @@ -117,4 +118,4 @@ CREATE TABLE `posts` (
PRIMARY KEY (`id`),
INDEX `user_id` (`user_id`),
CONSTRAINT `posts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE
) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci;

0 comments on commit 020ad8f

Please sign in to comment.