package br.com.bloder.better_migrations.migrations;

import br.com.bloder.migration.Migration;
import io.realm.DynamicRealm;

/**
 * Created by bloder on 25/09/16.
 */
public class VersionOne extends Migration {

  @Override
  public void up(DynamicRealm realm) {
    realm.getSchema().get("User").addField("age", Integer.class);
  }

  @Override
  public void down(DynamicRealm realm) {
    realm.getSchema().get("User").removeField("age");
  }
}

@@ -88,16 +88,68 @@
 ration;%0A
+import br.com.bloder.migration.schema.BetterSchema;%0A
 import i
@@ -317,37 +317,107 @@
     
-realm.getSchema().get(%22User%22)
+BetterSchema betterSchema = new BetterSchema();%0A    betterSchema.setSchema(realm);%0A    betterSchema
 .add
@@ -443,16 +443,32 @@
 r.class)
+.inClass(%22User%22)
 ;%0A  %7D%0A%0A 
@@ -527,37 +527,107 @@
     
-realm.getSchema().get(%22User%22)
+BetterSchema betterSchema = new BetterSchema();%0A    betterSchema.setSchema(realm);%0A    betterSchema
 .rem
@@ -641,16 +641,32 @@
 d(%22age%22)
+.inClass(%22User%22)
 ;%0A  %7D%0A%7D%0A

Change better migration example actions