Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@ data class Artist(
override var index: String? = null,
override var coverArt: String? = null,
override var albumCount: Long? = null,
override var closeness: Int = 0
override var closeness: Int = 0,
var genre: String? = null,
var genres: List<String>? = null,
var description: String? = null
) : ArtistOrIndex(id, serverId)
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ class ActiveServerProvider(
)
.addMigrations(META_MIGRATION_2_3)
.addMigrations(META_MIGRATION_3_4)
.addMigrations(META_MIGRATION_4_5)
.fallbackToDestructiveMigrationOnDowngrade()
.build()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import org.moire.ultrasonic.domain.Track
)
],
exportSchema = true,
version = 4
version = 5
)
@TypeConverters(Converters::class)
abstract class MetaDatabase : RoomDatabase() {
Expand Down Expand Up @@ -113,3 +113,11 @@ val META_MIGRATION_3_4: Migration = object : Migration(3, 4) {
db.execSQL("ALTER TABLE `albums` ADD COLUMN `date` TEXT")
}
}

val META_MIGRATION_4_5: Migration = object : Migration(4, 5) {
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL("ALTER TABLE `artists` ADD COLUMN `genre` TEXT")
db.execSQL("ALTER TABLE `artists` ADD COLUMN `genres` TEXT")
db.execSQL("ALTER TABLE `artists` ADD COLUMN `description` TEXT")
}
}