Skip to content

Commit

Permalink
Added a default value for the 'status' column in the 'payment_methods…
Browse files Browse the repository at this point in the history
…' table to ensure consistency when a new row is added without specifying the 'status'.
  • Loading branch information
GitHub Gen Changes committed Dec 24, 2024
1 parent 7209131 commit 73ff5e5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions dirs/ecommerce/migrations/20241224131007.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Modify "payment_methods" table
ALTER TABLE `payment_methods` MODIFY COLUMN `status` varchar(50) NOT NULL DEFAULT "active" COMMENT "Current status of the payment method, defaults to active";
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:26Zy884xkjsjaKDTmH4Ds4IH07GTWoldeCOClJZPk3I=
h1:l98jtm0KDA9wjnxtxIzu9U7xKz1M3MY/+3pz1qbJsQo=
20230316085611.sql h1:br6W6LPEnnsejlz/7hRm9zthwStCzjN2vZkqVPxlmvo=
20230316090502.sql h1:GfeRjkSeoCt3JVRtLQNa/r50lRfpAPXS7AqTU2ZNFgY=
20230531091333_products_categories.sql h1:59q2M59dV5dJNv4Lyb2TAJz8V6HekgkLn9z4DoL98jA=
Expand Down Expand Up @@ -65,3 +65,4 @@ h1:26Zy884xkjsjaKDTmH4Ds4IH07GTWoldeCOClJZPk3I=
20241128114310.sql h1:BEWCkwlqS1vHduvpN0PlbUZq1nwe/6iLCkrKfECzprk=
20241217131440.sql h1:LBppckudt/r82v6i910RWNoBAHQ7E3KwrMHETxwXfF4=
20241222081015.sql h1:RU7o+jkmMTI4Okz56YG4sZYRL2P+YMvcXfLlIYR8Rk8=
20241224131007.sql h1:OHMWMynd3YnU6t9QKs1R8ei2BbbNlZ66Tx73jgmeJUM=
4 changes: 2 additions & 2 deletions dirs/ecommerce/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ CREATE TABLE `payment_methods` (
`card_number` varchar(20) NOT NULL,
`expiration_date` date NOT NULL,
`cardholder_name` varchar(255) NOT NULL,
`status` varchar(50) NOT NULL DEFAULT 'active',
`status` varchar(50) NOT NULL DEFAULT 'active' COMMENT 'Current status of the payment method, defaults to active',
`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 73ff5e5

Please sign in to comment.