title: How to deploy continuous changes for database in DEV , QA , PROD environment for database in docker?
body: <blockquote>
    <p>(I want to know what is the best deployment practice use for database
    changes , suppose for example we have a node.js server if any changes
    come i deploy them by jenkins in dev if every thing goes well in DEV i
    deploy the changes to QA and PROD . Deployment means create new image
    for that changes and delete the previous node.js images with help of jenkins and docker as container . <strong>How do we do that
    for database?</strong>)</p>
  </blockquote>
  
  <p>I am working in the environment where i need database in docker environment . What i am not getting is Suppose .</p>
  
  <p>I first time i have set up the docker container for postgres , I have added all the tables to the schema and all function .</p>
  
  <p><strong>I want to know what if suppose i have to do some changes in the database .</strong></p>
  
  <p>I have DEV , QA , PROD so first the changes goes to DEV environment  and if every thing is fine it goes to QA then PROD .</p>
  
  <p>So what should be the approach for deployment the changes of docker changes . Should it be like .</p>
  
  <ol>
  <li><p>When ever any changes come .</p></li>
  <li><p>I will create new images for postgres and all the new changes to
  it manually or every time i have to add the changes in docker script
  to for the changes .</p>
  
  <p><strong>(I am not concern about the data persistent that i can do by data volume or host mounting . I am concern about how the new database changes should go to DEV then QA then PROD)</strong></p></li>
  </ol>
  
  <p><strong>How can we do continue integration / continue deployment for postgres database?</strong></p>
  
  <p><strong>For any language change</strong> like (code change in node.js ) i every time create new docker images and delete previous images .</p>
  
  <p><strong>But for database changes</strong> how can i do continue integration / continue deployment for postgres database because if i delete the docker container of postgres i have to create the whole structure again for a single line change in database .</p>
  
  <p>Any help will appreciated ? Any real life experience on this staff ?</p>