agrosner / DBFlow

A blazing fast, powerful, and very simple ORM android database library that writes database code for you.
MIT License
4.87k stars 598 forks source link

AlterTableMigration usage in dbflow v5 - class is not open #1650

Closed eMZet-zz closed 3 years ago

eMZet-zz commented 5 years ago

DBFlow Version: 5.0.0-alpha1

What is the intended way to run alter table migration in dbflow 5? How to tie AlterTableMigration to specific migration number and database?

In v4 the idea was to extend base class like so:

@Migration(version = 2, database = AppDatabase.class)
class Migration2 : AlterTableMigration<AModel>(AModel::class.java) {
    override fun onPreMigrate() {
        addColumn(SQLiteType.TEXT, "myColumn")
    }
}

which is not the case now

HossamElwahsh commented 4 years ago

DBFlow Version: 5.0.0-alpha1

What is the intended way to run alter table migration in dbflow 5? How to tie AlterTableMigration to specific migration number and database?

In v4 the idea was to extend base class like so:

@Migration(version = 2, database = AppDatabase.class)
class Migration2 : AlterTableMigration<AModel>(AModel::class.java) {
    override fun onPreMigrate() {
        addColumn(SQLiteType.TEXT, "myColumn")
    }
}

which is not the case now

I keep getting This type is final, so it cannot be inherited from on <AModel> Therfore i can't add columns to my table, how can i do it the proper way? And is there any specific documentation for v5, there is a lot of documentation pages which is like a maze each one doesn't mention the version of dbflow it is documenting

agrosner commented 3 years ago

fixed in 5.0.0-alpha2