Refactor standard relations update at custom object renaming (#8638)

Refactoring update of standard relations when a custom object is
renamed, after observing occasional issues.

---------

Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
Marie
2024-11-21 15:54:12 +01:00
committed by GitHub
parent cf73e32969
commit 670c8a0b98
7 changed files with 208 additions and 73 deletions

View File

@ -424,14 +424,14 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
existingObjectMetadata,
);
if (!(newTargetTableName === existingTargetTableName)) {
if (newTargetTableName !== existingTargetTableName) {
await this.objectMetadataMigrationService.createRenameTableMigration(
existingObjectMetadata,
objectMetadataForUpdate,
objectMetadataForUpdate.workspaceId,
);
await this.objectMetadataMigrationService.createRelationsUpdatesMigrations(
await this.objectMetadataMigrationService.createStandardRelationsUpdatesMigrations(
existingObjectMetadata,
objectMetadataForUpdate,
objectMetadataForUpdate.workspaceId,