Skip to content

FINERACT-2741: Standardize email address column length across most tables - #6234

Open
AshharAhmadKhan wants to merge 1 commit into
apache:developfrom
AshharAhmadKhan:FINERACT-2741-standardize-email-address-column-length
Open

FINERACT-2741: Standardize email address column length across most tables#6234
AshharAhmadKhan wants to merge 1 commit into
apache:developfrom
AshharAhmadKhan:FINERACT-2741-standardize-email-address-column-length

Conversation

@AshharAhmadKhan

Copy link
Copy Markdown
Contributor

JIRA

https://issues.apache.org/jira/browse/FINERACT-2741

Problem

Email address columns across Fineract tables (m_client, m_staff, m_appuser, etc.) are currently capped at 50–150 characters, falling short of the RFC 5321 maximum of 254 characters. This risks truncating or rejecting valid, longer email addresses.

Fix

Widened the following columns to VARCHAR(254):

Table Column Before After
m_appuser email VARCHAR(100) VARCHAR(254)
m_client email_address VARCHAR(150) VARCHAR(254)
m_staff email_address VARCHAR(150) VARCHAR(254)
scheduled_email_messages_outbound email_address VARCHAR(50) VARCHAR(254)

Added a new Liquibase changeset (0245_standardize_email_address_column_length.xml, registered in changelog-tenant.xml) rather than editing 0001_initial_schema.xml, since that file is already-released history.

Updated the following to stay in lockstep with the new column widths:

  • JPA @Column(length=...) on AppUser, Client, Staff, EmailMessage
  • UserDataValidator.notExceedingLengthOf(...) (create + update paths)
  • @Length(max=...) on StaffCreateRequest and StaffUpdateRequest

Out of scope:

  • m_adhoc.email (already VARCHAR(500)) — exceeds the new standard already; ticket specifies no column sizes are reduced, so left as-is.
  • request_audit_table.email (VARCHAR(100)) — no backing JPA entity or code reference found anywhere in the repo. Appears to be dead/legacy schema. Flagging here for reviewer input on whether to widen for consistency or leave untouched.

…bles

Widen email address columns to VARCHAR(254) per RFC 5321 max length:
- m_appuser.email
- m_client.email_address
- m_staff.email_address
- scheduled_email_messages_outbound.email_address

Updates corresponding JPA entity @column annotations, the
UserDataValidator length check, and Staff request DTO @Length
constraints to match.

Out of scope (unchanged):
- m_adhoc.email (already VARCHAR(500), exceeds new standard)
- request_audit_table.email (no backing entity or code references
  found; flagged in PR description for reviewer input)
@AshharAhmadKhan

Copy link
Copy Markdown
Contributor Author

hey @adamsaghy , checked both failures:

  • run-liquibase-ddl-safety: flags the intentional modifyDataType on m_appuser.email (and related columns). This is expected since this PR widens existing columns. Could you add the ddl-safety-override label if it looks good?

  • `The failure (Shard 1) is unrelated to my code. Could you retrigger when free? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant