diff --git a/dirs/ecommerce/migrations/20240620130747.sql b/dirs/ecommerce/migrations/20240620130747.sql new file mode 100644 index 0000000..5135659 --- /dev/null +++ b/dirs/ecommerce/migrations/20240620130747.sql @@ -0,0 +1,2 @@ +-- Modify "users" table +ALTER TABLE `users` ADD COLUMN `updated_at` timestamp NULL ON UPDATE CURRENT_TIMESTAMP; diff --git a/dirs/ecommerce/migrations/atlas.sum b/dirs/ecommerce/migrations/atlas.sum index 6e89901..f53d656 100644 --- a/dirs/ecommerce/migrations/atlas.sum +++ b/dirs/ecommerce/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:er9U3Zz9HEKlMqmfdYRW3wX7ExkH173eYdgpUuiRaes= +h1:WYJgMe6FV2mNO59b1qqxHBhwzPexSnZnEkduM1CflDM= 20230316085611.sql h1:br6W6LPEnnsejlz/7hRm9zthwStCzjN2vZkqVPxlmvo= 20230316090502.sql h1:GfeRjkSeoCt3JVRtLQNa/r50lRfpAPXS7AqTU2ZNFgY= 20230531091333_products_categories.sql h1:59q2M59dV5dJNv4Lyb2TAJz8V6HekgkLn9z4DoL98jA= @@ -14,3 +14,4 @@ h1:er9U3Zz9HEKlMqmfdYRW3wX7ExkH173eYdgpUuiRaes= 20240324131640_order_comment.sql h1:TCduwlpoGZn9Zi6v5t3YzaAkeVgQX5fJ96ZbBJbR0MA= 20240617144354.sql h1:mGm4AgdRP4D1QN/FUNB71vqwLi/faoukUxc6OQVppVY= 20240619073333.sql h1:QJKiWNUwcmy8hbt6YiiVWew5AgibFgtBHBKe73NXW6s= +20240620130747.sql h1:0v/yTN8W9PHjGLN6ZE+T8XywRRUJXwRUt23XWewGyhg= diff --git a/dirs/ecommerce/schema.sql b/dirs/ecommerce/schema.sql index b2592de..6fa2210 100644 --- a/dirs/ecommerce/schema.sql +++ b/dirs/ecommerce/schema.sql @@ -5,6 +5,7 @@ CREATE TABLE `users` ( `email` varchar(255) NOT NULL, `is_admin` bool NULL DEFAULT 0, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL ON UPDATE CURRENT_TIMESTAMP, `date_of_birth` date NULL, PRIMARY KEY (`id`) ) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci; @@ -107,4 +108,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; \ No newline at end of file