title: Android Realm.io migration: Fallback to .deleteRealmIfMigrationNeeded()
body: <p>When migrating an Android Realm.io instance to a newer schema I provide migration steps in my Migration implementation:</p>
  
  <pre><code>  RealmConfiguration config = new RealmConfiguration
              .Builder(this)
              .schemaVersion(SCHEMA_VERSION)
              .migration(new Migration())
              .build();
  </code></pre>
  
  <p>What I want to do in the actual migration code I want to fallback to <code>deleteRealmIfMigrationNeeded</code> for older schema versions.</p>
  
  <p>Is there any way to do that? I tried to do it with <code>deleteAll()</code> but that doesn't seem to work as some people updating from an older version of the app are getting Realm validation errors.</p>
  
  <pre><code>public class Migration implements RealmMigration {
      @Override
      public void migrate(DynamicRealm realm, long oldVersion, long newVersion) {
  
          if (oldVersion &lt; 105) {
              realm.deleteAll();
              return;
          }
  
          //handle newer schema versions
  
  
      }
  }
  </code></pre>