Skip to content

Commit

Permalink
Added an 'updated_at' column to the 'payment_methods' table to track …
Browse files Browse the repository at this point in the history
…modifications. (#86)

Co-authored-by: GitHub Gen Changes <>
  • Loading branch information
ariga-bot authored Aug 27, 2024
1 parent a92963a commit 983c629
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/20240827130923.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Modify "payment_methods" table
ALTER TABLE `payment_methods` ADD COLUMN `updated_at` timestamp NULL ON UPDATE CURRENT_TIMESTAMP;
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:FKMwX7gJsY0OanS+5y8u8+ciUNCbnQrxjgRTcoGG3YA=
h1:9VrEXjKyQIlaBpEIH5i4PeJV88Ld5VQvD1C5XbAugK0=
20230316085611.sql h1:br6W6LPEnnsejlz/7hRm9zthwStCzjN2vZkqVPxlmvo=
20230316090502.sql h1:GfeRjkSeoCt3JVRtLQNa/r50lRfpAPXS7AqTU2ZNFgY=
20230531091333_products_categories.sql h1:59q2M59dV5dJNv4Lyb2TAJz8V6HekgkLn9z4DoL98jA=
Expand Down Expand Up @@ -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=
3 changes: 2 additions & 1 deletion dirs/ecommerce/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;
) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci;

0 comments on commit 983c629

Please sign in to comment.