Skip to content

Update holder name limit to save 50 characters

Shreyas Agarwal requested to merge 355303-update-credit-card-limit into master

What does this MR do and why?

The MR !71032 (merged) introduced column holder_name to table user_credit_card_validations

A constraint of 26 characters were added to the holder_name text column. Unfortunately, the Zuora accepts 50 characters as the limit as seen here

https://knowledgecenter.zuora.com/Billing/Billing_and_Payments/LA_Hosted_Payment_Pages/B_Payment_Pages_2.0/K_Payment_Pages_2.0_Form_Fields

This has resulted in the error being raised while saving the credit card name within GL.com. The MR would change the constraint to 50 characters.

Screenshots or screen recordings

image

Database changes

rails db:migrate
== 20220310101118 UpdateHolderNameLimit: migrating ============================
-- transaction_open?()
   -> 0.0000s
-- current_schema()
   -> 0.0002s
-- transaction_open?()
   -> 0.0000s
-- execute("ALTER TABLE user_credit_card_validations\nADD CONSTRAINT check_cc0c8dc0fe\nCHECK ( char_length(holder_name) <= 50 )\nNOT VALID;\n")
   -> 0.0013s
-- current_schema()
   -> 0.0002s
-- execute("ALTER TABLE user_credit_card_validations VALIDATE CONSTRAINT check_cc0c8dc0fe;")
   -> 0.0014s
-- transaction_open?()
   -> 0.0000s
-- transaction_open?()
   -> 0.0000s
-- execute("ALTER TABLE user_credit_card_validations\nDROP CONSTRAINT IF EXISTS check_eafe45d88b\n")
   -> 0.0007s
== 20220310101118 UpdateHolderNameLimit: migrated (0.0165s) ===================
rails db:rollback
== 20220310101118 UpdateHolderNameLimit: reverting ============================
-- transaction_open?()
   -> 0.0000s
-- current_schema()
   -> 0.0003s
-- transaction_open?()
   -> 0.0000s
-- execute("ALTER TABLE user_credit_card_validations\nADD CONSTRAINT check_eafe45d88b\nCHECK ( char_length(holder_name) <= 26 )\nNOT VALID;\n")
   -> 0.0051s
-- transaction_open?()
   -> 0.0000s
-- transaction_open?()
   -> 0.0000s
-- execute("ALTER TABLE user_credit_card_validations\nDROP CONSTRAINT IF EXISTS check_cc0c8dc0fe\n")
   -> 0.0023s
== 20220310101118 UpdateHolderNameLimit: reverted (0.0295s) ===================

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #355303 (closed)

Edited by Shreyas Agarwal

Merge request reports