Fix relation creation (#10171)
## Context We recently introduced a createMany on the field metadata service to improve seeding performances. This broke relation metadata creation because it was using a method with the same name that was inherited from TypeOrmQueryService.
This commit is contained in:
21
.vscode/launch.json
vendored
21
.vscode/launch.json
vendored
@ -60,6 +60,27 @@
|
|||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"internalConsoleOptions": "neverOpen",
|
"internalConsoleOptions": "neverOpen",
|
||||||
"envFile": "${workspaceFolder}/packages/twenty-e2e-testing/.env"
|
"envFile": "${workspaceFolder}/packages/twenty-e2e-testing/.env"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Debug Integration Test File",
|
||||||
|
"runtimeExecutable": "npx",
|
||||||
|
"runtimeArgs": [
|
||||||
|
"nx",
|
||||||
|
"run",
|
||||||
|
"twenty-server:jest",
|
||||||
|
"--",
|
||||||
|
"--config",
|
||||||
|
"./jest-integration.config.ts",
|
||||||
|
"${relativeFile}"
|
||||||
|
],
|
||||||
|
"cwd": "${workspaceFolder}/packages/twenty-server",
|
||||||
|
"console": "integratedTerminal",
|
||||||
|
"internalConsoleOptions": "neverOpen",
|
||||||
|
"env": {
|
||||||
|
"NODE_ENV": "test"
|
||||||
|
},
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -18,6 +18,33 @@ const jestConfig: JestConfigWithTsJest = {
|
|||||||
globalTeardown: '<rootDir>/test/integration/utils/teardown-test.ts',
|
globalTeardown: '<rootDir>/test/integration/utils/teardown-test.ts',
|
||||||
testTimeout: 15000,
|
testTimeout: 15000,
|
||||||
maxWorkers: 1,
|
maxWorkers: 1,
|
||||||
|
transform: {
|
||||||
|
'^.+\\.(t|j)s$': [
|
||||||
|
'@swc/jest',
|
||||||
|
{
|
||||||
|
jsc: {
|
||||||
|
parser: {
|
||||||
|
syntax: 'typescript',
|
||||||
|
tsx: false,
|
||||||
|
decorators: true,
|
||||||
|
},
|
||||||
|
transform: {
|
||||||
|
decoratorMetadata: true,
|
||||||
|
},
|
||||||
|
experimental: {
|
||||||
|
plugins: [
|
||||||
|
[
|
||||||
|
'@lingui/swc-plugin',
|
||||||
|
{
|
||||||
|
stripNonEssentialFields: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
...pathsToModuleNameMapper(tsConfig.compilerOptions.paths, {
|
...pathsToModuleNameMapper(tsConfig.compilerOptions.paths, {
|
||||||
prefix: '<rootDir>/../..',
|
prefix: '<rootDir>/../..',
|
||||||
@ -29,9 +56,6 @@ const jestConfig: JestConfigWithTsJest = {
|
|||||||
fakeTimers: {
|
fakeTimers: {
|
||||||
enableGlobally: true,
|
enableGlobally: true,
|
||||||
},
|
},
|
||||||
transform: {
|
|
||||||
'^.+\\.(t|j)s$': 'ts-jest',
|
|
||||||
},
|
|
||||||
globals: {
|
globals: {
|
||||||
APP_PORT: 4000,
|
APP_PORT: 4000,
|
||||||
ACCESS_TOKEN:
|
ACCESS_TOKEN:
|
||||||
|
|||||||
@ -93,7 +93,7 @@ export class RelationMetadataService extends TypeOrmQueryService<RelationMetadat
|
|||||||
const toId = uuidV4();
|
const toId = uuidV4();
|
||||||
|
|
||||||
const createdRelationFieldsMetadata =
|
const createdRelationFieldsMetadata =
|
||||||
await this.fieldMetadataService.createMany([
|
await this.fieldMetadataRepository.save([
|
||||||
this.createFieldMetadataForRelationMetadata(
|
this.createFieldMetadataForRelationMetadata(
|
||||||
relationMetadataInput,
|
relationMetadataInput,
|
||||||
'from',
|
'from',
|
||||||
|
|||||||
Reference in New Issue
Block a user