Experiment using swc instead of tsc (as we did the switch on twenty-front) It's **much** faster (at least 5x) but has stricter requirements. I fixed the build but there's still an error while starting the server, opening this PR for discussion. Checkout the branch and try `nx build:swc twenty-server` Read: https://docs.nestjs.com/recipes/swc#common-pitfalls
27 lines
631 B
TypeScript
27 lines
631 B
TypeScript
import { EntityManager } from 'typeorm';
|
|
|
|
import { companiesDemo } from 'src/engine/workspace-manager/demo-objects-prefill-data/companies-demo.json';
|
|
|
|
export const companyPrefillDemoData = async (
|
|
entityManager: EntityManager,
|
|
schemaName: string,
|
|
) => {
|
|
await entityManager
|
|
.createQueryBuilder()
|
|
.insert()
|
|
.into(`${schemaName}.company`, [
|
|
'name',
|
|
'domainName',
|
|
'address',
|
|
'employees',
|
|
'linkedinLinkUrl',
|
|
'position',
|
|
])
|
|
.orIgnore()
|
|
.values(
|
|
companiesDemo.map((company, index) => ({ ...company, position: index })),
|
|
)
|
|
.returning('*')
|
|
.execute();
|
|
};
|