在MigrationTable DbFlow中具有默认值的AddColumn字符串

时间:2016-03-11 05:25:18

标签: android dbflow

任何人都可以告诉我如何将默认值添加到Migration表中。我正在使用以下课程:

@Migration(version = PictureDatabase.VERSION, databaseName = PictureDatabase.NAME)
public class MigrationPicture extends AlterTableMigration<Picture> {
    public MigrationPicture() {
        super(Picture.class);
    }


    @Override
    public void onPreMigrate() {
        // Simple ALTER TABLE migration wraps the statements into a nice builder notation
        super.onPreMigrate();
        if(PictureDatabase.VERSION == 2) {
            addColumn(String.class, Picture$Table.PICTURETYPE);
        }
    }
}

任何帮助将不胜感激。

0 个答案:

没有答案