Skip to content

Commit

Permalink
Add 'reward_points' column to 'users' table to track points accumulat…
Browse files Browse the repository at this point in the history
…ed by the user for transactions. (#132)

Co-authored-by: GitHub Gen Changes <>
  • Loading branch information
ariga-bot authored Dec 22, 2024
1 parent ab59407 commit 7209131
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/20241222081015.sql
Original file line number Diff line number Diff line change
@@ -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";
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:zu56PmP40/BF+1sRgWNmLzgM+7Vak6m3xOQshxLaf6M=
h1:26Zy884xkjsjaKDTmH4Ds4IH07GTWoldeCOClJZPk3I=
20230316085611.sql h1:br6W6LPEnnsejlz/7hRm9zthwStCzjN2vZkqVPxlmvo=
20230316090502.sql h1:GfeRjkSeoCt3JVRtLQNa/r50lRfpAPXS7AqTU2ZNFgY=
20230531091333_products_categories.sql h1:59q2M59dV5dJNv4Lyb2TAJz8V6HekgkLn9z4DoL98jA=
Expand Down Expand Up @@ -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=
3 changes: 2 additions & 1 deletion dirs/ecommerce/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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`),
Expand Down Expand Up @@ -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;

0 comments on commit 7209131

Please sign in to comment.