# 07. Implement Android database layer (Room)

meta:
  id: native-business-logic-migration-07
  feature: native-business-logic-migration
  priority: P0
  depends_on: [native-business-logic-migration-04]
  tags: [implementation, android, database]

objective:
- Implement database layer using Room for Android

deliverables:
- RssDatabase.kt
- SubscriptionEntity.kt
- FeedItemEntity.kt
- SearchHistoryEntity.kt
- SubscriptionDao.kt
- FeedItemDao.kt
- SearchHistoryDao.kt
- Database migrations
- FTS virtual table implementation

tests:
- Unit: Test CRUD operations with Room Testing
- Unit: Test relationships
- Unit: Test FTS queries
- Integration: Test database migrations

acceptance_criteria:
- Room database configured
- All entities annotated
- DAOs with proper queries
- FTS search working
- Migrations implemented
- TypeConverters for custom types

validation:
- Run `./gradlew test`
- Verify with Room Inspection

notes:
- Use Room 2.6+
- Implement FTS using SQLite FTS5
- Use @Transaction for multi-entity operations
