Upy
How to modify Default workspaces, fields, and data on new installation
is there any other files that you think I will have to modify? and my last question is this for the newly generated objects ( specific to my application e.g. medical providers), do you think i should make these standard objects, or should they be custom objects? I plan on keeping people and companies as a contact list. but inherit their models for medical providers and doctors section. Just concerned if there will be any implications between standard objects vs custom
13 replies
How to modify Default workspaces, fields, and data on new installation
All, Here is my write up regarding initial data. Hope it helps explain some of the files:
TypeORM Seed Data
packages/twenty-server/src/database/typeorm-seeds
During the local set up, the
command executes
from packages/twenty-server/src/database/commands/data-seed-dev-workspace.command.ts
This creates 2 workspaces, Twenty and Apple which has 13 companies and 15 people.
Standard Prefill Data
When you create a brand new workspace (For example, after a google sign in, and get to name the workspace and everything), it populates the data from packages/twenty-server/src/engine/workspace-manager/standard-objects-prefill-data
There are only 5 people and 5 companies, so
this wont need to be deleted/modified because it gives a good starting point.
there is also a command that is
Prefill Demo Data
Populates the data from packages/twenty-server/src/engine/workspace-manager/demo-objects-prefill-data. the demo data has a ton of data and is used for dev/testing.
13 replies
How to modify Default workspaces, fields, and data on new installation
regarding the workspace.entity (https://github.com/twentyhq/twenty/blob/08c081d315b0c4877559e20aa822a3c989a19c41/packages/twenty-server/src/engine/core-modules/workspace/workspace.entity.ts). that file appears to for the workspace(since it has. What i actually meant was for objects. ( i thought those were workspaces too).
Currently, my plan is as follows:
step 1 - ADD standard object id: Step one will be creating a uuid for each object. for example: export const STANDARD_OBJECT_IDS = {
activityTarget: '20202020-2945-440e-8d1a-f84672d33d5e',
medicalProvider: '20202020-8858-4dfe-8d1a-k896d35486'
https://github.com/twentyhq/twenty/tree/08c081d315b0c4877559e20aa822a3c989a19c41/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/constants
step 2 - define schema similar to this folder: https://github.com/twentyhq/twenty/tree/08c081d315b0c4877559e20aa822a3c989a19c41/packages/twenty-server/src/modules/person
step 3 - add to workspace sync standard objects
https://github.com/twentyhq/twenty/blob/08c081d315b0c4877559e20aa822a3c989a19c41/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/standard-objects/index.ts
step 4 - figure out how to create these objects on workspace initialization????? (not sure here)
13 replies