Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix email migration #7298

Merged
merged 1 commit into from
Sep 27, 2024
Merged

Fix email migration #7298

merged 1 commit into from
Sep 27, 2024

Conversation

bosiraphael
Copy link
Contributor

Checks if person standard email field exists before running the migration.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This pull request enhances the email migration process by adding a check for the existence of the person email field before migration, improving robustness and error handling.

  • Added conditional check in migratePersonEmailFieldToEmailsField to skip migration if person email field is not found
  • Improved error logging in packages/twenty-server/src/database/commands/upgrade-version/0-30/0-30-migrate-email-fields-to-emails.command.ts
  • Ensures compatibility with potential variations in person object metadata across different workspace configurations

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings

workspaceQueryRunner,
dataSourceMetadata,
});

if (personEmailFieldMetadata) {
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Consider removing this condition as it's redundant after the previous check

Copy link
Member

@Weiko Weiko left a comment

Choose a reason for hiding this comment

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

LGTM

@charlesBochet charlesBochet merged commit 942281f into main Sep 27, 2024
8 checks passed
@charlesBochet charlesBochet deleted the fix-email-migration branch September 27, 2024 15:20
harshit078 pushed a commit to harshit078/twenty that referenced this pull request Oct 14, 2024
Checks if person standard email field exists before running the
migration.
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