feat: persist infrared key bindings

This commit is contained in:
2026-08-25 11:40:23 +08:00
committed by KremeCN
parent 616d97ca03
commit ff85b3eb45
12 changed files with 775 additions and 1 deletions
@@ -0,0 +1,136 @@
{
"formatVersion": 1,
"database": {
"version": 1,
"identityHash": "be673e12eb4c5275aaa6ef6fc189a861",
"entities": [
{
"tableName": "infrared_keys",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `profileId` TEXT NOT NULL, `deviceName` TEXT NOT NULL, `displayName` TEXT NOT NULL, `sdkKey` TEXT NOT NULL, `status` TEXT NOT NULL, `lastErrorCode` TEXT, `lastErrorDetail` TEXT, `createdAtEpochMillis` INTEGER NOT NULL, `updatedAtEpochMillis` INTEGER NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "profileId",
"columnName": "profileId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "deviceName",
"columnName": "deviceName",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "displayName",
"columnName": "displayName",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "sdkKey",
"columnName": "sdkKey",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "status",
"columnName": "status",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "lastErrorCode",
"columnName": "lastErrorCode",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "lastErrorDetail",
"columnName": "lastErrorDetail",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "createdAtEpochMillis",
"columnName": "createdAtEpochMillis",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "updatedAtEpochMillis",
"columnName": "updatedAtEpochMillis",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
},
"indices": [
{
"name": "index_infrared_keys_profileId_deviceName",
"unique": false,
"columnNames": [
"profileId",
"deviceName"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_infrared_keys_profileId_deviceName` ON `${TABLE_NAME}` (`profileId`, `deviceName`)"
},
{
"name": "index_infrared_keys_profileId_deviceName_sdkKey",
"unique": true,
"columnNames": [
"profileId",
"deviceName",
"sdkKey"
],
"orders": [],
"createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_infrared_keys_profileId_deviceName_sdkKey` ON `${TABLE_NAME}` (`profileId`, `deviceName`, `sdkKey`)"
}
],
"foreignKeys": []
},
{
"tableName": "infrared_device_configuration",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` TEXT NOT NULL, `deviceName` TEXT NOT NULL, PRIMARY KEY(`profileId`))",
"fields": [
{
"fieldPath": "profileId",
"columnName": "profileId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "deviceName",
"columnName": "deviceName",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"profileId"
]
},
"indices": [],
"foreignKeys": []
}
],
"views": [],
"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, 'be673e12eb4c5275aaa6ef6fc189a861')"
]
}
}