From 75177a4c5414002612c58b47f941f936e514956a Mon Sep 17 00:00:00 2001 From: GitHub Gen Changes <> Date: Thu, 11 Jul 2024 13:09:12 +0000 Subject: [PATCH] Added a 'last_login' timestamp column to the 'users' table to track the last time a user logged in. --- dirs/ecommerce/migrations/20240711130912.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/20240711130912.sql diff --git a/dirs/ecommerce/migrations/20240711130912.sql b/dirs/ecommerce/migrations/20240711130912.sql new file mode 100644 index 0000000..79ea8ec --- /dev/null +++ b/dirs/ecommerce/migrations/20240711130912.sql @@ -0,0 +1,2 @@ +-- Modify "users" table +ALTER TABLE `users` ADD COLUMN `last_login` timestamp NULL; diff --git a/dirs/ecommerce/migrations/atlas.sum b/dirs/ecommerce/migrations/atlas.sum index e2db8ec..92d0dee 100644 --- a/dirs/ecommerce/migrations/atlas.sum +++ b/dirs/ecommerce/migrations/atlas.sum @@ -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= @@ -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= diff --git a/dirs/ecommerce/schema.sql b/dirs/ecommerce/schema.sql index 5c77507..4d7bcad 100644 --- a/dirs/ecommerce/schema.sql +++ b/dirs/ecommerce/schema.sql @@ -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 @@ -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; \ No newline at end of file +) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci;