# ProvidedAutoMigrationSpec

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

*** ** * ** ***


```
@Target(allowedTargets = [AnnotationTarget.CLASS])
@Retention(value = AnnotationRetention.BINARY)
public annotation ProvidedAutoMigrationSpec
```

<br />

*** ** * ** ***

Marks a class as an auto migration spec that will be provided to Room at runtime.

An instance of a class annotated with this annotation has to be provided to Room using `Room.databaseBuilder.addAutoMigrationSpec(AutoMigrationSpec)`. Room will verify that the spec is provided in the builder configuration and if not, an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` will be thrown.