Skip to content

Data Model

Wardove uses a Room (SQLite) database (schema version 3). All data is local to the app sandbox.

Entities

ClothingItem

Table: clothing_items

ColumnTypeNotes
idLong (PK, auto)
nameStringDisplay name
categoryStringTop / Bottom / Shoes / Outerwear / Accessory
colorStringOne of 12 preset color names
imagePathStringAbsolute path to photo in filesDir/images/
statusStringCLEAN / WORN / IN_LAUNDRY (default CLEAN)
lastWornDateLong?Epoch millis of most recent wear; null if never worn
totalWearCountIntRunning total of all wear logs (default 0)
createdAtLongEpoch millis; defaults to now at insert time
notesString?Free-text notes
priceDouble?Purchase price; used for cost-per-wear stat
tagsStringComma-separated free-text labels (default ""); use tagList()/toTagsString() in ClothingItem.kt to convert to/from List<String>

Status constants (ClothingStatus object): CLEAN, WORN, IN_LAUNDRY.

WearLog

Table: wear_logs

One row per "worn today" event. Powers calendar, stats, and item history.

ColumnTypeNotes
idLong (PK, auto)
clothingItemIdLongFK → ClothingItem.id (onDelete = CASCADE, indexed)
wornDateLongEpoch millis of the wear date

LaundryCycle

Table: laundry_cycles

One row per wash batch.

ColumnTypeNotes
idLong (PK, auto)
startedAtLongEpoch millis when cycle started
completedAtLong?Null while active; set when cycle is completed
itemCountIntNumber of items in the cycle

An active cycle has completedAt = null.

LaundryCycleItem

Table: laundry_cycle_items

Join table linking a cycle to its items. Composite PK (cycleId, clothingItemId).

ColumnTypeNotes
cycleIdLongFK → LaundryCycle.id (CASCADE, indexed)
clothingItemIdLongFK → ClothingItem.id (CASCADE, indexed)

Lifecycle of a laundry cycle

Worn item(s) in pile

   startCycle()          → LaundryCycle inserted, LaundryCycleItems inserted,
                            items → IN_LAUNDRY

  completeCycle()        → items → CLEAN (wearCount reset),
                            LaundryCycle.completedAt stamped

  Appears in History

Photos

Item photos are stored by ImageStorage at:

context.filesDir/images/<filename>

Served externally via FileProvider ({packageName}.fileprovider). Photos are deleted when the associated item is deleted. Never write to external storage directly — use ImageStorage only.

Migrations

Database version: 3. Migrations live in WardoveDatabase.MIGRATION_X_Y companion objects. Always add a migration — do not rely on fallback-to-destructive.

  • MIGRATION_1_2 — adds price to clothing_items.
  • MIGRATION_2_3 — adds tags to clothing_items.