Android:Update Realm tables and Migration
<p>This Is my current configuration for realm migration </p>

<pre><code> RealmConfiguration realmConfiguration = new RealmConfiguration.Builder(this)
                                            .schemaVersion(2)
                                            .migration(new Migration())
                                            .build();


public class Migration implements RealmMigration {

        @Override
        public void migrate(final DynamicRealm realm, long oldVersion, long newVersion){

            RealmSchema schema = realm.getSchema();

            if(oldVersion == 1){
                RealmObjectSchema sweatPointSchema = schema.get("UserInfoDB");
                        sweatPointSchema.addField("sweatPoints",Integer.class);

                oldVersion++;
            }

            if(oldVersion == 2){
                RealmObjectSchema teamInfoSchema = schema.get("TeamInfoDB");
                        teamInfoSchema.addField("teamDescription",String.class);

                oldVersion ++;
            }



        }
    }
</code></pre>

<p>Now I need to update some particular table for next migration So I update my realm configuration and migration as follows</p>

<pre><code>RealmConfiguration realmConfiguration = new RealmConfiguration.Builder(this)
                                            .schemaVersion(3)
                                            .migration(new Migration())
                                            .build();

 public class Migration implements RealmMigration {

        @Override
        public void migrate(final DynamicRealm realm, long oldVersion, long newVersion){

            RealmSchema schema = realm.getSchema();

            if(oldVersion == 1){
                RealmObjectSchema sweatPointSchema = schema.get("UserInfoDB");
                        sweatPointSchema.addField("sweatPoints",Integer.class);

                oldVersion++;
            }

            if(oldVersion == 2){
                RealmObjectSchema teamInfoSchema = schema.get("TeamInfoDB");
                        teamInfoSchema.addField("teamDescription",String.class);

                oldVersion ++;
            }

            if(oldVersion == 3){
                RealmObjectSchema leaderboardInfoSchema = schema.get("LeaderBoardDb");
                            leaderboardInfoSchema.addField("displayName",String.class);


                oldVersion ++;

            }

        }
    }

public class LeaderBoardDb extends RealmObject {
    private String percentile;

    private String rank;

    private String details;

    private String email;

    @PrimaryKey
    private String userId;

    private String name;

    private String rewards;

    private String sweatPointEarned;

    private String photoUrl;

    private String note;


    private String displayName;
}
</code></pre>

<p>I Have omitted getter and setter here but they are already set .
Now whenever I run my application I get the error stack as follows as</p>

<pre><code>03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime: FATAL EXCEPTION: main
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime: Process: com.workoutguru.workoutcash, PID: 22111
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.workoutguru.workoutcash/com.workoutguru.workoutcash.DrawerActivity}: java.lang.IllegalArgumentException: Field already exists in 'TeamInfoDB': teamDescription
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2413)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at android.app.ActivityThread.access$900(ActivityThread.java:175)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:146)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5602)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at java.lang.reflect.Method.invokeNative(Native Method)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:515)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at dalvik.system.NativeStart.main(Native Method)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:  Caused by: java.lang.IllegalArgumentException: Field already exists in 'TeamInfoDB': teamDescription
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at io.realm.RealmObjectSchema.checkFieldNameIsAvailable(RealmObjectSchema.java:498)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at io.realm.RealmObjectSchema.checkNewFieldName(RealmObjectSchema.java:484)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at io.realm.RealmObjectSchema.addField(RealmObjectSchema.java:142)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at com.workoutguru.workoutcash.realmDB.Migration.migrate(Migration.java:27)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at io.realm.BaseRealm$2.onResult(BaseRealm.java:604)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at io.realm.RealmCache.invokeWithGlobalRefCount(RealmCache.java:242)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at io.realm.BaseRealm.migrateRealm(BaseRealm.java:591)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at io.realm.Realm.migrateRealm(Realm.java:1224)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at io.realm.Realm.migrateRealm(Realm.java:1213)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at io.realm.Realm.createInstance(Realm.java:237)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:114)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at io.realm.Realm.getDefaultInstance(Realm.java:181)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at com.workoutguru.workoutcash.DrawerActivity.exportDatabase(DrawerActivity.java:268)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at com.workoutguru.workoutcash.DrawerActivity.onCreate(DrawerActivity.java:207)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at android.app.Activity.performCreate(Activity.java:5451)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2377)
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471) 
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at android.app.ActivityThread.access$900(ActivityThread.java:175) 
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308) 
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102) 
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:146) 
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5602) 
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at java.lang.reflect.Method.invokeNative(Native Method) 
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:515) 
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283) 
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099) 
03-24 13:09:53.191 22111-22111/com.workoutguru.workoutcash E/AndroidRuntime:     at dalvik.system.NativeStart.main(Native Method) 
</code></pre>