title: Prepopulating grails app mysql database in cloud foundry
body: <p>I need to prepopulate mysql database which is the backend for a Grails Application. This is working fine in local and I need to move to cloud foundry.</p>
  
  <p>I used to prepopulate mysql database in local by executing sql. But now I need to prepopulate the mysql database which is cloud foundry service.</p>
  
  <p>This is what I tried. I installed database migration plugin. Generated the changelog file without any data so that it contains only DDL statements. Then I inserted below code at end of changelog file.</p>
  
  <pre><code> changeSet(author: "home (generated)", id: "1330581560176-85") {
  
            sqlFile( path: "config.sql")
     }          
  </code></pre>
  
  <p>Below is the entry for config.</p>
  
  <pre><code>grails.plugin.databasemigration.updateOnStart = true
  grails.plugin.databasemigration.updateOnStartFileNames = changelog.groovy
  </code></pre>
  
  <p>My cloudfoundry app still starts with empty tables. Can anyone point me right direction.</p>
  
  <p><strong>UPDATE</strong><br>
  I was able to do this. I was doing database migration wrongly. After reading <a href="http://blog.springsource.org/2011/08/17/countdown-to-grails-2-0-database-migrations/" rel="nofollow">http://blog.springsource.org/2011/08/17/countdown-to-grails-2-0-database-migrations/</a> properly I was able to get this working by putting sqlFile() in changelog.groovy file.</p>