Auto-run migration script on docker entrypoint (#11338)
A small PR but a big step towards making Twenty easier to self-host and upgrade! Now changing the tag and pulling a new version should be the only step to upgrade as migrations script will be ran automatically upon starting the containers. It was already the case for typeorm migrations, but not for standard objects migration and data migration scripts. It is still possible to disable this behavior for the most complex deployments such as our own cloud.
This commit is contained in:
@ -17,6 +17,7 @@ if [ "${DISABLE_DB_MIGRATIONS}" != "true" ] && [ ! -f /app/docker-data/db_status
|
||||
# Run setup and migration scripts
|
||||
NODE_OPTIONS="--max-old-space-size=1500" tsx ./scripts/setup-db.ts
|
||||
yarn database:migrate:prod
|
||||
yarn command:prod upgrade
|
||||
|
||||
# Mark initialization as done
|
||||
echo "Successfuly migrated DB!"
|
||||
|
||||
Reference in New Issue
Block a user