room-schema-fix

Diagnose and fix Android Room schema validation crashes from entity and migration mismatches.

2|Updated May 12, 2026
One-click install
npx skills add https://github.com/youfengknight/Android-Code-Skills --skill room-schema-fix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: room-schema-fix
Source: https://github.com/youfengknight/Android-Code-Skills/tree/main/other/room-schema-fix
Command: npx skills add https://github.com/youfengknight/Android-Code-Skills --skill room-schema-fix

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves Android Room database crashes caused by schema validation mismatches after you change entities, database definitions, views, or DAO queries.

Core Features & Use Cases

  • Schema mismatch diagnosis: Compares exported schema JSON with the current Room model to pinpoint renamed, missing, or structurally changed tables/columns (including views).
  • Migration plan & execution: Produces the correct approach for rename/add/delete/type changes by updating the database version and adding the required Migration/AutoMigration steps.
  • Migration verification: Validates that generated Room implementation code matches expected SQL/column mappings for the targeted flavors.

Quick Start

Run this skill when your app crashes at startup with a Room schema validation error after modifying @Entity/@Database/@DatabaseView or DAO queries.

Frequently Asked Questions about room-schema-fix

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my Android app crash at startup with a Room schema validation error after changing an entity?

Room schema validation crashes happen when your modified @Entity or @DatabaseView no longer matches the exported schema JSON, requiring a database version bump and proper migration to reconcile structural changes.

How do I fix Room identity hash mismatches when adding or renaming columns?

Fix Room identity hash mismatches by updating the database version and implementing the correct Migration or AutoMigration steps to handle column additions, renames, or type changes against the exported schema JSON.

What is the best way to handle Room AutoMigration for renamed or dropped columns?

Handling Room AutoMigration for renamed or dropped columns requires version bumping and specifying the correct Migration or AutoMigration configuration to ensure generated Room *_Impl code matches expected SQL mappings.

Can I use Room AutoMigration to fix missing required migration paths across app upgrades?

Yes, Room AutoMigration can fix missing required migration paths across app upgrades by automatically generating the necessary migration logic when entity changes are properly versioned and mapped to the exported schema JSON.

How to verify generated Room implementation code matches expected column mappings after a migration?

Verify generated Room implementation code by checking that the *_Impl code accurately reflects the expected SQL and column mappings for your targeted flavors after applying the required Migration or AutoMigration steps.

When do I need to export Room schema JSON for database versioning?

You need to export Room schema JSON for database versioning whenever you modify entities, views, or DAO queries, as it provides the baseline required to diagnose validation mismatches and generate correct migration paths.