You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To resolve the issue with the confirmation prompt during migrations, follow these steps:
Modify /packages/twenty-docker/twenty/entrypoint.sh to use tsx instead of npx ts-node:
#!/bin/sh# Check if the initialization has already been done and that we enabled automatic migrationif [ "${ENABLE_DB_MIGRATIONS}"="true" ] && [ !-f /app/docker-data/db_status ];thenecho"Running database setup and migrations..."# Run setup and migration scripts
npx tsx ./scripts/setup-db.ts
yarn database:migrate:prod
# Mark initialization as doneecho"Successfuly migrated DB!"
touch /app/docker-data/db_status
fi# Continue with the original Docker commandexec"$@"
Add tsx as a dependency in package.json:
"dependencies": {
"tsx": "^3.8.0"
}
This will ensure that the script runs without prompting for confirmation.
Here, the script runs
npx ts-node
.On newer
npm
CLIs, this requires a--yes
flag, otherwise the following prompt is generated:This probably only happens in the interactive mode, I imagine, but it's still an annoyance.
Also, I think
ts-node
should be a dependency anyways, and perhaps baked into the image.Or better yet, use
tsx
(https://www.npmjs.com/package/tsx)twenty/packages/twenty-docker/twenty/entrypoint.sh
Line 8 in 9228667
The text was updated successfully, but these errors were encountered: