diff --git a/postgres/hooks/postgres_database-relation-joined b/postgres/hooks/postgres_database-relation-joined index 35d61f5..5dfc31a 100755 --- a/postgres/hooks/postgres_database-relation-joined +++ b/postgres/hooks/postgres_database-relation-joined @@ -52,6 +52,10 @@ ensure_db_docker_running ## XXXvlab: should send all these into only one docker... if ! db_has_database "$DBNAME"; then db_create "$DBNAME" || exit 1 + + if sql=$(relation-get init-sql); then + ddb "$DBNAME" > /dev/null < <(e "$sql") || exit 1 + fi fi if [ "${#extensions[@]}" -gt 0 ]; then db_install_extensions "$DBNAME" "${extensions[@]}" || exit 1