use of com.orm.androrm.field.CharField in project androrm by androrm.
the class ModelWithMigration method migrate.
@Override
protected void migrate(Context context) {
Migrator<ModelWithMigration> migrator = new Migrator<ModelWithMigration>(ModelWithMigration.class);
migrator.addField("mTestField", new CharField());
migrator.migrate(context);
}
use of com.orm.androrm.field.CharField in project androrm by androrm.
the class CharFieldTest method testDefaults.
public void testDefaults() {
CharField c = new CharField();
assertEquals("`foo` varchar", c.getDefinition("foo"));
assertNull(c.get());
}
use of com.orm.androrm.field.CharField in project androrm by androrm.
the class CharFieldTest method testSetAndGet.
public void testSetAndGet() {
CharField c = new CharField();
c.set("foo");
assertEquals("foo", c.get());
}
use of com.orm.androrm.field.CharField in project androrm by androrm.
the class CharFieldTest method testMods.
public void testMods() {
CharField c = new CharField(0);
assertEquals("`foo` varchar", c.getDefinition("foo"));
c = new CharField(256);
assertEquals("`foo` varchar", c.getDefinition("foo"));
c = new CharField(50);
assertEquals("`foo` varchar(50)", c.getDefinition("foo"));
}