Skip to content

Conversation

@plavoie-BC
Copy link
Contributor

This pull request adds a new database migration to update applicant records, ensuring that the NonRegisteredBusinessName field is populated with data from NonRegOrgName where appropriate to backfill applicant data in the database.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a data migration to synchronize the NonRegisteredBusinessName field with the NonRegOrgName field in the Applicants table. This appears to be a data fix to ensure that non-registered business names are properly populated in the NonRegisteredBusinessName column.

Reviewed Changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
20251104184306_AB29680_NonRegBusinessName_Datafix.cs Adds migration logic to copy NonRegOrgName to NonRegisteredBusinessName when the latter is empty and the former has data
20251104184306_AB29680_NonRegBusinessName_Datafix.Designer.cs Auto-generated migration designer file reflecting the database state at this migration point
Comments suppressed due to low confidence (1)

applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/Migrations/TenantMigrations/20251104184306_AB29680_NonRegBusinessName_Datafix.cs:1

  • The Down migration rollback logic is incorrect. It sets NonRegisteredBusinessName to NULL for all rows where it equals NonRegOrgName, but this will also affect rows that already had matching values before the migration ran. The Down migration should only revert changes made by the Up migration - i.e., rows where NonRegisteredBusinessName was previously empty. Consider adding a condition to only set NULL where NonRegOrgName is not empty: WHERE \"NonRegisteredBusinessName\" = \"NonRegOrgName\" AND (COALESCE(TRIM(\"NonRegOrgName\"), '') <> '')
using Microsoft.EntityFrameworkCore.Migrations;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JamesPasta JamesPasta merged commit 8834592 into dev Nov 5, 2025
11 checks passed
@JamesPasta JamesPasta deleted the bugfix/AB#29680-non-reg-business-name-migration branch November 5, 2025 17:28
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.

3 participants