AlterTableMigration to add column throws compile-time error
See original GitHub issueDBFlow Version: 4.0.4 Issue Kind (Bug, Question, Feature): Question
Description: I have a table that I want to add a column to. I added the column in the Model class and added the below class to my Database class.
`@Migration(version = WizardryDatabase.VERSION, priority = 0, database = WizardryDatabase.class) public class Migration3 extends AlterTableMigration<Bibliography> {
public Migration3(Class<Bibliography> table) {
super(table);
}
@Override
public void onPreMigrate() {
super.onPreMigrate();
addColumn(SQLiteType.TEXT, "test");
}
}`
However, I am getting this error when compiling:
Error:(18, 21) error: an enclosing instance that contains WizardryDatabase.Migration3 is required
I have incremented the version number in the Database class.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Confusion on Room Auto Migration with NOT NULL ...
Long Version. This code tell me that Room Compiler will throw an exception if new column is nonNull BUT it has not being...
Read more >Framework support for implementing column alterations #240
The official SQLite docs recommend implementing the following process to achieve column alterations that they do not support:
Read more >Fixing ALTER TABLE errors with Flask-Migrate and SQLite
A nasty type of issue occurs when the ALTER TABLE error occurs in the middle of a migration, after some operations were already...
Read more >Migrating Room databases
If Room detects ambiguous schema changes and it is unable to generate a migration plan without more input, it throws a compile-time error...
Read more >Database Engine events and errors - SQL Server
Consult this MSSQL error code list to find explanations for error messages for SQL Server database engine events.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
make the inner class
static
. it appears you’re making it inner.@strapp342
Thanks a lot. For those who were confused like me, here is my example with Kotlin:
where
NotificationModel
didn’t haveepochIm
in version 1.Make sure to also change the versions, since that was my mistake for the past little while…