Skip to content

Commit db6304b

Browse files
authored
Modified the column's data type in the table from to for better precision and accommodating larger prices if needed. (#232)
Co-authored-by: GitHub Gen Changes <>
1 parent fa30f50 commit db6304b

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- Modify "products" table
2+
ALTER TABLE `products` MODIFY COLUMN `price` decimal(12,4) NOT NULL COMMENT "Price of the product";

dirs/ecommerce/migrations/atlas.sum

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
h1:kBWfSSoa+I2fVhYYSjj6j4RNcOw5qQL041hh3YZkjlo=
1+
h1:ttJZGa0MoHKvFY1PqRzXuYIqwTEP39m+WcFY/cddw94=
22
20230316085611.sql h1:br6W6LPEnnsejlz/7hRm9zthwStCzjN2vZkqVPxlmvo=
33
20230316090502.sql h1:GfeRjkSeoCt3JVRtLQNa/r50lRfpAPXS7AqTU2ZNFgY=
44
20230531091333_products_categories.sql h1:59q2M59dV5dJNv4Lyb2TAJz8V6HekgkLn9z4DoL98jA=
@@ -128,3 +128,4 @@ h1:kBWfSSoa+I2fVhYYSjj6j4RNcOw5qQL041hh3YZkjlo=
128128
20251030131819.sql h1:lFWnjBrFnMv7M3DG8NTMbJv4wacnOHla4wVdYj/JkLY=
129129
20251102131140.sql h1:6m5KVCL6GmycOmkwBCJRcpxm+RSsFPbV4UMMZQrBKrc=
130130
20251104132019.sql h1:/+MEE2P3Q6Ll/lxa5YXW6tew/5Pldx1K/j4xFHqlWEs=
131+
20251106131809.sql h1:JxnMLOGSyzhJEX4bnW4HPpyVDi4MnBWsUbbeLBFiSoc=

dirs/ecommerce/schema.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ CREATE TABLE `categories` (
5858
CREATE TABLE `products` (
5959
`id` int NOT NULL COMMENT 'Unique identifier for each product',
6060
`product_name` varchar(255) NOT NULL COMMENT 'Name of the product',
61-
`price` decimal(10,2) NOT NULL COMMENT 'Price of the product',
61+
`price` decimal(12,4) NOT NULL COMMENT 'Price of the product',
6262
`currency_code` char(3) NOT NULL DEFAULT 'USD' COMMENT 'Currency code for the product price',
6363
`category_id` int NULL COMMENT 'Foreign key referencing categories',
6464
`description` text NULL COMMENT 'Description of the product',
@@ -212,3 +212,5 @@ BEGIN
212212
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Order total amount must be greater than or equal to the total price of the order items';
213213
END IF;
214214
END;
215+
216+

0 commit comments

Comments
 (0)