1 /*
2  * Copyright 2021 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package androidx.room
18 
19 /**
20  * Repeatable annotation declaring the renamed columns in the [AutoMigration.to] version of an auto
21  * migration.
22  *
23  * @see AutoMigration
24  */
25 @Repeatable
26 @Target(AnnotationTarget.CLASS)
27 @Retention(AnnotationRetention.BINARY)
28 @OptIn(ExperimentalMultiplatform::class)
29 @OptionalExpectation
30 public expect annotation class RenameColumn(
31     /**
32      * Name of the table in the [AutoMigration.from] version of the database the renamed column is
33      * found in. The name in [AutoMigration.from] version is used in case the table was renamed in
34      * the [AutoMigration.to] version.
35      *
36      * @return Name of the table
37      */
38     val tableName: String,
39 
40     /**
41      * Name of the column in the [AutoMigration.from] version of the database.
42      *
43      * @return Name of the column.
44      */
45     val fromColumnName: String,
46 
47     /**
48      * Name of the column in the [AutoMigration.to] version of the database.
49      *
50      * @return Name of the column.
51      */
52     val toColumnName: String,
53 )
54