# java.lang.IllegalStateException: A migration from 1 to 2 was required but not found. Please provide the necessary Migration path

**Code:** `IllegalStateException: A migration from 1 to 2 was required but not found` · **Category:** Android · **Seen on:** Android, Kotlin

The Room schema version increased but no migration describes how to upgrade existing data.

## Meaning

Provide a `Migration(1, 2)` (or use auto-migrations) or use `fallbackToDestructiveMigration()` during development. Always bump the version and export schemas.

## Common causes

- Version bumped without a Migration
- Migration list not added to builder
- Wrong version pair

## Quick fix

1. Add Migration(1,2) with ALTER TABLE
2. Use @AutoMigration
3. Dev only: fallbackToDestructiveMigration

## Detailed fix by platform

### Kotlin

1. `val M12 = object : Migration(1, 2) { override fun migrate(db: SupportSQLiteDatabase) { db.execSQL("ALTER TABLE user ADD COLUMN age INTEGER NOT NULL DEFAULT 0") } }`

## How to diagnose

1. **Versions** — from/to?
2. **Builder** — addMigrations?
3. **Schema** — exported?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/android/room-migration-not-found-illegalstate)
