allow different database name to be initialized#465
Open
obarbier wants to merge 1 commit intowallabag:masterfrom
Open
allow different database name to be initialized#465obarbier wants to merge 1 commit intowallabag:masterfrom
obarbier wants to merge 1 commit intowallabag:masterfrom
Conversation
Author
|
this is to help solve #328 |
Kdecherf
reviewed
Nov 28, 2025
| DATABASE_EXISTS="$(psql -qAt -h "${SYMFONY__ENV__DATABASE_HOST}" -p "${SYMFONY__ENV__DATABASE_PORT}" -U "${POSTGRES_USER}" \ | ||
| -c "SELECT 1 FROM pg_catalog.pg_database WHERE datname = '${SYMFONY__ENV__DATABASE_NAME}';")" | ||
| TABLE_EXISTS="$(psql -qAt -h "${SYMFONY__ENV__DATABASE_HOST}" -p "${SYMFONY__ENV__DATABASE_PORT}" -U "${POSTGRES_USER}" \ | ||
| -c "SELECT 1 FROM information_schema.tables WHERE table_name = 'wallabag_user';")" |
Member
There was a problem hiding this comment.
The table wallabag_user may have a different name on some installations as a prefix can be set using $SYMFONY__ENV__DATABASE_TABLE_PREFIX
|
|
||
| # Configure Postgres database | ||
| if [ "$SYMFONY__ENV__DATABASE_DRIVER" = "pdo_pgsql" ] && [ "$POPULATE_DATABASE" = "True" ] && [ "$POSTGRES_PASSWORD" != "" ] ; then | ||
| if [ -z "$POSTGRES_DATABASE_NAME" ]; then |
Member
There was a problem hiding this comment.
We already rely on POSTGRES_USER and POSTGRES_PASSWORD that are provided by the postgresql docker image. I think we can also rely on POSTGRES_DB to avoid creating a new variable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
psql always connects to the database that matches the user name, unless you explicitly provide a database name.
update only postgresql flow to allow other database_name