feat: Add seed people and companies data for demo environment (#2207) (#2307)

* feat: seed companies and people data

* init DataSeedDemoWorkspaceCommand to handle:
- seedCoreSchema()
- seedMetadataSchema()

* feature: Seed workspace with demo data

- delete workspace
- initDemo() with prefillWorkspaceWithDemoObjects()

* added companies-demo.ts with data
* added people-demo.ts with data

* added workspaceId to seedFeatureFlags()

* delete previous CoreSchema before seedCoreSchema

* added workspaceMemberPrefillData

* getDemoWorkspaces() to get DEMO_WORKSPACES from config

* defined DemoSeedUserIds

- created core/demo/ to keep modified seedCoreSchema() there
- DemoSeedUserIds with new set of users and Ids

* generateOpportunities() to seed demo opportunities (limit = 50)

* Code review and fixes

* Fix

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Ruslan
2023-12-03 00:37:45 +07:00
committed by GitHub
parent 31f29582d0
commit fd9467c54d
35 changed files with 5190 additions and 38 deletions

View File

@ -22,11 +22,12 @@
"test:e2e": "./scripts/run-integration.sh",
"typeorm": "ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli.js",
"typeorm:migrate": "yarn typeorm migration:run -d ./src/database/typeorm/metadata/metadata.datasource.ts && yarn typeorm migration:run -d ./src/database/typeorm/core/core.datasource.ts",
"database:init": "yarn database:setup && yarn database:seed",
"database:init": "yarn database:setup && yarn database:seed:dev",
"database:setup": "npx ts-node ./scripts/setup-db.ts && yarn database:migrate",
"database:truncate": "npx ts-node ./scripts/truncate-db.ts",
"database:migrate": "yarn build && yarn typeorm:migrate",
"database:seed": "yarn build && yarn command workspace:seed",
"database:seed:dev": "yarn build && yarn command workspace:seed:dev",
"database:seed:demo": "yarn build && yarn command workspace:seed:demo",
"database:reset": "yarn database:truncate && yarn database:init",
"command": "node dist/src/command"
},