Greenstand / Greenstand/treetracker-android
Clean up legacy database tables (tree_capture, planter_info, planter_check_in)
- Dominant language
- Kotlin
- Stars
- 101
- Forks
- 116
- PR merge metrics
- No merged PRs in 30d
Description
## Problem
The codebase still references legacy database tables (`tree_capture`, `planter_info`, `planter_check_in`) alongside the newer schema (`tree`, `user`). This suggests an incomplete migration. Both old and new entity classes exist, and uploaders handle both legacy and new formats, adding code complexity.
## Locations
- `app/src/main/java/org/greenstand/android/TreeTracker/database/legacy/` — legacy entity classes
- `TreeUploader.kt` — has both `uploadLegacyTrees` and `uploadTrees` methods
- `PlanterUploader.kt` — handles both legacy planter and new user uploads
- `SyncDataUseCase.kt` — orchestrates both legacy and new upload paths
## Suggested Fix
1. Determine if any users still have un-synced legacy data
2. If legacy data has been fully migrated, remove legacy entities, DAOs, and upload paths
3. If not, create a one-time migration to convert legacy records to the new schema, then remove legacy code
## Effort
Medium
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the legacy entity classes under app/src/main/java/org/greenstand/android/TreeTracker/database/legacy/ and tracing TreeUploader.kt, PlanterUploader.kt, and SyncDataUseCase.kt. Determine whether unsynced legacy records remain before choosing the migration or removal path. Done means legacy data is safely handled and the obsolete entities, DAOs, and upload paths are removed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- database, mobile
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100