title: How to use flyway with gradle? First migration depends on gradle build
body: <p>I'm using gradle and now adding flyway to my project. I have problem with first migration - V1__xxx.sql. Sometimes it is executing, sometimes it's not.</p>
  
  <h2>Given</h2>
  
  <p>I have 3 migration files:</p>
  
  <ul>
  <li>V1__create.sql -- creates person1 table</li>
  <li>V2__create_db.sql -- creates person2 table</li>
  <li>V3__Create_person_table.sql -- creates person3 table</li>
  </ul>
  
  <p>I've done 4 test cases trying to get what's going on. </p>
  
  <h2>When</h2>
  
  <p>Before each one I did: 
      <code>gradle clean flywayclean</code></p>
  
  <p>Test Case 1. creates tables: person2, person3</p>
  
  <pre><code>gradle flywayinit flywaymigrate
  </code></pre>
  
  <p>Test Case 2. creates tables: person1, person2, person3</p>
  
  <pre><code>gradle flywaymigrate
  </code></pre>
  
  <p>Test Case 3. creates tables: person1, person2, person3</p>
  
  <pre><code>gradle build flywaymigrate
  </code></pre>
  
  <p>Test Case 4. creates tables: person2, person3</p>
  
  <pre><code>gradle build flywayinit flywaymigrate
  </code></pre>
  
  <h2>Then</h2>
  
  <p>I was expecting that all three tables: person1, person2 and person3 will be created every time. But they don't</p>
  
  <h2>Questions</h2>
  
  <p>I don't have any failure logs nor warnings. But sometimes first table is not created. And I want to ask you:</p>
  
  <ol>
  <li>Why does it work that way? Why sometimes the first sql is executed and sometimes it's not? What am I missing?</li>
  <li>How should I properly use gradle clean/build and gradle flywayclean/init/migrate?</li>
  </ol>