Common: fix migration and update version-code

This commit is contained in:
Felix 2018-12-26 18:01:23 +01:00
parent da8063937e
commit 7a7be2b616
2 changed files with 5 additions and 2 deletions

View file

@ -28,7 +28,7 @@ allprojects {
ext{
touchVersionCode = 31
touchVersionCode = 33
touchVersionName = "0.4"
leanbackVersionCode = 16
leanbackVersionName = "0.4"

View file

@ -81,7 +81,10 @@ abstract class ChaosflixDatabase : RoomDatabase() {
database.execSQL("INSERT INTO `playback_progress` (id, event_guid, progress, watch_date) " +
"SELECT id, event_guid, progress, 0 from old_playback_progress")
database.execSQL("DROP TABLE old_playback_progress")
database.execSQL("ALTER TABLE conference ADD COLUMN lastReleasedAt varchar default '1970-01-01'")
database.execSQL("ALTER TABLE conference ADD COLUMN lastReleasedAt TEXT NOT NULL DEFAULT '1970-01-01'")
database.execSQL("CREATE UNIQUE INDEX IF NOT EXISTS index_recording_backendId ON recording (backendId)")
database.execSQL("CREATE UNIQUE INDEX IF NOT EXISTS index_related_parentEventId_relatedEventGuid ON related (parentEventId, relatedEventGuid)")
database.execSQL("CREATE UNIQUE INDEX IF NOT EXISTS index_playback_progress_event_guid ON playback_progress (event_guid)")
}
}
}