mirror of
https://github.com/greenart7c3/Amber.git
synced 2026-10-05 19:08:23 +00:00
- Integrate Jetpack Paging 3 and Room Paging dependencies. - Update `LogDao` and `HistoryDao` to return `PagingSource` instead of `Flow<List>`. - Refactor `ActivitiesScreen`, `ActivityScreen`, `LogsScreen`, and `RelayLogScreen` to use `Pager` and `collectAsLazyPagingItems`. - Update `LogDatabase` to version 2, adding an index on the `time` column for query performance. - Extract `ActivityRow` composable for reuse. - Remove explicit `VACUUM` commands from database setup.
68 lines
1.9 KiB
JSON
68 lines
1.9 KiB
JSON
{
|
|
"formatVersion": 1,
|
|
"database": {
|
|
"version": 2,
|
|
"identityHash": "22c4d1bdcd7396ef577313c1cf4627d7",
|
|
"entities": [
|
|
{
|
|
"tableName": "amber_log",
|
|
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `url` TEXT NOT NULL, `type` TEXT NOT NULL, `message` TEXT NOT NULL, `time` INTEGER NOT NULL)",
|
|
"fields": [
|
|
{
|
|
"fieldPath": "id",
|
|
"columnName": "id",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "url",
|
|
"columnName": "url",
|
|
"affinity": "TEXT",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "type",
|
|
"columnName": "type",
|
|
"affinity": "TEXT",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "message",
|
|
"columnName": "message",
|
|
"affinity": "TEXT",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "time",
|
|
"columnName": "time",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
}
|
|
],
|
|
"primaryKey": {
|
|
"autoGenerate": true,
|
|
"columnNames": [
|
|
"id"
|
|
]
|
|
},
|
|
"indices": [
|
|
{
|
|
"name": "log_by_time_key",
|
|
"unique": false,
|
|
"columnNames": [
|
|
"time"
|
|
],
|
|
"orders": [
|
|
"DESC"
|
|
],
|
|
"createSql": "CREATE INDEX IF NOT EXISTS `log_by_time_key` ON `${TABLE_NAME}` (`time` DESC)"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"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, '22c4d1bdcd7396ef577313c1cf4627d7')"
|
|
]
|
|
}
|
|
} |