♻️(yhub) maintain database schema using npm run init-db

The yhub database schema have new update and will probably be modified
in the future. We don't want to maintain this sql schema in the Docs
repo, we want to reuse what is directly made in the yhub project. For
this we reuse the existing bin/init-db.js script
This commit is contained in:
Manuel Raynaud
2026-09-11 10:53:25 +02:00
committed by Anthony LC
parent 9cdaa1fb2e
commit 844ad00a12
6 changed files with 48 additions and 24 deletions
+4 -2
View File
@@ -219,14 +219,16 @@ services:
- env.d/development/yhub-postgres
volumes:
- yhub-pgdata:/var/lib/postgresql/data
# NOTE: initdb.d only runs on a FRESH volume; schema changes need `podman volume rm`
- ./docker/files/yhub/initdb:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U yhub"]
interval: 1s
timeout: 2s
retries: 60
# no published port (Django's postgres already publishes)
# the schema is not seeded here: initdb.d would only replay on a fresh
# volume, so an upgrade that adds a table would silently skip an existing
# one. `make migrate-yhub` runs yhub's own DDL script instead, the same way
# `make migrate` runs Django's migrations.
yhub:
user: ${DOCKER_USER:-1000}