Skip to content

Commit

Permalink
Added a 'last_login' timestamp column to the 'users' table to track t…
Browse files Browse the repository at this point in the history
…he last time a user logged in.
  • Loading branch information
GitHub Gen Changes committed Jul 11, 2024
1 parent 3201268 commit 75177a4
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/20240711130912.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Modify "users" table
ALTER TABLE `users` ADD COLUMN `last_login` timestamp NULL;
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:5Qcz9fmqnkIhJjDMlVvjZjMATmpGPVJyWvnomXe+g+w=
h1:8LeOgYv1dWVg/LAz7/Uv2sqRTcwUeEc5eTizTEVVgZE=
20230316085611.sql h1:br6W6LPEnnsejlz/7hRm9zthwStCzjN2vZkqVPxlmvo=
20230316090502.sql h1:GfeRjkSeoCt3JVRtLQNa/r50lRfpAPXS7AqTU2ZNFgY=
20230531091333_products_categories.sql h1:59q2M59dV5dJNv4Lyb2TAJz8V6HekgkLn9z4DoL98jA=
Expand All @@ -20,3 +20,4 @@ h1:5Qcz9fmqnkIhJjDMlVvjZjMATmpGPVJyWvnomXe+g+w=
20240627130821.sql h1:vCifBjrlZekBRb6g6nmulLu2AdEzvymJBnxFkgFYFj4=
20240702130812.sql h1:u9VyU0SQLuA1LotWpxsCyvEid5FMnrgatcn/P4S4F88=
20240704130806.sql h1:vUO9cakRAqDU9jNrQgE+qyWhWCkojRoWkjAtk9Z+wgY=
20240711130912.sql h1:ySpUVLDyz5QCRpeB3kaDVarV0hwqHEmwK9S5BEkG7Zo=
3 changes: 2 additions & 1 deletion dirs/ecommerce/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CREATE TABLE `users` (
`updated_at` timestamp NULL ON UPDATE CURRENT_TIMESTAMP,
`date_of_birth` date NULL,
`active` bool NOT NULL DEFAULT 1,
`last_login` timestamp NULL,
PRIMARY KEY (`id`)
) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
-- Create "categories" table
Expand Down Expand Up @@ -114,4 +115,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 75177a4

Please sign in to comment.