Disclaimer: This comment was automatically generated with AI. It can give some useful hints as to where to look for, but sometimes it can also give very inaccurate answers so takes this with a pinch of salt :).
To migrate fields metadata when the remote table schema is updated, follow these steps:
Update Migration Script: Create a new migration script to handle the schema update.
import { MigrationInterface, QueryRunner } from 'typeorm';
export class UpdateRemoteTableSchemaXXXXXX implements MigrationInterface {
name = 'UpdateRemoteTableSchemaXXXXXX';
public async up(queryRunner: QueryRunner): Promise<void> {
// Add your schema update queries here
}
public async down(queryRunner: QueryRunner): Promise<void> {
// Add your schema rollback queries here
}
}
Modify Field Metadata Service: Update the FieldMetadataService to handle the schema changes.
Disclaimer: This comment was automatically generated with AI. It can give some useful hints as to where to look for, but sometimes it can also give very inaccurate answers so takes this with a pinch of salt :).
To migrate fields metadata when the remote table schema is updated, follow these steps:
FieldMetadataService
to handle the schema changes.File:
/packages/twenty-server/src/engine-metadata/field-metadata/field-metadata.service.ts
updateFieldMetadataForRemoteTable
method in the migration script.File:
/packages/twenty-server/src/database/typeorm/metadata/migrations/XXXXXX-updateRemoteTableSchema.ts
Ensure to replace
XXXXXX
with the appropriate timestamp or identifier for the migration.References
/packages/twenty-server/src/database/typeorm/metadata/migrations/1713793656356-addSettingsColumnToFieldMetadata.ts /packages/twenty-server/src/database/typeorm/metadata/migrations/1714382420165-addSchemaAndAvailableTablesToServer.ts /packages/twenty-server/src/database/typeorm/metadata/migrations/1711466822763-addIsRemoteField.ts /packages/twenty-server/src/database/typeorm/metadata/migrations/1700663879152-addEnumOptions.ts /packages/twenty-server/src/database/typeorm/metadata/migrations/1711619086385-useTimestampWithTZ.ts /packages/twenty-server/src/engine/metadata-modules/object-metadata/object-metadata.service.ts /packages/twenty-server/src/engine-metadata/field-metadata/field-metadata.service.ts /packages/twenty-server/src/engine/workspace-manager/workspace-migration-builder/factories/workspace-migration-relation.factory.ts /packages/twenty-server/src/database/typeorm/metadata/migrations/1711459912762-dropTargetColumnMap.ts /packages/twenty-server/src/database/typeorm/metadata/migrations/1713270565699-createRemoteTable.ts
Ask Greptile