TP-69321 | Owais | removed db migration as it is not needed (#186)

This commit is contained in:
Sayed Owais Ali
2024-06-05 18:31:08 +05:30
committed by GitHub
parent d0a069eaf5
commit b7049cab68
3 changed files with 0 additions and 19 deletions

View File

@@ -9,8 +9,6 @@ package com.navi.alfred.db
import androidx.room.Database
import androidx.room.RoomDatabase
import androidx.room.migration.Migration
import androidx.sqlite.db.SupportSQLiteDatabase
import com.navi.alfred.db.dao.AnalyticsDAO
import com.navi.alfred.db.dao.ApiMetricDao
import com.navi.alfred.db.dao.FailureEventDao
@@ -23,8 +21,6 @@ import com.navi.alfred.db.model.FailureEvent
import com.navi.alfred.db.model.NegativeCase
import com.navi.alfred.db.model.ScreenShotPathHelper
import com.navi.alfred.db.model.ZipDetailsHelper
import com.navi.alfred.utils.AlfredConstants.DB_VERSION_V5
import com.navi.alfred.utils.AlfredConstants.DB_VERSION_V6
@Database(
entities =
@@ -52,15 +48,3 @@ abstract class AlfredDatabase : RoomDatabase() {
abstract fun failureEventDao(): FailureEventDao
}
val ALFRED_DATABASE_MIGRATION_5_6 =
object : Migration(DB_VERSION_V5, DB_VERSION_V6) {
override fun migrate(database: SupportSQLiteDatabase) {
// this migration changes schema of ZipDetailsHelper table by adding a new column
// zipUploadStatus and removing a redundant column zipFileName
database.execSQL("ALTER TABLE ZipDetailsHelper DROP COLUMN zipFileName")
database.execSQL(
"ALTER TABLE ZipDetailsHelper ADD COLUMN zipUploadStatus INTEGER NOT NULL DEFAULT 0"
)
}
}

View File

@@ -22,7 +22,6 @@ object AlfredDatabaseHelper {
}
val instance =
Room.databaseBuilder(context, AlfredDatabase::class.java, EVENT_DB_NAME)
.addMigrations(ALFRED_DATABASE_MIGRATION_5_6)
.fallbackToDestructiveMigration()
.build()
INSTANCE = instance

View File

@@ -121,6 +121,4 @@ object AlfredConstants {
const val ZIP_FILE_DETAIL_LIST = "zipFileDetailList"
const val CRITICAL_SECTION_MESSAGE = "CRITICAL_SECTION_ENTERED"
const val SCREENSHOT_ID_LIST = "SCREENSHOT_ID_LIST"
const val DB_VERSION_V5 = 5
const val DB_VERSION_V6 = 6
}