From 31f419ce2875376b6299044eb40cc825ef492073 Mon Sep 17 00:00:00 2001 From: GitHub Gen Changes <> Date: Sun, 22 Dec 2024 08:10:15 +0000 Subject: [PATCH] Add 'reward_points' column to 'users' table to track points accumulated by the user for transactions. --- dirs/ecommerce/migrations/20241222081015.sql | 2 ++ dirs/ecommerce/migrations/atlas.sum | 3 ++- dirs/ecommerce/schema.sql | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 dirs/ecommerce/migrations/20241222081015.sql diff --git a/dirs/ecommerce/migrations/20241222081015.sql b/dirs/ecommerce/migrations/20241222081015.sql new file mode 100644 index 0000000..55c1cf9 --- /dev/null +++ b/dirs/ecommerce/migrations/20241222081015.sql @@ -0,0 +1,2 @@ +-- Modify "users" table +ALTER TABLE `users` ADD COLUMN `reward_points` int NOT NULL DEFAULT 0 COMMENT "The number of reward points the user has accumulated"; diff --git a/dirs/ecommerce/migrations/atlas.sum b/dirs/ecommerce/migrations/atlas.sum index 584d62c..5f5e323 100644 --- a/dirs/ecommerce/migrations/atlas.sum +++ b/dirs/ecommerce/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:zu56PmP40/BF+1sRgWNmLzgM+7Vak6m3xOQshxLaf6M= +h1:26Zy884xkjsjaKDTmH4Ds4IH07GTWoldeCOClJZPk3I= 20230316085611.sql h1:br6W6LPEnnsejlz/7hRm9zthwStCzjN2vZkqVPxlmvo= 20230316090502.sql h1:GfeRjkSeoCt3JVRtLQNa/r50lRfpAPXS7AqTU2ZNFgY= 20230531091333_products_categories.sql h1:59q2M59dV5dJNv4Lyb2TAJz8V6HekgkLn9z4DoL98jA= @@ -64,3 +64,4 @@ h1:zu56PmP40/BF+1sRgWNmLzgM+7Vak6m3xOQshxLaf6M= 20241126131349.sql h1:7Ft68dDNVtYPdFgxuWUlfN96gM74nqPSHNL1IHitu2I= 20241128114310.sql h1:BEWCkwlqS1vHduvpN0PlbUZq1nwe/6iLCkrKfECzprk= 20241217131440.sql h1:LBppckudt/r82v6i910RWNoBAHQ7E3KwrMHETxwXfF4= +20241222081015.sql h1:RU7o+jkmMTI4Okz56YG4sZYRL2P+YMvcXfLlIYR8Rk8= diff --git a/dirs/ecommerce/schema.sql b/dirs/ecommerce/schema.sql index e12d70a..d237f40 100644 --- a/dirs/ecommerce/schema.sql +++ b/dirs/ecommerce/schema.sql @@ -15,6 +15,7 @@ CREATE TABLE `users` ( `last_login` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Timestamp of the last login of the user', `address` varchar(255) NULL, `profile_picture_url` varchar(255) NULL COMMENT 'URL to the user profile picture', + `reward_points` int NOT NULL DEFAULT 0 COMMENT 'The number of reward points the user has accumulated', `phone_verified` bool NOT NULL DEFAULT 0 COMMENT 'Flag indicating if the user phone number is verified, defaults to false', `deleted_at` timestamp NULL COMMENT 'Timestamp for soft deletion of the user record', PRIMARY KEY (`id`), @@ -157,4 +158,4 @@ CREATE TABLE `payment_methods` ( PRIMARY KEY (`id`), INDEX `user_id` (`user_id`), CONSTRAINT `payment_methods_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; \ No newline at end of file