Remove message thread id from mcma and update scripts (#6500)

- Remove `messageThreadId` from `messageChannelMessageAssociation`
- Update thread merging
- Update all queries which were dependent on this field
- Update some raw queries by using `twentyORM` instead

---------

Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
bosiraphael
2024-08-06 18:19:59 +02:00
committed by GitHub
parent 48d0a3649d
commit 018b8220dc
14 changed files with 177 additions and 571 deletions

View File

@ -205,7 +205,20 @@ export class WorkspaceMigrationRunnerService {
);
break;
case WorkspaceMigrationIndexActionType.DROP:
await queryRunner.dropIndex(`${schemaName}.${tableName}`, index.name);
try {
await queryRunner.dropIndex(
`${schemaName}.${tableName}`,
index.name,
);
} catch (error) {
// Ignore error if index does not exist
if (
error.message ===
`Supplied index ${index.name} was not found in table ${schemaName}.${tableName}`
) {
continue;
}
}
break;
default:
throw new Error(`Migration index action not supported`);