{
  "formatVersion": 1,
  "database": {
    "version": 18,
    "identityHash": "e2d0b7e9c851497d0f9443b8b83d06bf",
    "entities": [
      {
        "tableName": "LocalReminderData",
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `time` INTEGER NOT NULL, `message` TEXT NOT NULL)",
        "fields": [
          {
            "fieldPath": "id",
            "columnName": "id",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "time",
            "columnName": "time",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "message",
            "columnName": "message",
            "affinity": "TEXT",
            "notNull": true
          }
        ],
        "primaryKey": {
          "autoGenerate": true,
          "columnNames": [
            "id"
          ]
        }
      },
      {
        "tableName": "CachedRecordingMetadata",
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `sampleRate` INTEGER NOT NULL, `mimeType` TEXT NOT NULL, PRIMARY KEY(`id`))",
        "fields": [
          {
            "fieldPath": "id",
            "columnName": "id",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "sampleRate",
            "columnName": "sampleRate",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "mimeType",
            "columnName": "mimeType",
            "affinity": "TEXT",
            "notNull": true
          }
        ],
        "primaryKey": {
          "autoGenerate": false,
          "columnNames": [
            "id"
          ]
        }
      },
      {
        "tableName": "RingDebugTransfer",
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `satelliteName` TEXT, `satelliteId` TEXT NOT NULL, `satelliteFirmwareVersion` TEXT NOT NULL, `satelliteLastAdvertisementTimestamp` INTEGER NOT NULL, `collectionIndex` INTEGER NOT NULL, `collectionStartCount` INTEGER NOT NULL DEFAULT -1, `buttonSequence` TEXT, `sampleCount` INTEGER NOT NULL, `sampleRate` INTEGER NOT NULL, `buttonReleaseTimestamp` INTEGER, `transferCompleteTimestamp` INTEGER NOT NULL, `storedPath` TEXT NOT NULL)",
        "fields": [
          {
            "fieldPath": "id",
            "columnName": "id",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "satelliteName",
            "columnName": "satelliteName",
            "affinity": "TEXT"
          },
          {
            "fieldPath": "satelliteId",
            "columnName": "satelliteId",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "satelliteFirmwareVersion",
            "columnName": "satelliteFirmwareVersion",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "satelliteLastAdvertisementTimestamp",
            "columnName": "satelliteLastAdvertisementTimestamp",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "collectionIndex",
            "columnName": "collectionIndex",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "collectionStartCount",
            "columnName": "collectionStartCount",
            "affinity": "INTEGER",
            "notNull": true,
            "defaultValue": "-1"
          },
          {
            "fieldPath": "buttonSequence",
            "columnName": "buttonSequence",
            "affinity": "TEXT"
          },
          {
            "fieldPath": "sampleCount",
            "columnName": "sampleCount",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "sampleRate",
            "columnName": "sampleRate",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "buttonReleaseTimestamp",
            "columnName": "buttonReleaseTimestamp",
            "affinity": "INTEGER"
          },
          {
            "fieldPath": "transferCompleteTimestamp",
            "columnName": "transferCompleteTimestamp",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "storedPath",
            "columnName": "storedPath",
            "affinity": "TEXT",
            "notNull": true
          }
        ],
        "primaryKey": {
          "autoGenerate": true,
          "columnNames": [
            "id"
          ]
        }
      },
      {
        "tableName": "LocalRecording",
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `localTimestamp` INTEGER NOT NULL, `firestoreId` TEXT, `updated` INTEGER NOT NULL DEFAULT 0, `assistantTitle` TEXT)",
        "fields": [
          {
            "fieldPath": "id",
            "columnName": "id",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "localTimestamp",
            "columnName": "localTimestamp",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "firestoreId",
            "columnName": "firestoreId",
            "affinity": "TEXT"
          },
          {
            "fieldPath": "updated",
            "columnName": "updated",
            "affinity": "INTEGER",
            "notNull": true,
            "defaultValue": "0"
          },
          {
            "fieldPath": "assistantTitle",
            "columnName": "assistantTitle",
            "affinity": "TEXT"
          }
        ],
        "primaryKey": {
          "autoGenerate": true,
          "columnNames": [
            "id"
          ]
        },
        "indices": [
          {
            "name": "index_LocalRecording_firestoreId",
            "unique": true,
            "columnNames": [
              "firestoreId"
            ],
            "orders": [],
            "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_LocalRecording_firestoreId` ON `${TABLE_NAME}` (`firestoreId`)"
          },
          {
            "name": "index_LocalRecording_localTimestamp",
            "unique": false,
            "columnNames": [
              "localTimestamp"
            ],
            "orders": [],
            "createSql": "CREATE INDEX IF NOT EXISTS `index_LocalRecording_localTimestamp` ON `${TABLE_NAME}` (`localTimestamp`)"
          }
        ]
      },
      {
        "tableName": "ConversationMessageEntity",
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `recordingId` INTEGER NOT NULL, `timestamp` INTEGER NOT NULL, `role` TEXT NOT NULL, `content` TEXT, `tool_calls` TEXT, `tool_call_id` TEXT, `semantic_result` TEXT, FOREIGN KEY(`recordingId`) REFERENCES `LocalRecording`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
        "fields": [
          {
            "fieldPath": "id",
            "columnName": "id",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "recordingId",
            "columnName": "recordingId",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "timestamp",
            "columnName": "timestamp",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "document.role",
            "columnName": "role",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "document.content",
            "columnName": "content",
            "affinity": "TEXT"
          },
          {
            "fieldPath": "document.tool_calls",
            "columnName": "tool_calls",
            "affinity": "TEXT"
          },
          {
            "fieldPath": "document.tool_call_id",
            "columnName": "tool_call_id",
            "affinity": "TEXT"
          },
          {
            "fieldPath": "document.semantic_result",
            "columnName": "semantic_result",
            "affinity": "TEXT"
          }
        ],
        "primaryKey": {
          "autoGenerate": true,
          "columnNames": [
            "id"
          ]
        },
        "indices": [
          {
            "name": "index_ConversationMessageEntity_recordingId",
            "unique": false,
            "columnNames": [
              "recordingId"
            ],
            "orders": [],
            "createSql": "CREATE INDEX IF NOT EXISTS `index_ConversationMessageEntity_recordingId` ON `${TABLE_NAME}` (`recordingId`)"
          },
          {
            "name": "index_ConversationMessageEntity_recordingId_role_timestamp",
            "unique": false,
            "columnNames": [
              "recordingId",
              "role",
              "timestamp"
            ],
            "orders": [],
            "createSql": "CREATE INDEX IF NOT EXISTS `index_ConversationMessageEntity_recordingId_role_timestamp` ON `${TABLE_NAME}` (`recordingId`, `role`, `timestamp`)"
          }
        ],
        "foreignKeys": [
          {
            "table": "LocalRecording",
            "onDelete": "CASCADE",
            "onUpdate": "NO ACTION",
            "columns": [
              "recordingId"
            ],
            "referencedColumns": [
              "id"
            ]
          }
        ]
      },
      {
        "tableName": "RecordingEntryEntity",
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `recordingId` INTEGER NOT NULL, `timestamp` INTEGER NOT NULL, `fileName` TEXT, `status` TEXT NOT NULL, `transcription` TEXT, `error` TEXT, `ringTransferInfo` TEXT, `userMessageId` INTEGER, FOREIGN KEY(`recordingId`) REFERENCES `LocalRecording`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
        "fields": [
          {
            "fieldPath": "id",
            "columnName": "id",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "recordingId",
            "columnName": "recordingId",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "timestamp",
            "columnName": "timestamp",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "fileName",
            "columnName": "fileName",
            "affinity": "TEXT"
          },
          {
            "fieldPath": "status",
            "columnName": "status",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "transcription",
            "columnName": "transcription",
            "affinity": "TEXT"
          },
          {
            "fieldPath": "error",
            "columnName": "error",
            "affinity": "TEXT"
          },
          {
            "fieldPath": "ringTransferInfo",
            "columnName": "ringTransferInfo",
            "affinity": "TEXT"
          },
          {
            "fieldPath": "userMessageId",
            "columnName": "userMessageId",
            "affinity": "INTEGER"
          }
        ],
        "primaryKey": {
          "autoGenerate": true,
          "columnNames": [
            "id"
          ]
        },
        "indices": [
          {
            "name": "index_RecordingEntryEntity_userMessageId",
            "unique": false,
            "columnNames": [
              "userMessageId"
            ],
            "orders": [],
            "createSql": "CREATE INDEX IF NOT EXISTS `index_RecordingEntryEntity_userMessageId` ON `${TABLE_NAME}` (`userMessageId`)"
          },
          {
            "name": "index_RecordingEntryEntity_recordingId",
            "unique": false,
            "columnNames": [
              "recordingId"
            ],
            "orders": [],
            "createSql": "CREATE INDEX IF NOT EXISTS `index_RecordingEntryEntity_recordingId` ON `${TABLE_NAME}` (`recordingId`)"
          },
          {
            "name": "index_RecordingEntryEntity_recordingId_timestamp",
            "unique": false,
            "columnNames": [
              "recordingId",
              "timestamp"
            ],
            "orders": [],
            "createSql": "CREATE INDEX IF NOT EXISTS `index_RecordingEntryEntity_recordingId_timestamp` ON `${TABLE_NAME}` (`recordingId`, `timestamp`)"
          }
        ],
        "foreignKeys": [
          {
            "table": "LocalRecording",
            "onDelete": "CASCADE",
            "onUpdate": "NO ACTION",
            "columns": [
              "recordingId"
            ],
            "referencedColumns": [
              "id"
            ]
          }
        ]
      },
      {
        "tableName": "RingTransfer",
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `recordingId` INTEGER, `recordingEntryId` INTEGER, `isCurrentIndexIteration` INTEGER NOT NULL, `status` TEXT NOT NULL, `fileId` TEXT, `createdAt` INTEGER NOT NULL, `transferInfo_collectionStartIndex` INTEGER, `transferInfo_collectionEndIndex` INTEGER, `transferInfo_buttonPressed` INTEGER, `transferInfo_buttonReleased` INTEGER, `transferInfo_advertisementReceived` INTEGER, `transferInfo_transferCompleted` INTEGER, `transferInfo_buttonReleaseAdvertisementLatencyMs` INTEGER, FOREIGN KEY(`recordingId`) REFERENCES `LocalRecording`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`recordingEntryId`) REFERENCES `RecordingEntryEntity`(`id`) ON UPDATE NO ACTION ON DELETE SET NULL )",
        "fields": [
          {
            "fieldPath": "id",
            "columnName": "id",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "recordingId",
            "columnName": "recordingId",
            "affinity": "INTEGER"
          },
          {
            "fieldPath": "recordingEntryId",
            "columnName": "recordingEntryId",
            "affinity": "INTEGER"
          },
          {
            "fieldPath": "isCurrentIndexIteration",
            "columnName": "isCurrentIndexIteration",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "status",
            "columnName": "status",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "fileId",
            "columnName": "fileId",
            "affinity": "TEXT"
          },
          {
            "fieldPath": "createdAt",
            "columnName": "createdAt",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "transferInfo.collectionStartIndex",
            "columnName": "transferInfo_collectionStartIndex",
            "affinity": "INTEGER"
          },
          {
            "fieldPath": "transferInfo.collectionEndIndex",
            "columnName": "transferInfo_collectionEndIndex",
            "affinity": "INTEGER"
          },
          {
            "fieldPath": "transferInfo.buttonPressed",
            "columnName": "transferInfo_buttonPressed",
            "affinity": "INTEGER"
          },
          {
            "fieldPath": "transferInfo.buttonReleased",
            "columnName": "transferInfo_buttonReleased",
            "affinity": "INTEGER"
          },
          {
            "fieldPath": "transferInfo.advertisementReceived",
            "columnName": "transferInfo_advertisementReceived",
            "affinity": "INTEGER"
          },
          {
            "fieldPath": "transferInfo.transferCompleted",
            "columnName": "transferInfo_transferCompleted",
            "affinity": "INTEGER"
          },
          {
            "fieldPath": "transferInfo.buttonReleaseAdvertisementLatencyMs",
            "columnName": "transferInfo_buttonReleaseAdvertisementLatencyMs",
            "affinity": "INTEGER"
          }
        ],
        "primaryKey": {
          "autoGenerate": true,
          "columnNames": [
            "id"
          ]
        },
        "indices": [
          {
            "name": "index_RingTransfer_recordingId",
            "unique": false,
            "columnNames": [
              "recordingId"
            ],
            "orders": [],
            "createSql": "CREATE INDEX IF NOT EXISTS `index_RingTransfer_recordingId` ON `${TABLE_NAME}` (`recordingId`)"
          },
          {
            "name": "index_RingTransfer_recordingEntryId",
            "unique": false,
            "columnNames": [
              "recordingEntryId"
            ],
            "orders": [],
            "createSql": "CREATE INDEX IF NOT EXISTS `index_RingTransfer_recordingEntryId` ON `${TABLE_NAME}` (`recordingEntryId`)"
          },
          {
            "name": "index_RingTransfer_isCurrentIndexIteration_transferInfo_collectionStartIndex",
            "unique": false,
            "columnNames": [
              "isCurrentIndexIteration",
              "transferInfo_collectionStartIndex"
            ],
            "orders": [],
            "createSql": "CREATE INDEX IF NOT EXISTS `index_RingTransfer_isCurrentIndexIteration_transferInfo_collectionStartIndex` ON `${TABLE_NAME}` (`isCurrentIndexIteration`, `transferInfo_collectionStartIndex`)"
          },
          {
            "name": "index_RingTransfer_createdAt",
            "unique": false,
            "columnNames": [
              "createdAt"
            ],
            "orders": [],
            "createSql": "CREATE INDEX IF NOT EXISTS `index_RingTransfer_createdAt` ON `${TABLE_NAME}` (`createdAt`)"
          }
        ],
        "foreignKeys": [
          {
            "table": "LocalRecording",
            "onDelete": "CASCADE",
            "onUpdate": "NO ACTION",
            "columns": [
              "recordingId"
            ],
            "referencedColumns": [
              "id"
            ]
          },
          {
            "table": "RecordingEntryEntity",
            "onDelete": "SET NULL",
            "onUpdate": "NO ACTION",
            "columns": [
              "recordingEntryId"
            ],
            "referencedColumns": [
              "id"
            ]
          }
        ]
      }
    ],
    "views": [
      {
        "viewName": "RecordingFeedItem",
        "createSql": "CREATE VIEW `${VIEW_NAME}` AS SELECT \n        lr.id AS rootRecordingId, \n        lr.localTimestamp,\n        re.*, \n        cm.semantic_result\n    FROM LocalRecording AS lr\n    LEFT JOIN RecordingEntryEntity AS re ON re.id = (\n        SELECT id \n        FROM RecordingEntryEntity \n        WHERE recordingId = lr.id \n        ORDER BY timestamp ASC \n        LIMIT 1\n    )\n    LEFT JOIN ConversationMessageEntity AS cm ON cm.id = (\n        SELECT id \n        FROM ConversationMessageEntity \n        WHERE recordingId = lr.id \n        AND role = 'tool' \n        ORDER BY timestamp DESC \n        LIMIT 1\n    )"
      }
    ],
    "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, 'e2d0b7e9c851497d0f9443b8b83d06bf')"
    ]
  }
}