build(room): KSP room.schemaLocation 설정 및 exportSchema=true로 스키마 export 활성화
프로젝트가 이미 KSP를 사용하고 있어 KSP 인수 기반으로 Room 스키마 export를 활성화했습니다.
- app/build.gradle: ksp { room.schemaLocation 등 } 추가
- Room DB 클래스 3종: exportSchema=true
- app/schemas 디렉터리 버전 관리
This commit is contained in:
@@ -8,7 +8,7 @@ import androidx.room.TypeConverters
|
||||
import kr.co.vividnext.sodalive.audio_content.PlaybackTracking
|
||||
import kr.co.vividnext.sodalive.common.Converter
|
||||
|
||||
@Database(entities = [PlaybackTracking::class], version = 1)
|
||||
@Database(entities = [PlaybackTracking::class], version = 1, exportSchema = true)
|
||||
@TypeConverters(Converter::class)
|
||||
abstract class PlaybackTrackingDatabase : RoomDatabase() {
|
||||
abstract fun playbackTrackingDao(): PlaybackTrackingDao
|
||||
|
||||
@@ -9,7 +9,7 @@ import androidx.room.migration.Migration
|
||||
import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
import kr.co.vividnext.sodalive.common.Converter
|
||||
|
||||
@Database(entities = [Alarm::class], version = 2)
|
||||
@Database(entities = [Alarm::class], version = 2, exportSchema = true)
|
||||
@TypeConverters(Converter::class)
|
||||
abstract class AlarmDatabase : RoomDatabase() {
|
||||
abstract fun alarmDao(): AlarmDao
|
||||
@@ -33,8 +33,8 @@ abstract class AlarmDatabase : RoomDatabase() {
|
||||
}
|
||||
|
||||
private val MIGRATION_1_2 = object : Migration(1, 2) {
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL(
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
db.execSQL(
|
||||
"ALTER TABLE 'alarms' ADD COLUMN 'volume' integer not null default 15"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import androidx.room.RoomDatabase
|
||||
import androidx.room.TypeConverters
|
||||
import kr.co.vividnext.sodalive.common.Converter
|
||||
|
||||
@Database(entities = [RecentContent::class], version = 1)
|
||||
@Database(entities = [RecentContent::class], version = 1, exportSchema = true)
|
||||
@TypeConverters(Converter::class)
|
||||
abstract class RecentContentDatabase : RoomDatabase() {
|
||||
abstract fun recentContentDao(): RecentContentDao
|
||||
|
||||
Reference in New Issue
Block a user