title: Restart Docker Compose with update to database
body: <p>I've been working with a simple MySQL table using Docker Compose that only included ID and NAME column.  I attempted to update my myDb.sql file that initially creates the table like this:</p>
  
  <pre><code>CREATE TABLE `Person` (
    `id` int(11) NOT NULL,
    `firstName` varchar(50) NOT NULL, // updated this column
    `lastName` varchar(50) NOT NULL  // added this column
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  </code></pre>
  
  <p>I updated the NAME column to firstName, and added a lastName column.  </p>
  
  <p>I then stopped the Docker containers by running DOCKER-COMPOSE STOP.</p>
  
  <p>I then restarted the Docker containers by running DOCKER-COMPOSE UP.  I even tried DOCKER-COMPOSE RESTART.  </p>
  
  <p>The error message I was able to print in the console was this:</p>
  
  <pre><code>SELECT '', id, `firstName` From Person&lt;br&gt;Unknown column 'firstName' in 'field list'
  </code></pre>
  
  <p>This leads me to believe that I did not restart Docker Compose correctly.</p>
  
  <p>How do I restart Docker Compose so that it runs the CREATE TABLE command?</p>
  
  <h2>Edit</h2>
  
  <p>Here is my docker-compose.yml file:</p>
  
  <pre><code>version: "3.7"
  services:
  www:
      build: .
      ports: 
          - "8001:80"
      volumes:
          - ./www:/var/www/html/
      links:
          - db
      networks:
          - default
  db:
      image: mysql:5.7.13
      ports: 
          - "3306:3306"
      environment:
          MYSQL_DATABASE: myDb
          MYSQL_USER: user
          MYSQL_PASSWORD: test
          MYSQL_ROOT_PASSWORD: test
      volumes:
          - ./dump:/docker-entrypoint-initdb.d
          - persistent:/var/lib/mysql
      networks:
          - default
  phpmyadmin:
      image: phpmyadmin/phpmyadmin
      links: 
          - db:db
      ports:
          - 8000:80
      environment:
          MYSQL_USER: user
          MYSQL_PASSWORD: test
          MYSQL_ROOT_PASSWORD: test
  volumes:
      persistent:
  </code></pre>
  
  <p>My Dockerfile looks like this:</p>
  
  <pre><code>FROM php:7.0.30-apache 
  RUN docker-php-ext-install mysqli
  </code></pre>