title: How to handle a previous Flyway migration becoming invalid in newer DB versions?
body: <p>So, I have a Flyway migration which applied successfully, years ago, to an older version of MariaDB.</p>
  
  <p>A newer release of MariaDB is now more strict, and causes an error on that same migration. There's a legit issue with that migration that I want to fix for both fresh runs from the baseline (e.g. building in my CI environment, or on a new devleoper's laptop), and for all of my existing databases (before I attempt to upgrade them to a newer MariaDB release, which may just fail).</p>
  
  <p>What's the right solution?</p>
  
  <ul>
  <li>Alter the migration, and add a new one that does the same fix (another ALTER TABLE ...) that'll effectively be a noop for the newly created DBs, but will fix my existing stuff.</li>
  <li>Add a new migration versioned out-of-order, just prior to the broken one, which fixes the issue. Hopefully that means new DBs will apply that just before the broke migration, and existing installs will apply it before any of my newer migrations?</li>
  </ul>
  
  <p>To be specific, the issue was that I was migrating a table which was originally using <code>ENGINE=MyISAM ROW_FORMAT=FIXED</code> to <code>ENGINE=InnoDB</code> -- MariaDB 10.1 accepts that, but newer MariaDB releases seem to fail unless I also add <code>ROW_FORMAT=DEFAULT</code>.</p>
  
  <hr>
  
  <h3>Baseline</h3>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE TABLE FOO ( ... )
     ENGINE=MyISAM ROW_FORMAT=FIXED;
  </code></pre>
  
  <h3>Later Migration</h3>
  
  <pre class="lang-sql prettyprint-override"><code>ALTER TABLE FOO
    ENGINE=InnoDB;
  </code></pre>
  
  <p>That latter statement fails on a newer MariaDB release (and possibly for MySQL too, not sure?).</p>
  
  <p>This statement works, though:</p>
  
  <pre class="lang-sql prettyprint-override"><code>ALTER TABLE FOO
    ENGINE=InnoDB ROW_FORMAT=DEFAULT;
  </code></pre>
  
  <p>The issue is that the previous statement internally tries to do something like this, which fails:</p>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE TABLE FOO ( ... )
     ENGINE=InnoDB ROW_FORMAT=FIXED;
  </code></pre>