Exception occuring when updating database schema in symfony

I am pretty new to Symfony and Doctrine and as such have been playing around with a branch of some code which I will need to be working on commercially in the near future.

To cut a long story short I am at the stage now where I have amended an existing entity in order to add a new parameter. I have updated the ORM annotation to represent this, as I understand it if I run the following:

  • creating /tmp directory inside docker
  • Can't run Docker container due device mapper error
  • Docker-Compose: Initialize vs Run
  • Unable to connect to docker container to container
  • User and file permission configuration in Docker containers (docker-compose version 3)
  • Add development or debugging tools layer to existing docker containers
  • php app/console doctrine:migrations:diff

    This should automatically update the database table to add a new column to accommodate my new property. However when I run it I get the following error:

      An exception occured in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known  

    Its probably worth noting that the project is already communicating with the database successfully when you interact with it via forms in the browser so i’m rather confused why this error is appearing?

    I am also running the database on a docker container, which I assume is probably contributing to this error.

    Any ideas?

  • docker webpack compiled files missing when running
  • Deis Workflow v2.9.0 deis pull deis/example-go -a <app-name> Error
  • how to use digitallyseamless/nodejs-bower-grunt-runtime:compass-support in wercker?
  • Volume is not shared between nodes of Docker Swarm
  • Docker running Windows applications
  • Maven's target jar does not exist on Docker Hub
  • One Solution collect form web for “Exception occuring when updating database schema in symfony”

    In order for symfony2 to be able to communicate with your database, you will need to set the correct parameters in app/config/parameters.yml.

    On initial installation using composer the command line could also ask for these paramters (database, username, password and hostname).

    No matter which method is used, at the long last you’ll find them in app/config/parameters.yml.

    Good luck!

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.