Files
twenty/packages/twenty-server/src/engine/workspace-manager/standard-objects-prefill-data/pipeline-step.ts
T
Jérémy M 94487f6737 feat: refactor folder structure (#4498)
* feat: wip refactor folder structure

* Fix

* fix position

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-03-15 14:40:58 +01:00

42 lines
796 B
TypeScript

import { EntityManager } from 'typeorm';
export const pipelineStepPrefillData = async (
entityManager: EntityManager,
schemaName: string,
) => {
await entityManager
.createQueryBuilder()
.insert()
.into(`${schemaName}.pipelineStep`, ['name', 'color', 'position'])
.orIgnore()
.values([
{
name: 'NEW',
color: 'red',
position: 0,
},
{
name: 'SCREENING',
color: 'purple',
position: 1,
},
{
name: 'MEETING',
color: 'sky',
position: 2,
},
{
name: 'PROPOSAL',
color: 'turquoise',
position: 3,
},
{
name: 'CUSTOMER',
color: 'yellow',
position: 4,
},
])
.returning('*')
.execute();
};