프로젝트가 이미 KSP를 사용하고 있어 KSP 인수 기반으로 Room 스키마 export를 활성화했습니다.
- app/build.gradle: ksp { room.schemaLocation 등 } 추가
- Room DB 클래스 3종: exportSchema=true
- app/schemas 디렉터리 버전 관리
		
	
		
			
				
	
	
		
			58 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			JSON
		
	
	
	
	
	
			
		
		
	
	
			58 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			JSON
		
	
	
	
	
	
{
 | 
						|
  "formatVersion": 1,
 | 
						|
  "database": {
 | 
						|
    "version": 1,
 | 
						|
    "identityHash": "e46a8b457c3ea6ceefd0db76bb763056",
 | 
						|
    "entities": [
 | 
						|
      {
 | 
						|
        "tableName": "recent_contents",
 | 
						|
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`contentId` INTEGER NOT NULL, `coverImageUrl` TEXT NOT NULL, `title` TEXT NOT NULL, `creatorNickname` TEXT NOT NULL, `listenedAt` INTEGER NOT NULL, PRIMARY KEY(`contentId`))",
 | 
						|
        "fields": [
 | 
						|
          {
 | 
						|
            "fieldPath": "contentId",
 | 
						|
            "columnName": "contentId",
 | 
						|
            "affinity": "INTEGER",
 | 
						|
            "notNull": true
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "fieldPath": "coverImageUrl",
 | 
						|
            "columnName": "coverImageUrl",
 | 
						|
            "affinity": "TEXT",
 | 
						|
            "notNull": true
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "fieldPath": "title",
 | 
						|
            "columnName": "title",
 | 
						|
            "affinity": "TEXT",
 | 
						|
            "notNull": true
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "fieldPath": "creatorNickname",
 | 
						|
            "columnName": "creatorNickname",
 | 
						|
            "affinity": "TEXT",
 | 
						|
            "notNull": true
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "fieldPath": "listenedAt",
 | 
						|
            "columnName": "listenedAt",
 | 
						|
            "affinity": "INTEGER",
 | 
						|
            "notNull": true
 | 
						|
          }
 | 
						|
        ],
 | 
						|
        "primaryKey": {
 | 
						|
          "autoGenerate": false,
 | 
						|
          "columnNames": [
 | 
						|
            "contentId"
 | 
						|
          ]
 | 
						|
        },
 | 
						|
        "indices": [],
 | 
						|
        "foreignKeys": []
 | 
						|
      }
 | 
						|
    ],
 | 
						|
    "views": [],
 | 
						|
    "setupQueries": [
 | 
						|
      "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
 | 
						|
      "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'e46a8b457c3ea6ceefd0db76bb763056')"
 | 
						|
    ]
 | 
						|
  }
 | 
						|
} |