package com.fxy.base;

import io.realm.DynamicRealm;
import io.realm.RealmMigration;
import io.realm.RealmSchema;

public class RealmMigrations implements RealmMigration {
    @Override
    public void migrate(DynamicRealm realm, long oldVersion, long newVersion) {
        final RealmSchema schema = realm.getSchema();
        if(oldVersion == 1) {
            schema.create("CutRuleRealm")
                    .addField("id", int.class)
                    .addField("company_id", int.class)
                    .addField("number_start", String.class)
                    .addField("number_length", int.class)
                    .addField("cut_type", int.class)
                    .addField("start_index", int.class)
                    .addField("cut_length", int.class)
                    .addField("is_delete", String.class)
                    .addField("create_user", int.class)
                    .addField("create_date", String.class);
            oldVersion++;
        }
    }
}
