mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
fix: add database migrations for isShort in watchHistoryItem
This commit is contained in:
parent
d1cb212e98
commit
2759121036
@ -39,7 +39,7 @@ import com.github.libretube.db.obj.WatchPosition
|
||||
DownloadItem::class,
|
||||
SubscriptionGroup::class
|
||||
],
|
||||
version = 15,
|
||||
version = 16,
|
||||
autoMigrations = [
|
||||
AutoMigration(from = 7, to = 8),
|
||||
AutoMigration(from = 8, to = 9),
|
||||
|
@ -35,14 +35,22 @@ object DatabaseHolder {
|
||||
private val MIGRATION_14_15 = object : Migration(14, 15) {
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL(
|
||||
"ALTER TABLE 'downloaditem' ADD COLUMN 'language' TEXT DEFAULT NULL"
|
||||
"ALTER TABLE 'downloadItem' ADD COLUMN 'language' TEXT DEFAULT NULL"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private val MIGRATION_15_16 = object : Migration(15, 16) {
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL(
|
||||
"ALTER TABLE 'watchHistoryItem' ADD COLUMN 'isShort' INTEGER NOT NULL DEFAULT 0"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
val Database by lazy {
|
||||
Room.databaseBuilder(LibreTubeApp.instance, AppDatabase::class.java, DATABASE_NAME)
|
||||
.addMigrations(MIGRATION_11_12, MIGRATION_12_13, MIGRATION_13_14, MIGRATION_14_15)
|
||||
.addMigrations(MIGRATION_11_12, MIGRATION_12_13, MIGRATION_13_14, MIGRATION_14_15, MIGRATION_15_16)
|
||||
.fallbackToDestructiveMigration()
|
||||
.build()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user