T
Twenty3d ago
Zou

what exactly does this do

i tried to run : npx nx database:reset twenty-server, howveer it does not seem to reset the database, previous workspace still exists. is this only for setup and not actualy "resetting"? can someone explain?
6 Replies
Zou
ZouOP3d ago
i did local setup but we have this :[0] [TypeScript] Found 0 errors. Watching for file changes. [0] [Nest] 336059 - 04/19/2025, 2:51:07 PM WARN 2 workspaces found in database. In single-workspace mode, there should be only one workspace. Apple seed workspace will be used as fallback if it found. [0] [Nest] 336059 - 04/19/2025, 2:51:07 PM WARN undefined [0] [Nest] 336059 - 04/19/2025, 2:51:26 PM WARN 2 workspaces found in database. In single-workspace mode, there should be only one workspace. Apple seed workspace will be used as fallback if it found. [0] [Nest] 336059 - 04/19/2025, 2:51:26 PM WARN undefined and i also disabled auto prefill but somehow apple workspace is always being used, even after i manually delete it from db.
Zou
ZouOP3d ago
No description
Zou
ZouOP3d ago
No description
Zou
ZouOP3d ago
tried npx reset command and still same results
ɃØĦɆᵾS
ɃØĦɆᵾS3d ago
@Zou npx nx database:reset twenty-server does following things in order: - delete all existing data including schemas - creates all schemas - migrates database (in other words, it creates all necessary tables and adds constrains) - flushes cache - seeds database (inserts all data from seed) FYI, command is in packages/twenty-server/project.json if you want to check it on your own As workspace:seed:dev has both Apple and Acme data, it inserts both of them without checking environmental variables, so even if you set IS_MULTIWORKSPACE_ENABLED=false, both workspaces will be populated instead of only one. The simplest and fastest workaround is to directly modify packages/twenty-server/src/database/typeorm-seeds/core/workspaces.ts and delete either Apple or Acme workspace seed, this way records related to removed workspace won't be populated and there'll be only 1 workspace (although when populating database, there'll be error but nevertheless it'll end successfully). Better way is to remove all data related to removed workspace in packages/twenty-server/src/database/typeorm-seeds/ to get rid of error but it's up to you.
Zou
ZouOP3d ago
thank you

Did you find this page helpful?