Prepopulate favourite categories
parent
fe14ccb5ec
commit
d99450c5a3
@ -0,0 +1,16 @@
|
|||||||
|
package org.koitharu.kotatsu.core.db
|
||||||
|
|
||||||
|
import android.content.res.Resources
|
||||||
|
import androidx.room.RoomDatabase
|
||||||
|
import androidx.sqlite.db.SupportSQLiteDatabase
|
||||||
|
import org.koitharu.kotatsu.R
|
||||||
|
|
||||||
|
class DatabasePrePopulateCallback(private val resources: Resources) : RoomDatabase.Callback() {
|
||||||
|
|
||||||
|
override fun onCreate(db: SupportSQLiteDatabase) {
|
||||||
|
db.execSQL(
|
||||||
|
"INSERT INTO favourite_categories (created_at, sort_key, title) VALUES (?,?,?)",
|
||||||
|
arrayOf(System.currentTimeMillis(), 1, resources.getString(R.string.read_later))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue