Upgrade db, add unique index for download label

This commit is contained in:
FooIbar authored and tarsin committed 2023-07-21 06:19:10 +08:00
1 parent 31dcd349df
commit 1c38dbaa0b
3 files changed
+419 -2

No files matched your search

@@ -109,7 +109,7 @@ class ThumbKeyMigration : AutoMigrationSpec {
@Database(
entities = [BaseGalleryInfo::class, DownloadEntity::class, DownloadLabel::class, DownloadDirname::class, Filter::class, HistoryInfo::class, LocalFavoriteInfo::class, QuickSearch::class],
version = 14,
version = 15,
exportSchema = true,
autoMigrations = [
AutoMigration(
@@ -159,6 +159,10 @@ class ThumbKeyMigration : AutoMigrationSpec {
to = 14,
spec = GalleryTableMigration::class,
),
AutoMigration(
from = 14,
to = 15,
),
],
)
@TypeConverters(FilterModeConverter::class)
@@ -2,9 +2,10 @@ package com.hippo.ehviewer.dao
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.Index
import androidx.room.PrimaryKey
@Entity(tableName = "DOWNLOAD_LABELS")
@Entity(tableName = "DOWNLOAD_LABELS", indices = [Index("LABEL", unique = true)])
data class DownloadLabel(
@ColumnInfo(name = "LABEL")
var label: String,