# Room cannot verify the data integrity. Looks like you've changed schema but forgot to update the version number

**Code:** `Room cannot verify the data integrity` · **Category:** Android · **Seen on:** Android

The Room entity definitions changed, but the database version wasn’t increased or no migration was provided.

## Meaning

Room stores a schema hash. Changing entities requires bumping @Database(version) and adding a Migration (or fallbackToDestructiveMigration for dev builds). During development, uninstalling the app also resets it.

## Common causes

- Entity fields/tables changed without version bump
- Migration missing for the new version
- Two builds with different schemas on the same device

## Quick fix

1. Increase version and add a Migration
2. Use fallbackToDestructiveMigration() only when data loss is OK
3. Export schemas (room.schemaLocation) to auto-generate migrations

## Detailed fix by platform

### Kotlin

1. 

```kotlin
@Database(entities = [User::class], version = 3, autoMigrations = [AutoMigration(from = 2, to = 3)])
abstract class AppDb : RoomDatabase()
```


## How to diagnose

1. **Version** — @Database version vs installed
2. **Migrations** — Path from old to new

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/android/room-schema-changed-version)
