{"id":9596,"date":"2024-12-06T13:28:45","date_gmt":"2024-12-06T04:28:45","guid":{"rendered":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=9596"},"modified":"2024-12-06T14:51:52","modified_gmt":"2024-12-06T05:51:52","slug":"%ec%95%88%eb%93%9c%eb%a1%9c%ec%9d%b4%eb%93%9c-%ec%9e%90%eb%8f%99-%eb%a7%88%ec%9d%b4%ea%b7%b8%eb%9e%98%ec%9d%b4%ec%85%98","status":"publish","type":"post","link":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=9596","title":{"rendered":"\uc548\ub4dc\ub85c\uc774\ub4dc \uc790\ub3d9 \ub9c8\uc774\uadf8\ub798\uc774\uc158"},"content":{"rendered":"<h1>\uc548\ub4dc\ub85c\uc774\ub4dc \uc790\ub3d9 \ub9c8\uc774\uadf8\ub798\uc774\uc158<\/h1>\n<p>AutoMigration \uc744 \ucd94\uac00\ud574 \uc8fc\uba74 \uceec\ub7fc \ucd94\uac00\uc815\ub3c4\ub294 \uc9c0\uc6d0\ud574 \uc900\ub2e4.<\/p>\n<pre><code class=\"language-java\">\/\/ Database class before the version update.\n@Database(\n  version = 1,\n  entities = {User.class}\n)\npublic abstract class AppDatabase extends RoomDatabase {\n  ...\n}\n\n\/\/ Database class after the version update.\n@Database(\n  version = 2,\n  entities = {User.class},\n  autoMigrations = {\n    @AutoMigration (from = 1, to = 2,\n                        spec = AppDatabase.MyAutoMigration.class)\n  }\n)\npublic abstract class AppDatabase extends RoomDatabase {\n  ...\n    \/\/ @RenameTable(fromTableName = &quot;User&quot;, toTableName = &quot;AppUser&quot;)\n    static class MyAutoMigration implements AutoMigrationSpec { }\n}<\/code><\/pre>\n<p>\uc544\ub798\uc758 \ub0b4\uc6a9\uc774 \ud544\uc694\ud55c\uc9c0 \uc544\ub2cc\uc9c0\ub294 \uc880 \uc560\ub9e4\ud558\ub2e4.<\/p>\n<pre><code class=\"language-groovy\">android {\n    defaultConfig {\n\n        javaCompileOptions {\n            annotationProcessorOptions {\n                arguments += [\n                        &quot;room.schemaLocation&quot;: &quot;$projectDir\/schemas&quot;.toString(),\n                        &quot;room.incremental&quot;: &quot;true&quot;\n                ]\n            }\n        }\n    }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\uc548\ub4dc\ub85c\uc774\ub4dc \uc790\ub3d9 \ub9c8\uc774\uadf8\ub798\uc774\uc158 AutoMigration \uc744 \ucd94\uac00\ud574 \uc8fc\uba74 \uceec\ub7fc \ucd94\uac00\uc815\ub3c4\ub294 \uc9c0\uc6d0\ud574 \uc900\ub2e4. \/\/ Database class before the version update. @Database( version = 1, entities = {User.class} ) public abstract class AppDatabase extends RoomDatabase { &#8230; } \/\/ Database class after the version update. @Database( version = 2, entities = {User.class}, autoMigrations = { @AutoMigration (from =\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=9596\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[],"class_list":["post-9596","post","type-post","status-publish","format-standard","hentry","category-android"],"_links":{"self":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/9596","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9596"}],"version-history":[{"count":3,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/9596\/revisions"}],"predecessor-version":[{"id":9599,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/9596\/revisions\/9599"}],"wp:attachment":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9596"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}