From 983c629927b4309b9fe2e9400d27d5a8be08bc65 Mon Sep 17 00:00:00 2001 From: Ariga Bot <98804354+ariga-bot@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:04:29 +0300 Subject: [PATCH] Added an 'updated_at' column to the 'payment_methods' table to track modifications. (#86) Co-authored-by: GitHub Gen Changes <> --- dirs/ecommerce/migrations/20240827130923.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/20240827130923.sql diff --git a/dirs/ecommerce/migrations/20240827130923.sql b/dirs/ecommerce/migrations/20240827130923.sql new file mode 100644 index 0000000..992da37 --- /dev/null +++ b/dirs/ecommerce/migrations/20240827130923.sql @@ -0,0 +1,2 @@ +-- Modify "payment_methods" table +ALTER TABLE `payment_methods` 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 c3d45a0..a9138bc 100644 --- a/dirs/ecommerce/migrations/atlas.sum +++ b/dirs/ecommerce/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:FKMwX7gJsY0OanS+5y8u8+ciUNCbnQrxjgRTcoGG3YA= +h1:9VrEXjKyQIlaBpEIH5i4PeJV88Ld5VQvD1C5XbAugK0= 20230316085611.sql h1:br6W6LPEnnsejlz/7hRm9zthwStCzjN2vZkqVPxlmvo= 20230316090502.sql h1:GfeRjkSeoCt3JVRtLQNa/r50lRfpAPXS7AqTU2ZNFgY= 20230531091333_products_categories.sql h1:59q2M59dV5dJNv4Lyb2TAJz8V6HekgkLn9z4DoL98jA= @@ -40,3 +40,4 @@ h1:FKMwX7gJsY0OanS+5y8u8+ciUNCbnQrxjgRTcoGG3YA= 20240821081259.sql h1:jo+miAHGZoIxX6DsIanS8zi/9gvff/qeh6ncJ6Nxw1Q= 20240821082033.sql h1:+3dX5cbTUSk9p8SQKQlH9UggvxZnf7Z96nF2KSkDI5Y= 20240825130739.sql h1:8BJJ5h/CeJNW3T0QQWKTUueqBhokdz/BMFISo0vJgPs= +20240827130923.sql h1:twxLs8CDVZtIiez6dyrK1rJ0x0TKWHRwj7Hlf+yUs7Y= diff --git a/dirs/ecommerce/schema.sql b/dirs/ecommerce/schema.sql index 7283792..0631268 100644 --- a/dirs/ecommerce/schema.sql +++ b/dirs/ecommerce/schema.sql @@ -133,7 +133,8 @@ CREATE TABLE `payment_methods` ( `card_number` varchar(20) NOT NULL, `expiration_date` date NOT NULL, `cardholder_name` varchar(255) NOT NULL, +`updated_at` timestamp NULL ON UPDATE CURRENT_TIMESTAMP, 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; \ No newline at end of file +) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci;