mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-06-05 17:00:23 +02:00
Added note title to widget (#268)
This commit is contained in:
@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user