Added note title to widget (#268)

This commit is contained in:
Agnieszka C
2021-10-01 20:51:20 +02:00
parent d148443165
commit efbfaa8717
40 changed files with 122 additions and 7 deletions

View File

@ -17,7 +17,7 @@ import com.simplemobiletools.notes.pro.models.Note
import com.simplemobiletools.notes.pro.models.Widget
import java.util.concurrent.Executors
@Database(entities = [Note::class, Widget::class], version = 3)
@Database(entities = [Note::class, Widget::class], version = 4)
abstract class NotesDatabase : RoomDatabase() {
abstract fun NotesDao(): NotesDao
@ -40,6 +40,7 @@ abstract class NotesDatabase : RoomDatabase() {
})
.addMigrations(MIGRATION_1_2)
.addMigrations(MIGRATION_2_3)
.addMigrations(MIGRATION_3_4)
.build()
db!!.openHelper.setWriteAheadLoggingEnabled(true)
}
@ -77,5 +78,13 @@ abstract class NotesDatabase : RoomDatabase() {
}
}
}
private val MIGRATION_3_4 = object : Migration(3, 4) {
override fun migrate(database: SupportSQLiteDatabase) {
database.apply {
execSQL("ALTER TABLE widgets ADD COLUMN widget_show_title INTEGER NOT NULL DEFAULT 0")
}
}
}
}
}