# RenameColumn

Artifact: [androidx.room:room-common](https://developer.android.com/jetpack/androidx/releases/room) [View Source](https://cs.android.com/search?q=file:androidx/room/RenameColumn.+class:androidx.room.RenameColumn) Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/room#2.4.0)

*** ** * ** ***

Common/AllAndroid/JVMNative/C/iOSJavaScript
- Cmn

  ```
  @Repeatable
  @Target(allowedTargets = [AnnotationTarget.CLASS])
  @Retention(value = AnnotationRetention.BINARY)
  @OptionalExpectation
  annotation RenameColumn
  ```
- android

  ```
  @Repeatable(value = RenameColumn.Entries)
  @Target(allowedTargets = [AnnotationTarget.CLASS])
  @Retention(value = AnnotationRetention.BINARY)
  annotation RenameColumn
  ```

*** ** * ** ***

Repeatable annotation declaring the renamed columns in the `https://developer.android.com/reference/kotlin/androidx/room/AutoMigration#to()` version of an auto migration.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/room/AutoMigration` |   |

## Summary

| ### Nested types |
|---|
| `@https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-target/index.html(allowedTargets = [https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-annotation-target/-c-l-a-s-s/index.html]) @https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-retention/index.html(value = https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-annotation-retention/-b-i-n-a-r-y/index.html) annotation https://developer.android.com/reference/kotlin/androidx/room/RenameColumn.Entries` Container annotation for the repeatable annotation `https://developer.android.com/reference/kotlin/androidx/room/RenameColumn`. |

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/room/RenameColumn#RenameColumn(kotlin.String,kotlin.String,kotlin.String)( tableName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, fromColumnName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, toColumnName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html )` | Cmn android |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/room/RenameColumn#fromColumnName()` Name of the column in the `https://developer.android.com/reference/kotlin/androidx/room/AutoMigration#from()` version of the database. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/room/RenameColumn#tableName()` Name of the table in the `https://developer.android.com/reference/kotlin/androidx/room/AutoMigration#from()` version of the database the renamed column is found in. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/room/RenameColumn#toColumnName()` Name of the column in the `https://developer.android.com/reference/kotlin/androidx/room/AutoMigration#to()` version of the database. | Cmn android |

## Public constructors

### RenameColumn

Cmn android Added in [2.8.5](https://developer.android.com/jetpack/androidx/releases/room#2.8.5)

```
RenameColumn(
    tableName: String,
    fromColumnName: String,
    toColumnName: String
)
```

## Public properties

### fromColumnName

Cmn android

```
val fromColumnName: String
```

Name of the column in the `https://developer.android.com/reference/kotlin/androidx/room/AutoMigration#from()` version of the database.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | Name of the column. |

### tableName

Cmn android

```
val tableName: String
```

Name of the table in the `https://developer.android.com/reference/kotlin/androidx/room/AutoMigration#from()` version of the database the renamed column is found in. The name in `https://developer.android.com/reference/kotlin/androidx/room/AutoMigration#from()` version is used in case the table was renamed in the `https://developer.android.com/reference/kotlin/androidx/room/AutoMigration#to()` version.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | Name of the table |

### toColumnName

Cmn android

```
val toColumnName: String
```

Name of the column in the `https://developer.android.com/reference/kotlin/androidx/room/AutoMigration#to()` version of the database.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | Name of the column. |