Fix email migration script (#7267)
This commit is contained in:
@ -93,6 +93,12 @@ export class MigrateEmailFieldsToEmailsCommand extends ActiveWorkspacesCommandRu
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
await this.migratePersonEmailFieldToEmailsField(
|
||||||
|
workspaceId,
|
||||||
|
workspaceQueryRunner,
|
||||||
|
dataSourceMetadata,
|
||||||
|
);
|
||||||
|
|
||||||
const customFieldsWithEmailType =
|
const customFieldsWithEmailType =
|
||||||
await this.fieldMetadataRepository.find({
|
await this.fieldMetadataRepository.find({
|
||||||
where: {
|
where: {
|
||||||
@ -102,12 +108,6 @@ export class MigrateEmailFieldsToEmailsCommand extends ActiveWorkspacesCommandRu
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
await this.migratePersonEmailFieldToEmailsField(
|
|
||||||
workspaceId,
|
|
||||||
workspaceQueryRunner,
|
|
||||||
dataSourceMetadata,
|
|
||||||
);
|
|
||||||
|
|
||||||
for (const customFieldWithEmailType of customFieldsWithEmailType) {
|
for (const customFieldWithEmailType of customFieldsWithEmailType) {
|
||||||
const objectMetadata = await this.objectMetadataRepository.findOne({
|
const objectMetadata = await this.objectMetadataRepository.findOne({
|
||||||
where: { id: customFieldWithEmailType.objectMetadataId },
|
where: { id: customFieldWithEmailType.objectMetadataId },
|
||||||
|
|||||||
Reference in New Issue
Block a user