feat: refactor folder structure (#4498)
* feat: wip refactor folder structure * Fix * fix position --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -0,0 +1,26 @@
|
||||
import { EntityManager } from 'typeorm';
|
||||
|
||||
import companiesDemo from './companies-demo.json';
|
||||
|
||||
export const companyPrefillData = 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();
|
||||
};
|
||||
Reference in New Issue
Block a user