[Hotfix] Fix merge problems and migration 96 crashing.

This commit is contained in:
Kuba Szczodrzyński 2021-10-19 17:06:10 +02:00
parent ca3e6f7fc9
commit fd62653d79
No known key found for this signature in database
GPG Key ID: 70CB8A85BA1633CB
3 changed files with 4 additions and 4 deletions

View File

@ -4,12 +4,12 @@
package pl.szczodrzynski.edziennik.data.api.edziennik.vulcan.data.hebe
import pl.szczodrzynski.edziennik.DAY
import pl.szczodrzynski.edziennik.data.api.VULCAN_HEBE_ENDPOINT_TEACHERS
import pl.szczodrzynski.edziennik.data.api.edziennik.vulcan.DataVulcan
import pl.szczodrzynski.edziennik.data.api.edziennik.vulcan.ENDPOINT_VULCAN_HEBE_TEACHERS
import pl.szczodrzynski.edziennik.data.api.edziennik.vulcan.data.VulcanHebe
import pl.szczodrzynski.edziennik.getString
import pl.szczodrzynski.edziennik.ext.DAY
import pl.szczodrzynski.edziennik.ext.getString
class VulcanHebeTeachers(
override val data: DataVulcan,

View File

@ -10,6 +10,6 @@ import androidx.sqlite.db.SupportSQLiteDatabase
class Migration96 : Migration(95, 96) {
override fun migrate(database: SupportSQLiteDatabase) {
// teachers - associated subjects list
database.execSQL("ALTER TABLE teachers ADD COLUMN teacherSubjects TEXT NOT NULL;")
database.execSQL("ALTER TABLE teachers ADD COLUMN teacherSubjects TEXT NOT NULL DEFAULT '[]';")
}
}

View File

@ -48,7 +48,7 @@ class TeachersListFragment : Fragment(), CoroutineScope {
val adapter = TeachersAdapter(activity)
app.db.teacherDao().getAllTeachers(App.profileId).observe(this@TeachersListFragment, Observer { items ->
app.db.teacherDao().getAllTeachers(App.profileId).observe(viewLifecycleOwner, Observer { items ->
if (!isAdded) return@Observer
// load & configure the adapter