The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Change default behavior of ENABLE DB MIGRATION (#9077)
Félix Malfaitc90d2fd5ccf4
diff --git a/packages/twenty-docker/.env.example b/packages/twenty-docker/.env.exampleindex c83e13c5432..40efdf33e7d 100644--- a/packages/twenty-docker/.env.example+++ b/packages/twenty-docker/.env.example@@ -2,20 +2,14 @@ TAG=latest#PGUSER_SUPERUSER=postgres#PGPASSWORD_SUPERUSER=replace_me_with_a_strong_password--PG_DATABASE_HOST=db:5432-REDIS_URL=redis://redis:6379+#PG_DATABASE_HOST=db+#REDIS_URL=redis://redis:6379SERVER_URL=http://localhost:3000-FRONT_DOMAIN=localhost-FRONT_PORT=3000-FRONT_PROTOCOL=http# Use openssl rand -base64 32 for each secret# APP_SECRET=replace_me_with_a_random_string-SIGN_IN_PREFILLED=true-STORAGE_TYPE=local# STORAGE_S3_REGION=eu-west3diff --git a/packages/twenty-docker/docker-compose.yml b/packages/twenty-docker/docker-compose.ymlindex dfc38960814..0f32467e233 100644--- a/packages/twenty-docker/docker-compose.yml+++ b/packages/twenty-docker/docker-compose.yml@@ -26,8 +26,6 @@ services:SERVER_URL: ${SERVER_URL}REDIS_URL: ${REDIS_URL:-redis://redis:6379}- ENABLE_DB_MIGRATIONS: "true"-SIGN_IN_PREFILLED: ${SIGN_IN_PREFILLED}STORAGE_TYPE: ${STORAGE_TYPE}STORAGE_S3_REGION: ${STORAGE_S3_REGION}@@ -54,7 +52,7 @@ services:PG_DATABASE_URL: postgres://${PGUSER_SUPERUSER:-postgres}:${PGPASSWORD_SUPERUSER:-postgres}@${PG_DATABASE_HOST:-db:5432}/defaultSERVER_URL: ${SERVER_URL}REDIS_URL: ${REDIS_URL:-redis://redis:6379}- ENABLE_DB_MIGRATIONS: "false" # it already runs on the server+ DISABLE_DB_MIGRATIONS: "true" # it already runs on the serverSTORAGE_TYPE: ${STORAGE_TYPE}STORAGE_S3_REGION: ${STORAGE_S3_REGION}diff --git a/packages/twenty-docker/k8s/manifests/deployment-server.yaml b/packages/twenty-docker/k8s/manifests/deployment-server.yamlindex 86f601ef1dd..13a149232b6 100644--- a/packages/twenty-docker/k8s/manifests/deployment-server.yaml+++ b/packages/twenty-docker/k8s/manifests/deployment-server.yaml@@ -41,10 +41,8 @@ spec:value: "postgres://postgres:[email protected]/default"- name: "REDIS_URL"value: "redis://twentycrm-redis.twentycrm.svc.cluster.local:6379"- - name: ENABLE_DB_MIGRATIONS- value: "true"- name: SIGN_IN_PREFILLED- value: "true"+ value: "false"- name: STORAGE_TYPEvalue: "local"- name: "MESSAGE_QUEUE_TYPE"diff --git a/packages/twenty-docker/k8s/manifests/deployment-worker.yaml b/packages/twenty-docker/k8s/manifests/deployment-worker.yamlindex e379bdafa6c..dc6a15efc87 100644--- a/packages/twenty-docker/k8s/manifests/deployment-worker.yaml+++ b/packages/twenty-docker/k8s/manifests/deployment-worker.yaml@@ -30,7 +30,7 @@ spec:value: "https://crm.example.com:443"- name: PG_DATABASE_URLvalue: "postgres://postgres:[email protected]/default"- - name: ENABLE_DB_MIGRATIONS+ - name: DISABLE_DB_MIGRATIONSvalue: "false" # it already runs on the server- name: STORAGE_TYPEvalue: "local"diff --git a/packages/twenty-docker/k8s/terraform/deployment-server.tf b/packages/twenty-docker/k8s/terraform/deployment-server.tfindex b8987fc01ed..3add0862386 100644--- a/packages/twenty-docker/k8s/terraform/deployment-server.tf+++ b/packages/twenty-docker/k8s/terraform/deployment-server.tf@@ -60,13 +60,8 @@ resource "kubernetes_deployment" "twentycrm_server" {value = "redis://${kubernetes_service.twentycrm_redis.metadata.0.name}.${kubernetes_namespace.twentycrm.metadata.0.name}.svc.cluster.local:6379"}env {- name = "ENABLE_DB_MIGRATIONS"- value = "true"- }-- env {- name = "SIGN_IN_PREFILLED"- value = "true"+ name = "DISABLE_DB_MIGRATIONS"+ value = "false"}env {diff --git a/packages/twenty-docker/k8s/terraform/deployment-worker.tf b/packages/twenty-docker/k8s/terraform/deployment-worker.tfindex ce55fff8081..f9f83e752a8 100644--- a/packages/twenty-docker/k8s/terraform/deployment-worker.tf+++ b/packages/twenty-docker/k8s/terraform/deployment-worker.tf@@ -59,8 +59,8 @@ resource "kubernetes_deployment" "twentycrm_worker" {}env {- name = "ENABLE_DB_MIGRATIONS"- value = "false" #it already runs on the server+ name = "DISABLE_DB_MIGRATIONS"+ value = "true" #it already runs on the server}env {diff --git a/packages/twenty-docker/twenty/entrypoint.sh b/packages/twenty-docker/twenty/entrypoint.shindex 331a4636022..2b6985a30e0 100755--- a/packages/twenty-docker/twenty/entrypoint.sh+++ b/packages/twenty-docker/twenty/entrypoint.sh@@ -2,7 +2,7 @@set -e# Check if the initialization has already been done and that we enabled automatic migration-if [ "${ENABLE_DB_MIGRATIONS}" = "true" ] && [ ! -f /app/docker-data/db_status ]; then+if [ "${DISABLE_DB_MIGRATIONS}" != "true" ] && [ ! -f /app/docker-data/db_status ]; thenecho "Running database setup and migrations..."# Creating the database if it doesn't existdiff --git a/packages/twenty-website/src/content/developers/self-hosting/upgrade-guide.mdx b/packages/twenty-website/src/content/developers/self-hosting/upgrade-guide.mdxindex 662cf559b1f..69539437569 100644--- a/packages/twenty-website/src/content/developers/self-hosting/upgrade-guide.mdx+++ b/packages/twenty-website/src/content/developers/self-hosting/upgrade-guide.mdx@@ -20,6 +20,12 @@ If you used Docker Compose, follow these steps:## Version-specific upgrade steps+### v0.34.0 to v0.40.0++- We replaced `ENABLE_DB_MIGRATIONS` with `DISABLE_DB_MIGRATIONS` (default value is now `false`, you probably don't have to set anything)+++### v0.33.0 to v0.34.0Upgrade your Twenty instance to use v0.34.0 image@@ -172,4 +178,4 @@ The `yarn command:prod upgrade-0.22` command will apply specific data transforma-<ArticleEditContent></ArticleEditContent>\ No newline at end of file+<ArticleEditContent></ArticleEditContent>