From ec3b60e37c0b178c3e5e3fe79db88f83fd195722 Mon Sep 17 00:00:00 2001 From: Hrithikesh <61539176+hrithikesh026@users.noreply.github.com> Date: Wed, 8 May 2024 19:06:07 +0530 Subject: [PATCH] fix(core): drop three_dsserver_trans_id from authentication table (#4587) --- crates/diesel_models/src/authentication.rs | 6 ------ crates/diesel_models/src/schema.rs | 1 - crates/router/src/core/authentication/utils.rs | 1 - crates/router/src/db/authentication.rs | 1 - crates/router/src/types/api/authentication.rs | 2 +- .../down.sql | 2 ++ .../up.sql | 2 ++ 7 files changed, 5 insertions(+), 10 deletions(-) create mode 100644 migrations/2024-05-08-111348_delete_unused_column_from_authentication/down.sql create mode 100644 migrations/2024-05-08-111348_delete_unused_column_from_authentication/up.sql diff --git a/crates/diesel_models/src/authentication.rs b/crates/diesel_models/src/authentication.rs index 8840d287e5..ce2f02d087 100644 --- a/crates/diesel_models/src/authentication.rs +++ b/crates/diesel_models/src/authentication.rs @@ -38,7 +38,6 @@ pub struct Authentication { pub challenge_request: Option, pub acs_reference_number: Option, pub acs_trans_id: Option, - pub three_ds_server_trans_id: Option, pub acs_signed_content: Option, pub profile_id: String, pub payment_id: Option, @@ -83,7 +82,6 @@ pub struct AuthenticationNew { pub challenge_request: Option, pub acs_reference_number: Option, pub acs_trans_id: Option, - pub three_dsserver_trans_id: Option, pub acs_signed_content: Option, pub profile_id: String, pub payment_id: Option, @@ -160,7 +158,6 @@ pub struct AuthenticationUpdateInternal { pub challenge_request: Option, pub acs_reference_number: Option, pub acs_trans_id: Option, - pub three_dsserver_trans_id: Option, pub acs_signed_content: Option, } @@ -191,7 +188,6 @@ impl Default for AuthenticationUpdateInternal { challenge_request: Default::default(), acs_reference_number: Default::default(), acs_trans_id: Default::default(), - three_dsserver_trans_id: Default::default(), acs_signed_content: Default::default(), } } @@ -224,7 +220,6 @@ impl AuthenticationUpdateInternal { challenge_request, acs_reference_number, acs_trans_id, - three_dsserver_trans_id, acs_signed_content, } = self; Authentication { @@ -256,7 +251,6 @@ impl AuthenticationUpdateInternal { challenge_request: challenge_request.or(source.challenge_request), acs_reference_number: acs_reference_number.or(source.acs_reference_number), acs_trans_id: acs_trans_id.or(source.acs_trans_id), - three_ds_server_trans_id: three_dsserver_trans_id.or(source.three_ds_server_trans_id), acs_signed_content: acs_signed_content.or(source.acs_signed_content), ..source } diff --git a/crates/diesel_models/src/schema.rs b/crates/diesel_models/src/schema.rs index 20296adb65..0bea0402b5 100644 --- a/crates/diesel_models/src/schema.rs +++ b/crates/diesel_models/src/schema.rs @@ -108,7 +108,6 @@ diesel::table! { challenge_request -> Nullable, acs_reference_number -> Nullable, acs_trans_id -> Nullable, - three_dsserver_trans_id -> Nullable, acs_signed_content -> Nullable, #[max_length = 64] profile_id -> Varchar, diff --git a/crates/router/src/core/authentication/utils.rs b/crates/router/src/core/authentication/utils.rs index bece545923..e29c8b1023 100644 --- a/crates/router/src/core/authentication/utils.rs +++ b/crates/router/src/core/authentication/utils.rs @@ -177,7 +177,6 @@ pub async fn create_new_authentication( challenge_request: None, acs_reference_number: None, acs_trans_id: None, - three_dsserver_trans_id: None, acs_signed_content: None, profile_id, payment_id, diff --git a/crates/router/src/db/authentication.rs b/crates/router/src/db/authentication.rs index 0f4aef679c..398af72f8b 100644 --- a/crates/router/src/db/authentication.rs +++ b/crates/router/src/db/authentication.rs @@ -143,7 +143,6 @@ impl AuthenticationInterface for MockDb { challenge_request: authentication.challenge_request, acs_reference_number: authentication.acs_reference_number, acs_trans_id: authentication.acs_trans_id, - three_ds_server_trans_id: authentication.three_dsserver_trans_id, acs_signed_content: authentication.acs_signed_content, profile_id: authentication.profile_id, payment_id: authentication.payment_id, diff --git a/crates/router/src/types/api/authentication.rs b/crates/router/src/types/api/authentication.rs index 92bcd1ae73..3e4a494f65 100644 --- a/crates/router/src/types/api/authentication.rs +++ b/crates/router/src/types/api/authentication.rs @@ -50,7 +50,7 @@ impl TryFrom for AuthenticationResponse { challenge_request: authentication.challenge_request, acs_reference_number: authentication.acs_reference_number, acs_trans_id: authentication.acs_trans_id, - three_dsserver_trans_id: authentication.three_ds_server_trans_id, + three_dsserver_trans_id: authentication.threeds_server_transaction_id, acs_signed_content: authentication.acs_signed_content, }) } diff --git a/migrations/2024-05-08-111348_delete_unused_column_from_authentication/down.sql b/migrations/2024-05-08-111348_delete_unused_column_from_authentication/down.sql new file mode 100644 index 0000000000..8459dd79c5 --- /dev/null +++ b/migrations/2024-05-08-111348_delete_unused_column_from_authentication/down.sql @@ -0,0 +1,2 @@ +-- This file should undo anything in `up.sql` +ALTER TABLE authentication ADD COLUMN three_dsserver_trans_id VARCHAR; \ No newline at end of file diff --git a/migrations/2024-05-08-111348_delete_unused_column_from_authentication/up.sql b/migrations/2024-05-08-111348_delete_unused_column_from_authentication/up.sql new file mode 100644 index 0000000000..fdbe2332b3 --- /dev/null +++ b/migrations/2024-05-08-111348_delete_unused_column_from_authentication/up.sql @@ -0,0 +1,2 @@ +-- Your SQL goes here +ALTER TABLE authentication DROP COLUMN three_dsserver_trans_id; \ No newline at end of file