- Android CLI Setup: initialized empty-activity app (AGP 9.0, Kotlin 2.3.20)
- Version catalog: Compose BOM 2026.03.01, Material 3, Hilt 2.60.1, Room 2.7.2,
Retrofit 2.11.0, OkHttp 4.12.0, WorkManager 2.10.2, Kotlinx Serialization
- Room Database (v1): ListEntity, ItemEntity, OpLogEntity
- Room DAOs: ListDao, ItemDao, OpLogDao with LWW upsert queries
- Network layer: MitbringslApi Retrofit interface + DTOs + AuthInterceptor
- Dependency Injection: DatabaseModule, NetworkModule, RepositoryModule, HiltAndroidApp
- Build verification: assembleDebug & test green ✅
305 lines
No EOL
9 KiB
JSON
305 lines
No EOL
9 KiB
JSON
{
|
|
"formatVersion": 1,
|
|
"database": {
|
|
"version": 1,
|
|
"identityHash": "c5e70cf816f82a65da0a30d8315b70e8",
|
|
"entities": [
|
|
{
|
|
"tableName": "lists",
|
|
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `ownerId` TEXT NOT NULL, `createdAt` INTEGER NOT NULL, `updatedAt` INTEGER NOT NULL, `deletedAt` INTEGER, `hlcTs` INTEGER NOT NULL, PRIMARY KEY(`id`))",
|
|
"fields": [
|
|
{
|
|
"fieldPath": "id",
|
|
"columnName": "id",
|
|
"affinity": "TEXT",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "name",
|
|
"columnName": "name",
|
|
"affinity": "TEXT",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "ownerId",
|
|
"columnName": "ownerId",
|
|
"affinity": "TEXT",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "createdAt",
|
|
"columnName": "createdAt",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "updatedAt",
|
|
"columnName": "updatedAt",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "deletedAt",
|
|
"columnName": "deletedAt",
|
|
"affinity": "INTEGER"
|
|
},
|
|
{
|
|
"fieldPath": "hlcTs",
|
|
"columnName": "hlcTs",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
}
|
|
],
|
|
"primaryKey": {
|
|
"autoGenerate": false,
|
|
"columnNames": [
|
|
"id"
|
|
]
|
|
},
|
|
"indices": [
|
|
{
|
|
"name": "index_lists_ownerId",
|
|
"unique": false,
|
|
"columnNames": [
|
|
"ownerId"
|
|
],
|
|
"orders": [],
|
|
"createSql": "CREATE INDEX IF NOT EXISTS `index_lists_ownerId` ON `${TABLE_NAME}` (`ownerId`)"
|
|
},
|
|
{
|
|
"name": "index_lists_deletedAt",
|
|
"unique": false,
|
|
"columnNames": [
|
|
"deletedAt"
|
|
],
|
|
"orders": [],
|
|
"createSql": "CREATE INDEX IF NOT EXISTS `index_lists_deletedAt` ON `${TABLE_NAME}` (`deletedAt`)"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"tableName": "items",
|
|
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `listId` TEXT NOT NULL, `name` TEXT NOT NULL, `quantity` TEXT, `checked` INTEGER NOT NULL, `sortOrder` INTEGER, `createdAt` INTEGER NOT NULL, `updatedAt` INTEGER NOT NULL, `deletedAt` INTEGER, `hlcTs` INTEGER NOT NULL, `clientId` TEXT, `checkedAt` INTEGER, PRIMARY KEY(`id`), FOREIGN KEY(`listId`) REFERENCES `lists`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
|
|
"fields": [
|
|
{
|
|
"fieldPath": "id",
|
|
"columnName": "id",
|
|
"affinity": "TEXT",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "listId",
|
|
"columnName": "listId",
|
|
"affinity": "TEXT",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "name",
|
|
"columnName": "name",
|
|
"affinity": "TEXT",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "quantity",
|
|
"columnName": "quantity",
|
|
"affinity": "TEXT"
|
|
},
|
|
{
|
|
"fieldPath": "checked",
|
|
"columnName": "checked",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "sortOrder",
|
|
"columnName": "sortOrder",
|
|
"affinity": "INTEGER"
|
|
},
|
|
{
|
|
"fieldPath": "createdAt",
|
|
"columnName": "createdAt",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "updatedAt",
|
|
"columnName": "updatedAt",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "deletedAt",
|
|
"columnName": "deletedAt",
|
|
"affinity": "INTEGER"
|
|
},
|
|
{
|
|
"fieldPath": "hlcTs",
|
|
"columnName": "hlcTs",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "clientId",
|
|
"columnName": "clientId",
|
|
"affinity": "TEXT"
|
|
},
|
|
{
|
|
"fieldPath": "checkedAt",
|
|
"columnName": "checkedAt",
|
|
"affinity": "INTEGER"
|
|
}
|
|
],
|
|
"primaryKey": {
|
|
"autoGenerate": false,
|
|
"columnNames": [
|
|
"id"
|
|
]
|
|
},
|
|
"indices": [
|
|
{
|
|
"name": "index_items_listId",
|
|
"unique": false,
|
|
"columnNames": [
|
|
"listId"
|
|
],
|
|
"orders": [],
|
|
"createSql": "CREATE INDEX IF NOT EXISTS `index_items_listId` ON `${TABLE_NAME}` (`listId`)"
|
|
},
|
|
{
|
|
"name": "index_items_deletedAt",
|
|
"unique": false,
|
|
"columnNames": [
|
|
"deletedAt"
|
|
],
|
|
"orders": [],
|
|
"createSql": "CREATE INDEX IF NOT EXISTS `index_items_deletedAt` ON `${TABLE_NAME}` (`deletedAt`)"
|
|
}
|
|
],
|
|
"foreignKeys": [
|
|
{
|
|
"table": "lists",
|
|
"onDelete": "CASCADE",
|
|
"onUpdate": "NO ACTION",
|
|
"columns": [
|
|
"listId"
|
|
],
|
|
"referencedColumns": [
|
|
"id"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"tableName": "op_log",
|
|
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`localId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `listId` TEXT NOT NULL, `clientId` TEXT NOT NULL, `clientSeq` INTEGER NOT NULL, `opType` TEXT NOT NULL, `targetId` TEXT NOT NULL, `payload` TEXT NOT NULL, `hlcTs` INTEGER NOT NULL, `createdAt` INTEGER NOT NULL, `serverSeq` INTEGER, `synced` INTEGER NOT NULL)",
|
|
"fields": [
|
|
{
|
|
"fieldPath": "localId",
|
|
"columnName": "localId",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "listId",
|
|
"columnName": "listId",
|
|
"affinity": "TEXT",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "clientId",
|
|
"columnName": "clientId",
|
|
"affinity": "TEXT",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "clientSeq",
|
|
"columnName": "clientSeq",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "opType",
|
|
"columnName": "opType",
|
|
"affinity": "TEXT",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "targetId",
|
|
"columnName": "targetId",
|
|
"affinity": "TEXT",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "payload",
|
|
"columnName": "payload",
|
|
"affinity": "TEXT",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "hlcTs",
|
|
"columnName": "hlcTs",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "createdAt",
|
|
"columnName": "createdAt",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "serverSeq",
|
|
"columnName": "serverSeq",
|
|
"affinity": "INTEGER"
|
|
},
|
|
{
|
|
"fieldPath": "synced",
|
|
"columnName": "synced",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
}
|
|
],
|
|
"primaryKey": {
|
|
"autoGenerate": true,
|
|
"columnNames": [
|
|
"localId"
|
|
]
|
|
},
|
|
"indices": [
|
|
{
|
|
"name": "index_op_log_listId",
|
|
"unique": false,
|
|
"columnNames": [
|
|
"listId"
|
|
],
|
|
"orders": [],
|
|
"createSql": "CREATE INDEX IF NOT EXISTS `index_op_log_listId` ON `${TABLE_NAME}` (`listId`)"
|
|
},
|
|
{
|
|
"name": "index_op_log_clientId_clientSeq",
|
|
"unique": true,
|
|
"columnNames": [
|
|
"clientId",
|
|
"clientSeq"
|
|
],
|
|
"orders": [],
|
|
"createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_op_log_clientId_clientSeq` ON `${TABLE_NAME}` (`clientId`, `clientSeq`)"
|
|
},
|
|
{
|
|
"name": "index_op_log_synced",
|
|
"unique": false,
|
|
"columnNames": [
|
|
"synced"
|
|
],
|
|
"orders": [],
|
|
"createSql": "CREATE INDEX IF NOT EXISTS `index_op_log_synced` ON `${TABLE_NAME}` (`synced`)"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"setupQueries": [
|
|
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
|
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'c5e70cf816f82a65da0a30d8315b70e8')"
|
|
]
|
|
}
|
|
} |