Zeylos
Zeylos
TTwenty
Created by VOLVES on 7/16/2024 in #❓︱help
npx nx database:reset twenty-serverNOUVEAU
need to test again later
10 replies
TTwenty
Created by VOLVES on 7/16/2024 in #❓︱help
npx nx database:reset twenty-serverNOUVEAU
yea the init.sql wasn't played on my install
10 replies
TTwenty
Created by VOLVES on 7/16/2024 in #❓︱help
npx nx database:reset twenty-serverNOUVEAU
tried to setup latest on a fresh vm tonight, I had some issues with the DB too, not sure how it's suppose to work on the default compose file ? ended up with something like this for the db container
db:
image: twentycrm/twenty-postgres:v0.22
volumes:
- /opt/twenty/db-data:/bitnami/postgresql
environment:
POSTGRESQL_USER: twenty
POSTGRESQL_DATABASE: default
POSTGRESQL_PASSWORD: pouet
POSTGRESQL_POSTGRES_PASSWORD: pouet
healthcheck:
test: pg_isready -U twenty -d default
interval: 5s
timeout: 5s
retries: 10
restart: always
db:
image: twentycrm/twenty-postgres:v0.22
volumes:
- /opt/twenty/db-data:/bitnami/postgresql
environment:
POSTGRESQL_USER: twenty
POSTGRESQL_DATABASE: default
POSTGRESQL_PASSWORD: pouet
POSTGRESQL_POSTGRES_PASSWORD: pouet
healthcheck:
test: pg_isready -U twenty -d default
interval: 5s
timeout: 5s
retries: 10
restart: always
and gave this postgresql_url to the server
PG_DATABASE_URL: postgres://postgres:pouet@db:5432/default
PG_DATABASE_URL: postgres://postgres:pouet@db:5432/default
the 'twenty' postgres user in my example is not used by the server (but it's used by the healthcheck lol) but if I don't give that, the bitnami postgres container screams at startup (empty password for default user). -- it looks like with the default compose + env : - the init.sql is not launched (no twenty user, no default db) - the database_url uses the 'twenty' postgres user with 'twenty' password by default when I tried to replicate this with POSTGRESQL_* vars and giving the default DATABASE_URL to the server, I had errors when creating the extensions (because twenty is not superuser and I think bitnami does not permit to do that with env vars) what we could do with the default compose is - use the postgres user by default - or if we don't want to use a postgres superuser for the app, use postgresql trusted extensionshttps://www.postgresql.org/docs/current/sql-createextension.html
if the extension is marked trusted in its control file, then it can be installed by any user who has CREATE privilege on the current database
by adding trusted = true in every extension control file we want to enable with the twenty user (there is a lot, it may require work) - or anything else but that's what came in my head tonight 🙂
10 replies