From 0a66e18ff35d1ff116ba194b024ed8dc9dcb496b Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Mon, 26 Oct 2015 21:07:35 -0700 Subject: [PATCH] Proceed on create if the database exists This change is useful if the container image allows for you to restore from a backup when starting. --- commands | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands b/commands index e9f6f07..fb0beac 100755 --- a/commands +++ b/commands @@ -44,7 +44,7 @@ case "$1" in dokku_log_verbose_quiet "Creating container database" DATABASE_NAME="$(get_database_name "$SERVICE")" - docker exec "$SERVICE_NAME" su - postgres -c "createdb -E utf8 $DATABASE_NAME" + docker exec "$SERVICE_NAME" su - postgres -c "createdb -E utf8 $DATABASE_NAME 2> /dev/null || echo 'Already exists'" dokku_log_info2 "$PLUGIN_SERVICE container created: $SERVICE" dokku "$PLUGIN_COMMAND_PREFIX:info" "$SERVICE"