From 896b20b0cfb409b68d640566bfc82062e8614edb Mon Sep 17 00:00:00 2001 From: SeniorZhai Date: Thu, 18 Jun 2026 17:37:13 +0800 Subject: [PATCH 1/3] refactor(db): migrate local queries to codegen Generate fetcher/provider/filter queries at compile time, keep chat pagination on fallback queries after the real-device window benchmark, and include the benchmark report for reference. --- .gitignore | 2 + app/build.gradle.kts | 2 + .../android/db/fetcher/MessageFetcher.kt | 356 ++++++----- .../db/fetcher/MessageFetcherQuerySpec.kt | 201 ++++++ .../android/db/provider/DataConverter.kt | 218 +++---- .../mixin/android/db/provider/DataProvider.kt | 441 +------------ .../db/provider/DataProviderQuerySpec.kt | 333 ++++++++++ .../db/provider/LimitOrderDataProvider.kt | 296 ++------- .../LimitOrderDataProviderQuerySpec.kt | 75 +++ .../one/mixin/android/fts/FtsDataSource.kt | 5 +- .../mixin/android/fts/FtsDatabaseExtension.kt | 10 +- .../one/mixin/android/fts/FtsQuerySpec.kt | 34 + .../ui/conversation/ConversationViewModel.kt | 37 +- .../mixin/android/ui/wallet/FilterParams.kt | 3 +- .../android/ui/wallet/OrderFilterParams.kt | 32 +- .../ui/wallet/WalletFilterQuerySpec.kt | 52 ++ .../android/ui/wallet/Web3FilterParams.kt | 17 +- .../db/fetcher/MessageFetcherAnchorTest.kt | 163 +++++ build.gradle.kts | 1 + query-codegen/build.gradle.kts | 15 + .../GeneratedLimitOffsetDataSourceQuery.kt | 12 + .../GeneratedNoCountDataSourceQuery.kt | 12 + .../annotation/GeneratedPagingSourceQuery.kt | 12 + .../codegen/annotation/GeneratedQuery.kt | 11 + .../annotation/GeneratedQueryProvider.kt | 7 + .../annotation/GeneratedRawCursorQuery.kt | 10 + .../annotation/GeneratedSimpleSQLiteQuery.kt | 7 + .../codegen/processor/QueryFileRenderer.kt | 581 ++++++++++++++++++ .../codegen/processor/QueryProcessor.kt | 288 +++++++++ .../processor/QueryProcessorProvider.kt | 10 + ...ols.ksp.processing.SymbolProcessorProvider | 1 + .../processor/QueryFileRendererTest.kt | 571 +++++++++++++++++ settings.gradle.kts | 1 + 33 files changed, 2841 insertions(+), 975 deletions(-) create mode 100644 app/src/main/java/one/mixin/android/db/fetcher/MessageFetcherQuerySpec.kt create mode 100644 app/src/main/java/one/mixin/android/db/provider/DataProviderQuerySpec.kt create mode 100644 app/src/main/java/one/mixin/android/db/provider/LimitOrderDataProviderQuerySpec.kt create mode 100644 app/src/main/java/one/mixin/android/fts/FtsQuerySpec.kt create mode 100644 app/src/main/java/one/mixin/android/ui/wallet/WalletFilterQuerySpec.kt create mode 100644 app/src/test/java/one/mixin/android/db/fetcher/MessageFetcherAnchorTest.kt create mode 100644 query-codegen/build.gradle.kts create mode 100644 query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedLimitOffsetDataSourceQuery.kt create mode 100644 query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedNoCountDataSourceQuery.kt create mode 100644 query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedPagingSourceQuery.kt create mode 100644 query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedQuery.kt create mode 100644 query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedQueryProvider.kt create mode 100644 query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedRawCursorQuery.kt create mode 100644 query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedSimpleSQLiteQuery.kt create mode 100644 query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryFileRenderer.kt create mode 100644 query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryProcessor.kt create mode 100644 query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryProcessorProvider.kt create mode 100644 query-codegen/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider create mode 100644 query-codegen/src/test/kotlin/one/mixin/android/codegen/processor/QueryFileRendererTest.kt diff --git a/.gitignore b/.gitignore index 6491007978..287cdc5f06 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ /local.properties /.idea /build +build/ /captures google-services.json .DS_Store @@ -17,5 +18,6 @@ CLAUDE.md agent.md .claude/ .codex/ +.codegraph/ .github/copilot-instructions.md .vscode/ diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f12e5c5052..4d0968c017 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -382,6 +382,8 @@ dependencies { implementation("androidx.lifecycle:lifecycle-process:$lifecycleVersion") implementation("androidx.room:room-runtime:$roomVersion") implementation("androidx.room:room-paging:$roomVersion") + compileOnly(project(":query-codegen")) + ksp(project(":query-codegen")) ksp("androidx.room:room-compiler:$roomVersion") implementation("androidx.room:room-rxjava2:$roomVersion") implementation("androidx.room:room-ktx:$roomVersion") diff --git a/app/src/main/java/one/mixin/android/db/fetcher/MessageFetcher.kt b/app/src/main/java/one/mixin/android/db/fetcher/MessageFetcher.kt index d6a6415fae..d78e3781f8 100644 --- a/app/src/main/java/one/mixin/android/db/fetcher/MessageFetcher.kt +++ b/app/src/main/java/one/mixin/android/db/fetcher/MessageFetcher.kt @@ -1,196 +1,226 @@ package one.mixin.android.db.fetcher +import android.database.Cursor import kotlinx.coroutines.withContext import one.mixin.android.db.MixinDatabase -import one.mixin.android.db.provider.convertToMessageItems import one.mixin.android.util.SINGLE_FETCHER_THREAD import one.mixin.android.vo.MessageItem +import kotlin.math.roundToInt import javax.inject.Inject +data class ChatMessageAnchor( + val rowId: Long, + val createdAt: String, + val messageId: String, +) + +internal fun convertToChatMessageAnchor(cursor: Cursor?): ChatMessageAnchor? = + if (cursor != null && cursor.moveToFirst()) { + ChatMessageAnchor( + rowId = cursor.getLong(0), + createdAt = cursor.getString(1), + messageId = cursor.getString(2), + ) + } else { + null + } + +internal fun convertToMessageCount(cursor: Cursor?): Int = + if (cursor != null && cursor.moveToFirst()) cursor.getInt(0) else 0 + class MessageFetcher @Inject constructor( val db: MixinDatabase, ) { companion object { - private const val SQL = """ - SELECT m.id AS messageId, m.conversation_id AS conversationId, u.user_id AS userId, - u.full_name AS userFullName, u.identity_number AS userIdentityNumber, u.app_id AS appId, m.category AS type, - m.content AS content, m.created_at AS createdAt, m.status AS status, m.media_status AS mediaStatus, m.media_waveform AS mediaWaveform, - m.name AS mediaName, m.media_mime_type AS mediaMimeType, m.media_size AS mediaSize, m.media_width AS mediaWidth, m.media_height AS mediaHeight, - m.thumb_image AS thumbImage, m.thumb_url AS thumbUrl, m.media_url AS mediaUrl, m.media_duration AS mediaDuration, m.quote_message_id as quoteId, - m.quote_content as quoteContent, m.caption as caption, u.membership AS membership, u1.full_name AS participantFullName, m.action AS actionName, u1.user_id AS participantUserId, - COALESCE(s.snapshot_id, ss.snapshot_id) AS snapshotId, COALESCE(s.memo, ss.memo) AS snapshotMemo, COALESCE(s.type, ss.type) AS snapshotType, COALESCE(s.amount, ss.amount) AS snapshotAmount, - COALESCE(a.symbol, t.symbol) AS assetSymbol, COALESCE(s.asset_id, ss.asset_id) AS assetId, COALESCE(a.icon_url, t.icon_url) AS assetIcon, t.collection_hash AS assetCollectionHash, - st.asset_url AS assetUrl, st.asset_width AS assetWidth, st.asset_height AS assetHeight, st.sticker_id AS stickerId, - st.name AS assetName, st.asset_type AS assetType, h.site_name AS siteName, h.site_title AS siteTitle, h.site_description AS siteDescription, - h.site_image AS siteImage, m.shared_user_id AS sharedUserId, su.full_name AS sharedUserFullName, su.identity_number AS sharedUserIdentityNumber, - su.avatar_url AS sharedUserAvatarUrl, su.is_verified AS sharedUserIsVerified, su.app_id AS sharedUserAppId, su.membership AS sharedMembership, mm.mentions AS mentions, mm.has_read as mentionRead, - pm.message_id IS NOT NULL as isPin, c.name AS groupName, em.expire_in AS expireIn, em.expire_at AS expireAt - FROM messages m - LEFT JOIN users u ON m.user_id = u.user_id - LEFT JOIN users u1 ON m.participant_id = u1.user_id - LEFT JOIN snapshots s ON m.snapshot_id = s.snapshot_id - LEFT JOIN safe_snapshots ss ON m.snapshot_id = ss.snapshot_id - LEFT JOIN assets a ON s.asset_id = a.asset_id - LEFT JOIN tokens t ON ss.asset_id = t.asset_id - LEFT JOIN stickers st ON st.sticker_id = m.sticker_id - LEFT JOIN hyperlinks h ON m.hyperlink = h.hyperlink - LEFT JOIN users su ON m.shared_user_id = su.user_id - LEFT JOIN conversations c ON m.conversation_id = c.conversation_id - LEFT JOIN message_mentions mm ON m.id = mm.message_id - LEFT JOIN pin_messages pm ON m.id = pm.message_id - LEFT JOIN expired_messages em ON m.id = em.message_id - """ const val SCROLL_THRESHOLD = 15 const val PAGE_SIZE = 30 private const val INIT_SIZE = 90 // PAGE_SIZE * 3 } - private val currentlyLoadingIds = mutableSetOf() - private val loadedIds = mutableSetOf() - private var canLoadAbove = true - private var canLoadBelow = true - - suspend fun initMessages( - conversationId: String, - messageId: String? = null, - forceBottom: Boolean = false, - ): Triple, String?> = - withContext(SINGLE_FETCHER_THREAD) { - currentlyLoadingIds.clear() - loadedIds.clear() - var aroundId = messageId - if (aroundId == null && !forceBottom) { - val idCursor = db.query("SELECT rm.message_id FROM remote_messages_status rm LEFT JOIN messages m ON m.id = rm.message_id WHERE rm.conversation_id = ? AND rm.status = 'DELIVERED' ORDER BY m.created_at ASC, m.rowid ASC LIMIT 1", arrayOf(conversationId)) - if (idCursor.moveToNext()) { - aroundId = idCursor.getString(0) - } - idCursor.close() - } - if (aroundId == null) { - // load the last 60 messages - val cursor = - db.query( - "$SQL WHERE m.conversation_id = ? ORDER BY m.created_at DESC, m.rowid DESC LIMIT ?", - arrayOf(conversationId, INIT_SIZE.toString()), - ) - val result = convertToMessageItems(cursor).reversed() - canLoadBelow = false - canLoadAbove = result.size >= INIT_SIZE - return@withContext Triple(result.size - 1, result, null) - } else { - // Load data containing aroundId - val preCursor = - db.query("SELECT rowid, created_at FROM messages WHERE id = ?", arrayOf(aroundId)) - val (rowId, createdAt) = - preCursor.use { - if (it.moveToNext()) { - Pair(it.getInt(0), it.getString(1)) - } else { - return@withContext Triple(-1, emptyList(), null) - } - } - // load next page by aroundId - val nextCursor = - db.query( - "$SQL WHERE m.conversation_id = ? AND m.rowid >= ? AND m.created_at >= ? ORDER BY m.created_at ASC, m.rowid ASC LIMIT ?", - arrayOf(conversationId, rowId.toString(), createdAt, (INIT_SIZE / 2).toString()), - ) - val result = convertToMessageItems(nextCursor) - canLoadBelow = result.size >= INIT_SIZE / 2 - val thresholdSize = INIT_SIZE - result.size - val previousCursor = - db.query( - "$SQL WHERE m.conversation_id = ? AND m.rowid < ? AND m.created_at < ? ORDER BY m.created_at DESC, m.rowid DESC LIMIT ?", - arrayOf(conversationId, rowId.toString(), createdAt, thresholdSize.toString()), - ) - val previous = convertToMessageItems(previousCursor).reversed() - canLoadAbove = previous.size >= thresholdSize - val position = - if (previous.isNotEmpty()) { - previous.size - } else if (result.isNotEmpty()) { - 0 - } else { - -1 - } - return@withContext Triple(position, previous + result, aroundId) + private val currentlyLoadingIds = mutableSetOf() + private val loadedIds = mutableSetOf() + private var canLoadAbove = true + private var canLoadBelow = true + + suspend fun initMessages( + conversationId: String, + messageId: String? = null, + forceBottom: Boolean = false, + ): Triple, String?> = + withContext(SINGLE_FETCHER_THREAD) { + resetLoadState() + val anchor = + when { + messageId != null -> findAnchorByMessageId(messageId) + forceBottom -> null + else -> findFirstUnreadAnchor(conversationId) } + if (anchor == null) { + loadBottomMessages(conversationId) + } else { + loadAroundAnchor(conversationId, anchor) } + } - suspend fun findMessageById(messageIds: List) = - withContext(SINGLE_FETCHER_THREAD) { - val cursor = db.query("$SQL WHERE m.id IN ${messageIds.joinToString(", ", "(", ")", transform = { "'$it'" })}", arrayOf()) - return@withContext convertToMessageItems(cursor) - } + suspend fun initMessagesAtDate( + conversationId: String, + createdAt: String, + ): Triple, String?> = + withContext(SINGLE_FETCHER_THREAD) { + resetLoadState() + val anchor = findAnchorByDate(conversationId, createdAt) + ?: return@withContext Triple(-1, emptyList(), null) + loadAroundAnchor(conversationId, anchor) + } - fun isBottom() = !canLoadBelow + suspend fun initMessagesAtPosition( + conversationId: String, + index: Int, + ): Triple, String?> = + withContext(SINGLE_FETCHER_THREAD) { + resetLoadState() + val anchor = findAnchorByPosition(conversationId, index) + ?: return@withContext Triple(-1, emptyList(), null) + loadAroundAnchor(conversationId, anchor) + } - fun isTop() = !canLoadAbove + suspend fun initMessagesAtPercent( + conversationId: String, + percent: Float, + ): Triple, String?> = + withContext(SINGLE_FETCHER_THREAD) { + resetLoadState() + val anchor = findAnchorByPercent(conversationId, percent) + ?: return@withContext Triple(-1, emptyList(), null) + loadAroundAnchor(conversationId, anchor) + } - suspend fun nextPage( - conversationId: String, - messageId: String, - ) = - withContext(SINGLE_FETCHER_THREAD) { - if (!canLoadBelow || currentlyLoadingIds.contains(messageId) || loadedIds.contains(messageId)) { - return@withContext emptyList() - } - currentlyLoadingIds.add(messageId) - try { - val preCursor = db.query("SELECT rowid, created_at FROM messages WHERE id = ?", arrayOf(messageId)) - val (rowId, createdAt) = - preCursor.use { - it.moveToNext() - Pair(it.getInt(0), it.getString(1)) - } - val cursor = - db.query( - "$SQL WHERE m.conversation_id = ? AND m.rowid > ? AND m.created_at >= ? ORDER BY m.created_at ASC, m.rowid ASC LIMIT ?", - arrayOf(conversationId, rowId.toString(), createdAt, PAGE_SIZE.toString()), - ) - return@withContext convertToMessageItems(cursor).also { - if (it.size < PAGE_SIZE) { - canLoadBelow = false - } + suspend fun findMessageById(messageIds: List) = + withContext(SINGLE_FETCHER_THREAD) { + val ids = messageIds.joinToString(", ", "(", ")", transform = { "'$it'" }) + return@withContext MessageFetcherGenerated.findMessagesByIds(db, ids) + } + + fun isBottom() = !canLoadBelow + + fun isTop() = !canLoadAbove + + suspend fun nextPage( + conversationId: String, + messageId: String, + ) = + withContext(SINGLE_FETCHER_THREAD) { + val loadKey = "next:$messageId" + if (!canLoadBelow || currentlyLoadingIds.contains(loadKey) || loadedIds.contains(loadKey)) { + return@withContext emptyList() + } + + currentlyLoadingIds.add(loadKey) + try { + val anchor = findAnchorByMessageId(messageId) ?: return@withContext emptyList() + MessageFetcherGenerated.loadNextPage(db, conversationId, anchor.createdAt, anchor.rowId, PAGE_SIZE).also { + if (it.size < PAGE_SIZE) { + canLoadBelow = false } - } finally { - currentlyLoadingIds.remove(messageId) - loadedIds.add(messageId) } + } finally { + currentlyLoadingIds.remove(loadKey) + loadedIds.add(loadKey) } + } - suspend fun previousPage( - conversationId: String, - messageId: String, - ) = - withContext(SINGLE_FETCHER_THREAD) { - if (!canLoadAbove || currentlyLoadingIds.contains(messageId) || loadedIds.contains(messageId)) { - return@withContext emptyList() - } - currentlyLoadingIds.add(messageId) - try { - val preCursor = - db.query("SELECT rowid, created_at FROM messages WHERE id = ?", arrayOf(messageId)) - val (rowId, createdAt) = - preCursor.use { - it.moveToNext() - Pair(it.getInt(0), it.getString(1)) - } - val cursor = - db.query( - "$SQL WHERE m.conversation_id = ? AND m.rowid < ? AND m.created_at <= ? ORDER BY m.created_at DESC, m.rowid DESC LIMIT ?", - arrayOf(conversationId, rowId.toString(), createdAt, PAGE_SIZE.toString()), - ) - return@withContext convertToMessageItems(cursor).reversed().also { - if (it.size < PAGE_SIZE) { - canLoadAbove = false - } + suspend fun previousPage( + conversationId: String, + messageId: String, + ) = + withContext(SINGLE_FETCHER_THREAD) { + val loadKey = "previous:$messageId" + if (!canLoadAbove || currentlyLoadingIds.contains(loadKey) || loadedIds.contains(loadKey)) { + return@withContext emptyList() + } + + currentlyLoadingIds.add(loadKey) + try { + val anchor = findAnchorByMessageId(messageId) ?: return@withContext emptyList() + MessageFetcherGenerated.loadPreviousPage(db, conversationId, anchor.createdAt, anchor.rowId, PAGE_SIZE).reversed().also { + if (it.size < PAGE_SIZE) { + canLoadAbove = false } - } finally { - currentlyLoadingIds.remove(messageId) - loadedIds.add(messageId) } + } finally { + currentlyLoadingIds.remove(loadKey) + loadedIds.add(loadKey) } + } + + private fun resetLoadState() { + currentlyLoadingIds.clear() + loadedIds.clear() + canLoadAbove = true + canLoadBelow = true + } + + private fun loadBottomMessages(conversationId: String): Triple, String?> { + val result = MessageFetcherGenerated.loadBottomMessages(db, conversationId, INIT_SIZE).reversed() + canLoadBelow = false + canLoadAbove = result.size >= INIT_SIZE + return Triple(result.size - 1, result, null) + } + + private fun loadAroundAnchor( + conversationId: String, + anchor: ChatMessageAnchor, + ): Triple, String?> { + val next = MessageFetcherGenerated.loadAroundAnchorNext(db, conversationId, anchor.createdAt, anchor.rowId, INIT_SIZE / 2) + canLoadBelow = next.size >= INIT_SIZE / 2 + val thresholdSize = INIT_SIZE - next.size + val previous = MessageFetcherGenerated.loadAroundAnchorPrevious(db, conversationId, anchor.createdAt, anchor.rowId, thresholdSize).reversed() + canLoadAbove = previous.size >= thresholdSize + val data = previous + next + return Triple(data.indexOfFirst { it.messageId == anchor.messageId }, data, anchor.messageId) } + + private fun findFirstUnreadAnchor(conversationId: String): ChatMessageAnchor? = + MessageFetcherGenerated.findFirstUnreadAnchor(db, conversationId) + + private fun findAnchorByMessageId(messageId: String): ChatMessageAnchor? = + MessageFetcherGenerated.findAnchorByMessageId(db, messageId) + + private fun findAnchorByDate( + conversationId: String, + createdAt: String, + ): ChatMessageAnchor? = + MessageFetcherGenerated.findAnchorByDateAfter(db, conversationId, createdAt) + ?: MessageFetcherGenerated.findAnchorByDateBefore(db, conversationId, createdAt) + + private fun findAnchorByPosition( + conversationId: String, + index: Int, + ): ChatMessageAnchor? { + val count = countMessages(conversationId) + if (count <= 0) return null + val offset = index.coerceIn(0, count - 1) + return MessageFetcherGenerated.findAnchorByPosition(db, conversationId, offset) + } + + private fun findAnchorByPercent( + conversationId: String, + percent: Float, + ): ChatMessageAnchor? { + val count = countMessages(conversationId) + if (count <= 0) return null + val normalizedPercent = + when { + percent.isNaN() -> 0f + percent > 1f -> (percent / 100f).coerceIn(0f, 1f) + else -> percent.coerceIn(0f, 1f) + } + val index = ((count - 1) * normalizedPercent).roundToInt() + return findAnchorByPosition(conversationId, index) + } + + private fun countMessages(conversationId: String): Int = + MessageFetcherGenerated.countMessages(db, conversationId) +} diff --git a/app/src/main/java/one/mixin/android/db/fetcher/MessageFetcherQuerySpec.kt b/app/src/main/java/one/mixin/android/db/fetcher/MessageFetcherQuerySpec.kt new file mode 100644 index 0000000000..c09a71d465 --- /dev/null +++ b/app/src/main/java/one/mixin/android/db/fetcher/MessageFetcherQuerySpec.kt @@ -0,0 +1,201 @@ +package one.mixin.android.db.fetcher + +import one.mixin.android.db.MixinDatabase +import one.mixin.android.codegen.annotation.GeneratedQueryProvider +import one.mixin.android.codegen.annotation.GeneratedRawCursorQuery +import one.mixin.android.vo.MessageItem + +private const val MESSAGE_ITEM_SQL = + """ + SELECT m.id AS messageId, m.conversation_id AS conversationId, u.user_id AS userId, + u.full_name AS userFullName, u.identity_number AS userIdentityNumber, u.app_id AS appId, m.category AS type, + m.content AS content, m.created_at AS createdAt, m.status AS status, m.media_status AS mediaStatus, m.media_waveform AS mediaWaveform, + m.name AS mediaName, m.media_mime_type AS mediaMimeType, m.media_size AS mediaSize, m.media_width AS mediaWidth, m.media_height AS mediaHeight, + m.thumb_image AS thumbImage, m.thumb_url AS thumbUrl, m.media_url AS mediaUrl, m.media_duration AS mediaDuration, m.quote_message_id as quoteId, + m.quote_content as quoteContent, m.caption as caption, u.membership AS membership, u1.full_name AS participantFullName, m.action AS actionName, u1.user_id AS participantUserId, + COALESCE(s.snapshot_id, ss.snapshot_id) AS snapshotId, COALESCE(s.memo, ss.memo) AS snapshotMemo, COALESCE(s.type, ss.type) AS snapshotType, COALESCE(s.amount, ss.amount) AS snapshotAmount, + COALESCE(a.symbol, t.symbol) AS assetSymbol, COALESCE(s.asset_id, ss.asset_id) AS assetId, COALESCE(a.icon_url, t.icon_url) AS assetIcon, t.collection_hash AS assetCollectionHash, + st.asset_url AS assetUrl, st.asset_width AS assetWidth, st.asset_height AS assetHeight, st.sticker_id AS stickerId, + st.name AS assetName, st.asset_type AS assetType, h.site_name AS siteName, h.site_title AS siteTitle, h.site_description AS siteDescription, + h.site_image AS siteImage, m.shared_user_id AS sharedUserId, su.full_name AS sharedUserFullName, su.identity_number AS sharedUserIdentityNumber, + su.avatar_url AS sharedUserAvatarUrl, su.is_verified AS sharedUserIsVerified, su.app_id AS sharedUserAppId, su.membership AS sharedMembership, mm.mentions AS mentions, mm.has_read as mentionRead, + pm.message_id IS NOT NULL as isPin, c.name AS groupName, em.expire_in AS expireIn, em.expire_at AS expireAt + FROM messages m + LEFT JOIN users u ON m.user_id = u.user_id + LEFT JOIN users u1 ON m.participant_id = u1.user_id + LEFT JOIN snapshots s ON m.snapshot_id = s.snapshot_id + LEFT JOIN safe_snapshots ss ON m.snapshot_id = ss.snapshot_id + LEFT JOIN assets a ON s.asset_id = a.asset_id + LEFT JOIN tokens t ON ss.asset_id = t.asset_id + LEFT JOIN stickers st ON st.sticker_id = m.sticker_id + LEFT JOIN hyperlinks h ON m.hyperlink = h.hyperlink + LEFT JOIN users su ON m.shared_user_id = su.user_id + LEFT JOIN conversations c ON m.conversation_id = c.conversation_id + LEFT JOIN message_mentions mm ON m.id = mm.message_id + LEFT JOIN pin_messages pm ON m.id = pm.message_id + LEFT JOIN expired_messages em ON m.id = em.message_id + """ + +@GeneratedQueryProvider(generatedName = "MessageFetcherGenerated") +interface MessageFetcherQuerySpec { + @GeneratedRawCursorQuery( + sql = MESSAGE_ITEM_SQL + " WHERE m.id IN {{ids}}", + binds = [], + converter = "one.mixin.android.db.provider.convertToMessageItems", + ) + fun findMessagesByIds( + db: MixinDatabase, + ids: String, + ): List + + @GeneratedRawCursorQuery( + sql = MESSAGE_ITEM_SQL + " WHERE m.conversation_id = ? ORDER BY m.created_at DESC, m.rowid DESC LIMIT ?", + binds = ["conversationId", "limit"], + converter = "one.mixin.android.db.provider.convertToMessageItems", + ) + fun loadBottomMessages( + db: MixinDatabase, + conversationId: String, + limit: Int, + ): List + + @GeneratedRawCursorQuery( + sql = MESSAGE_ITEM_SQL + " WHERE m.conversation_id = ? AND (m.created_at > ? OR (m.created_at = ? AND m.rowid > ?)) ORDER BY m.created_at ASC, m.rowid ASC LIMIT ?", + binds = ["conversationId", "createdAt", "createdAt", "rowId", "limit"], + converter = "one.mixin.android.db.provider.convertToMessageItems", + ) + fun loadNextPage( + db: MixinDatabase, + conversationId: String, + createdAt: String, + rowId: Long, + limit: Int, + ): List + + @GeneratedRawCursorQuery( + sql = MESSAGE_ITEM_SQL + " WHERE m.conversation_id = ? AND (m.created_at < ? OR (m.created_at = ? AND m.rowid < ?)) ORDER BY m.created_at DESC, m.rowid DESC LIMIT ?", + binds = ["conversationId", "createdAt", "createdAt", "rowId", "limit"], + converter = "one.mixin.android.db.provider.convertToMessageItems", + ) + fun loadPreviousPage( + db: MixinDatabase, + conversationId: String, + createdAt: String, + rowId: Long, + limit: Int, + ): List + + @GeneratedRawCursorQuery( + sql = MESSAGE_ITEM_SQL + " WHERE m.conversation_id = ? AND (m.created_at > ? OR (m.created_at = ? AND m.rowid >= ?)) ORDER BY m.created_at ASC, m.rowid ASC LIMIT ?", + binds = ["conversationId", "createdAt", "createdAt", "rowId", "limit"], + converter = "one.mixin.android.db.provider.convertToMessageItems", + ) + fun loadAroundAnchorNext( + db: MixinDatabase, + conversationId: String, + createdAt: String, + rowId: Long, + limit: Int, + ): List + + @GeneratedRawCursorQuery( + sql = MESSAGE_ITEM_SQL + " WHERE m.conversation_id = ? AND (m.created_at < ? OR (m.created_at = ? AND m.rowid < ?)) ORDER BY m.created_at DESC, m.rowid DESC LIMIT ?", + binds = ["conversationId", "createdAt", "createdAt", "rowId", "limit"], + converter = "one.mixin.android.db.provider.convertToMessageItems", + ) + fun loadAroundAnchorPrevious( + db: MixinDatabase, + conversationId: String, + createdAt: String, + rowId: Long, + limit: Int, + ): List + + @GeneratedRawCursorQuery( + sql = """ + SELECT m.rowid, m.created_at, m.id + FROM remote_messages_status rm + INNER JOIN messages m ON m.id = rm.message_id + WHERE rm.conversation_id = ? AND rm.status = 'DELIVERED' + ORDER BY m.created_at ASC, m.rowid ASC + LIMIT 1 + """, + binds = ["conversationId"], + converter = "convertToChatMessageAnchor", + ) + fun findFirstUnreadAnchor( + db: MixinDatabase, + conversationId: String, + ): ChatMessageAnchor? + + @GeneratedRawCursorQuery( + sql = "SELECT rowid, created_at, id FROM messages WHERE id = ?", + binds = ["messageId"], + converter = "convertToChatMessageAnchor", + ) + fun findAnchorByMessageId( + db: MixinDatabase, + messageId: String, + ): ChatMessageAnchor? + + @GeneratedRawCursorQuery( + sql = """ + SELECT rowid, created_at, id + FROM messages + WHERE conversation_id = ? AND created_at >= ? + ORDER BY created_at ASC, rowid ASC + LIMIT 1 + """, + binds = ["conversationId", "createdAt"], + converter = "convertToChatMessageAnchor", + ) + fun findAnchorByDateAfter( + db: MixinDatabase, + conversationId: String, + createdAt: String, + ): ChatMessageAnchor? + + @GeneratedRawCursorQuery( + sql = """ + SELECT rowid, created_at, id + FROM messages + WHERE conversation_id = ? AND created_at < ? + ORDER BY created_at DESC, rowid DESC + LIMIT 1 + """, + binds = ["conversationId", "createdAt"], + converter = "convertToChatMessageAnchor", + ) + fun findAnchorByDateBefore( + db: MixinDatabase, + conversationId: String, + createdAt: String, + ): ChatMessageAnchor? + + @GeneratedRawCursorQuery( + sql = """ + SELECT rowid, created_at, id + FROM messages + WHERE conversation_id = ? + ORDER BY created_at ASC, rowid ASC + LIMIT 1 OFFSET ? + """, + binds = ["conversationId", "offset"], + converter = "convertToChatMessageAnchor", + ) + fun findAnchorByPosition( + db: MixinDatabase, + conversationId: String, + offset: Int, + ): ChatMessageAnchor? + + @GeneratedRawCursorQuery( + sql = "SELECT count(1) FROM messages WHERE conversation_id = ?", + binds = ["conversationId"], + converter = "convertToMessageCount", + ) + fun countMessages( + db: MixinDatabase, + conversationId: String, + ): Int +} diff --git a/app/src/main/java/one/mixin/android/db/provider/DataConverter.kt b/app/src/main/java/one/mixin/android/db/provider/DataConverter.kt index 3898368d80..eed2976cf1 100644 --- a/app/src/main/java/one/mixin/android/db/provider/DataConverter.kt +++ b/app/src/main/java/one/mixin/android/db/provider/DataConverter.kt @@ -918,123 +918,109 @@ fun callableTokenItem( } } -@SuppressLint("RestrictedApi") -fun callableSearchMessageItem( - db: MixinDatabase, - statement: RoomSQLiteQuery, - cancellationSignal: CancellationSignal, -): Callable> { - return Callable> { - val cursor = query(db, statement, false, cancellationSignal) - try { - val cursorIndexOfConversationId = 0 - val cursorIndexOfConversationAvatarUrl = 1 - val cursorIndexOfConversationName = 2 - val cursorIndexOfConversationCategory = 3 - val cursorIndexOfMessageCount = 4 - val cursorIndexOfUserId = 5 - val cursorIndexOfAppId = 6 - val cursorIndexOfUserAvatarUrl = 7 - val cursorIndexOfUserIdentityNumber = 8 - val cursorIndexOfUserFullName = 9 - val cursorIndexOfUserIsVerified = 10 - val cursorIndexOfUserMembership = 11 - val result: MutableList = - java.util.ArrayList(cursor.count) - while (cursor.moveToNext()) { - val item: SearchMessageItem - val tmpConversationId: String? = - if (cursor.isNull(cursorIndexOfConversationId)) { - null - } else { - cursor.getString(cursorIndexOfConversationId) - } - val tmpConversationAvatarUrl: String? = - if (cursor.isNull(cursorIndexOfConversationAvatarUrl)) { - null - } else { - cursor.getString(cursorIndexOfConversationAvatarUrl) - } - val tmpConversationName: String? = - if (cursor.isNull(cursorIndexOfConversationName)) { - null - } else { - cursor.getString(cursorIndexOfConversationName) - } - val tmpConversationCategory: String? = - if (cursor.isNull(cursorIndexOfConversationCategory)) { - null - } else { - cursor.getString(cursorIndexOfConversationCategory) - } - val tmpMessageCount: Int = cursor.getInt(cursorIndexOfMessageCount) - val tmpUserId: String? = - if (cursor.isNull(cursorIndexOfUserId)) { - null - } else { - cursor.getString(cursorIndexOfUserId) - } - val tempAppId: String? = - if (cursor.isNull(cursorIndexOfAppId)) { - null - } else { - cursor.getString(cursorIndexOfAppId) - } - val tmpUserAvatarUrl: String? = - if (cursor.isNull(cursorIndexOfUserAvatarUrl)) { - null - } else { - cursor.getString(cursorIndexOfUserAvatarUrl) - } - val tmpUserIdentityNumber: String? = - if (cursor.isNull(cursorIndexOfUserIdentityNumber)) { - null - } else { - cursor.getString(cursorIndexOfUserIdentityNumber) - } - val tmpUserFullName: String? = - if (cursor.isNull(cursorIndexOfUserFullName)) { - null - } else { - cursor.getString(cursorIndexOfUserFullName) - } - val tmpIsVerified: Boolean? - val tmp: Int? = - if (cursor.isNull(cursorIndexOfUserIsVerified)) { - null - } else { - cursor.getInt(cursorIndexOfUserIsVerified) - } - tmpIsVerified = if (tmp == null) null else tmp != 0 - val tmpUserMembership: String? = - if (cursor.isNull(cursorIndexOfUserMembership)) { - null - } else { - cursor.getString(cursorIndexOfUserMembership) - } - item = - SearchMessageItem( - tmpConversationId!!, - tmpConversationCategory, - tmpConversationName, - tmpMessageCount, - tmpUserId!!, - tempAppId, - tmpUserFullName, - tmpUserAvatarUrl, - tmpUserIdentityNumber, - tmpConversationAvatarUrl, - tmpIsVerified, - membershipConverter.revertData(tmpUserMembership) - ) - result.add(item) +fun convertToSearchMessageItems(cursor: Cursor?): List { + cursor ?: return emptyList() + val cursorIndexOfConversationId = 0 + val cursorIndexOfConversationAvatarUrl = 1 + val cursorIndexOfConversationName = 2 + val cursorIndexOfConversationCategory = 3 + val cursorIndexOfMessageCount = 4 + val cursorIndexOfUserId = 5 + val cursorIndexOfAppId = 6 + val cursorIndexOfUserAvatarUrl = 7 + val cursorIndexOfUserIdentityNumber = 8 + val cursorIndexOfUserFullName = 9 + val cursorIndexOfUserIsVerified = 10 + val cursorIndexOfUserMembership = 11 + val result: MutableList = + java.util.ArrayList(cursor.count) + while (cursor.moveToNext()) { + val tmpConversationId: String? = + if (cursor.isNull(cursorIndexOfConversationId)) { + null + } else { + cursor.getString(cursorIndexOfConversationId) } - return@Callable result - } finally { - cursor.close() - statement.release() - } + val tmpConversationAvatarUrl: String? = + if (cursor.isNull(cursorIndexOfConversationAvatarUrl)) { + null + } else { + cursor.getString(cursorIndexOfConversationAvatarUrl) + } + val tmpConversationName: String? = + if (cursor.isNull(cursorIndexOfConversationName)) { + null + } else { + cursor.getString(cursorIndexOfConversationName) + } + val tmpConversationCategory: String? = + if (cursor.isNull(cursorIndexOfConversationCategory)) { + null + } else { + cursor.getString(cursorIndexOfConversationCategory) + } + val tmpMessageCount: Int = cursor.getInt(cursorIndexOfMessageCount) + val tmpUserId: String? = + if (cursor.isNull(cursorIndexOfUserId)) { + null + } else { + cursor.getString(cursorIndexOfUserId) + } + val tempAppId: String? = + if (cursor.isNull(cursorIndexOfAppId)) { + null + } else { + cursor.getString(cursorIndexOfAppId) + } + val tmpUserAvatarUrl: String? = + if (cursor.isNull(cursorIndexOfUserAvatarUrl)) { + null + } else { + cursor.getString(cursorIndexOfUserAvatarUrl) + } + val tmpUserIdentityNumber: String? = + if (cursor.isNull(cursorIndexOfUserIdentityNumber)) { + null + } else { + cursor.getString(cursorIndexOfUserIdentityNumber) + } + val tmpUserFullName: String? = + if (cursor.isNull(cursorIndexOfUserFullName)) { + null + } else { + cursor.getString(cursorIndexOfUserFullName) + } + val tmp: Int? = + if (cursor.isNull(cursorIndexOfUserIsVerified)) { + null + } else { + cursor.getInt(cursorIndexOfUserIsVerified) + } + val tmpIsVerified = if (tmp == null) null else tmp != 0 + val tmpUserMembership: String? = + if (cursor.isNull(cursorIndexOfUserMembership)) { + null + } else { + cursor.getString(cursorIndexOfUserMembership) + } + result.add( + SearchMessageItem( + tmpConversationId!!, + tmpConversationCategory, + tmpConversationName, + tmpMessageCount, + tmpUserId!!, + tempAppId, + tmpUserFullName, + tmpUserAvatarUrl, + tmpUserIdentityNumber, + tmpConversationAvatarUrl, + tmpIsVerified, + membershipConverter.revertData(tmpUserMembership) + ) + ) } + return result } @SuppressLint("RestrictedApi") @@ -1568,4 +1554,4 @@ fun callableMarket( statement.release() } } -} \ No newline at end of file +} diff --git a/app/src/main/java/one/mixin/android/db/provider/DataProvider.kt b/app/src/main/java/one/mixin/android/db/provider/DataProvider.kt index e06dc41bc7..052f55bb9b 100644 --- a/app/src/main/java/one/mixin/android/db/provider/DataProvider.kt +++ b/app/src/main/java/one/mixin/android/db/provider/DataProvider.kt @@ -1,18 +1,11 @@ package one.mixin.android.db.provider import android.annotation.SuppressLint -import android.database.Cursor import android.os.CancellationSignal import androidx.paging.DataSource -import androidx.room.CoroutinesRoom -import androidx.room.RoomSQLiteQuery import kotlinx.coroutines.asCoroutineDispatcher import kotlinx.coroutines.withContext -import one.mixin.android.db.ConversationDao import one.mixin.android.db.MixinDatabase -import one.mixin.android.db.TokenDao.Companion.PREFIX_ASSET_ITEM -import one.mixin.android.db.datasource.MixinLimitOffsetDataSource -import one.mixin.android.db.datasource.NoCountLimitOffsetDataSource import one.mixin.android.fts.FtsDataSource import one.mixin.android.fts.FtsDatabase import one.mixin.android.fts.rawSearch @@ -30,153 +23,23 @@ import one.mixin.android.vo.safe.TokenItem @SuppressLint("RestrictedApi") class DataProvider { companion object { - fun observeConversations(database: MixinDatabase) = - object : DataSource.Factory() { - override fun create(): DataSource { - val sql = ConversationDao.PREFIX_CONVERSATION_ITEM - val countStatement = RoomSQLiteQuery.acquire("SELECT count(1) FROM conversations c INNER JOIN users ou ON ou.user_id = c.owner_id WHERE c.category IS NOT NULL", 0) - val offsetStatement = RoomSQLiteQuery.acquire("SELECT c.rowid FROM conversations c INNER JOIN users ou ON ou.user_id = c.owner_id ORDER BY c.pin_time DESC, c.last_message_created_at DESC LIMIT ? OFFSET ?", 2) - val querySqlGenerator = fun(ids: String): RoomSQLiteQuery { - return RoomSQLiteQuery.acquire("$sql WHERE c.rowid IN ($ids) ORDER BY c.pin_time DESC, c.last_message_created_at DESC", 0) - } - return object : MixinLimitOffsetDataSource(database, countStatement, offsetStatement, querySqlGenerator, arrayOf("message_mentions", "conversations", "users")) { - override fun convertRows(cursor: Cursor?): List { - return convertToConversationItems(cursor) - } - } - } - } + fun observeConversations(database: MixinDatabase): DataSource.Factory = + DataProviderGenerated.observeConversations(database) fun observeConversationsByCircleId( circleId: String, database: MixinDatabase, - ) = - object : DataSource.Factory() { - override fun create(): DataSource { - val sql = - """ - SELECT c.conversation_id AS conversationId, c.icon_url AS groupIconUrl, c.category AS category, - c.name AS groupName, c.status AS status, c.last_read_message_id AS lastReadMessageId, - c.unseen_message_count AS unseenMessageCount, c.owner_id AS ownerId, cc.pin_time AS pinTime, c.mute_until AS muteUntil, - ou.avatar_url AS avatarUrl, ou.full_name AS name, ou.is_verified AS ownerVerified, ou.identity_number AS ownerIdentityNumber, - ou.mute_until AS ownerMuteUntil, ou.app_id AS appId, - m.content AS content, m.category AS contentType, m.created_at AS createdAt, - m.user_id AS senderId, m.`action` AS actionName, m.status AS messageStatus, - mu.full_name AS senderFullName, - pu.full_name AS participantFullName, pu.user_id AS participantUserId, - (SELECT count(1) FROM message_mentions me WHERE me.conversation_id = c.conversation_id AND me.has_read = 0) AS mentionCount, - mm.mentions AS mentions, ou.membership AS membership - FROM circle_conversations cc - INNER JOIN conversations c ON cc.conversation_id = c.conversation_id - INNER JOIN circles ci ON ci.circle_id = cc.circle_id - INNER JOIN users ou ON ou.user_id = c.owner_id - LEFT JOIN messages m ON c.last_message_id = m.id - LEFT JOIN message_mentions mm ON mm.message_id = m.id - LEFT JOIN users mu ON mu.user_id = m.user_id - LEFT JOIN users pu ON pu.user_id = m.participant_id - """ - val countStatement = - RoomSQLiteQuery.acquire( - """ - SELECT count(1) FROM circle_conversations cc - INNER JOIN circles ci ON ci.circle_id = cc.circle_id - INNER JOIN conversations c ON cc.conversation_id = c.conversation_id - INNER JOIN users ou ON ou.user_id = c.owner_id - WHERE c.category IS NOT NULL AND cc.circle_id = '$circleId' - """, - 0, - ) - val offsetStatement = - RoomSQLiteQuery.acquire( - """ - SELECT cc.rowid FROM circle_conversations cc - INNER JOIN conversations c ON cc.conversation_id = c.conversation_id - INNER JOIN circles ci ON ci.circle_id = cc.circle_id - INNER JOIN users ou ON ou.user_id = c.owner_id - LEFT JOIN messages m ON c.last_message_id = m.id - WHERE c.category IS NOT NULL AND cc.circle_id = '$circleId' - ORDER BY cc.pin_time DESC, - CASE - WHEN m.created_at is NULL THEN c.created_at - ELSE m.created_at - END - DESC - LIMIT ? OFFSET ? - """, - 2, - ) - val querySqlGenerator = fun(ids: String): RoomSQLiteQuery { - return RoomSQLiteQuery.acquire( - """ - $sql WHERE cc.rowid IN ($ids) - ORDER BY cc.pin_time DESC, - CASE - WHEN m.created_at is NULL THEN c.created_at - ELSE m.created_at - END - DESC - """, - 0, - ) - } - return object : MixinLimitOffsetDataSource(database, countStatement, offsetStatement, querySqlGenerator, arrayOf("message_mentions", "circle_conversations", "conversations", "circles", "users")) { - override fun convertRows(cursor: Cursor?): List { - return convertToConversationItems(cursor) - } - } - } - } + ): DataSource.Factory = + DataProviderGenerated.observeConversationsByCircleId(circleId, database) - @Suppress("LocalVariableName", "JoinDeclarationAndAssignment") suspend fun fuzzySearchToken( name: String?, symbol: String?, db: MixinDatabase, cancellationSignal: CancellationSignal, - ): List { - val _sql = - """ - $PREFIX_ASSET_ITEM - WHERE ae.balance > 0 - AND (a1.symbol LIKE '%' || ? || '%' ESCAPE '\' OR a1.name LIKE '%' || ? || '%' ESCAPE '\') - ORDER BY - a1.symbol = ? COLLATE NOCASE OR a1.name = ? COLLATE NOCASE DESC, - a1.price_usd*ae.balance DESC - """ - val _statement = RoomSQLiteQuery.acquire(_sql, 4) - var _argIndex = 1 - if (symbol == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, symbol) - } - _argIndex = 2 - if (name == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, name) - } - _argIndex = 3 - if (symbol == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, symbol) - } - _argIndex = 4 - if (name == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, name) - } - return CoroutinesRoom.execute( - db, - false, - cancellationSignal, - callableTokenItem(db, _statement, cancellationSignal), - ) - } + ): List = + DataProviderGenerated.fuzzySearchToken(name, symbol, db, cancellationSignal) - @Suppress("LocalVariableName", "JoinDeclarationAndAssignment") suspend fun fuzzySearchUser( username: String?, identityNumber: String?, @@ -184,249 +47,38 @@ class DataProvider { id: String?, db: MixinDatabase, cancellationSignal: CancellationSignal, - ): List { - val _sql = """ - SELECT * FROM users - WHERE user_id != ? - AND relationship = 'FRIEND' - AND identity_number != '0' - AND (full_name LIKE '%' || ? || '%' ESCAPE '\' OR identity_number like '%' || ? || '%' ESCAPE '\' OR phone like '%' || ? || '%' ESCAPE '\') - ORDER BY - full_name = ? COLLATE NOCASE OR identity_number = ? COLLATE NOCASE DESC - """ - val _statement = RoomSQLiteQuery.acquire(_sql, 6) - var _argIndex = 1 - if (id == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, id) - } - _argIndex = 2 - if (username == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, username) - } - _argIndex = 3 - if (identityNumber == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, identityNumber) - } - _argIndex = 4 - if (phone == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, phone) - } - _argIndex = 5 - if (username == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, username) - } - _argIndex = 6 - if (identityNumber == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, identityNumber) - } - return CoroutinesRoom.execute( - db, - false, - cancellationSignal, - callableUser(db, _statement, cancellationSignal), - ) - } + ): List = + DataProviderGenerated.fuzzySearchUser(username, identityNumber, phone, id, db, cancellationSignal) - @Suppress("LocalVariableName", "JoinDeclarationAndAssignment") suspend fun fuzzySearchBots( username: String?, identityNumber: String?, id: String?, db: MixinDatabase, cancellationSignal: CancellationSignal, - ): List { - val _sql = """ - SELECT * FROM users - WHERE app_id IS NOT NULL - AND user_id != ? - AND relationship = 'FRIEND' - AND identity_number != '0' - AND (full_name LIKE '%' || ? || '%' ESCAPE '\' OR identity_number like '%' || ? || '%' ESCAPE '\') - ORDER BY - full_name = ? COLLATE NOCASE OR identity_number = ? COLLATE NOCASE DESC - """ - val _statement = RoomSQLiteQuery.acquire(_sql, 5) - var _argIndex = 1 - if (id == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, id) - } - _argIndex = 2 - if (username == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, username) - } - _argIndex = 3 - if (identityNumber == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, identityNumber) - } - _argIndex = 4 - if (username == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, username) - } - _argIndex = 5 - if (identityNumber == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, identityNumber) - } - return CoroutinesRoom.execute( - db, - false, - cancellationSignal, - callableBot(db, _statement, cancellationSignal), - ) - } + ): List = + DataProviderGenerated.fuzzySearchBots(username, identityNumber, id, db, cancellationSignal) - @Suppress("LocalVariableName") suspend fun fuzzyMarkets( keyword: String, db: MixinDatabase, cancellationSignal: CancellationSignal, - ): List { - val _sql = """ - SELECT * - FROM markets - WHERE symbol LIKE '%' || ? || '%' ESCAPE '\' - OR name LIKE '%' || ? || '%' ESCAPE '\' - ORDER BY - CASE - WHEN symbol LIKE ? || '%' THEN 1 - WHEN name LIKE ? || '%' THEN 1 - ELSE 2 - END, - CAST(market_cap_rank AS INTEGER) ASC, - symbol ASC, - name ASC; - """ - val _statement = RoomSQLiteQuery.acquire(_sql, 2) - var _argIndex = 1 - _statement.bindString(_argIndex, keyword) - _argIndex = 2 - _statement.bindString(_argIndex, keyword) - return CoroutinesRoom.execute( - db, - false, - cancellationSignal, - callableMarket(db, _statement, cancellationSignal), - ) - } + ): List = + DataProviderGenerated.fuzzyMarkets(keyword, db, cancellationSignal) - @Suppress("LocalVariableName", "JoinDeclarationAndAssignment") suspend fun fuzzyInscription( keyword: String?, db: MixinDatabase, cancellationSignal: CancellationSignal, - ): List { - val _sql = """ - SELECT `i`.`collection_hash`, `i`.`inscription_hash`, `i`.`sequence`, `i`.`content_type`, `i`.`content_url`, `ic`.`collection_hash`, `ic`.`name`, `ic`.`icon_url` FROM outputs o - LEFT JOIN inscription_items i ON i.inscription_hash == o.inscription_hash - LEFT JOIN inscription_collections ic on ic.collection_hash = i.collection_hash - WHERE i.inscription_hash IS NOT NULL AND o.state = 'unspent' AND (`ic`.name LIKE '%' || ? || '%' ESCAPE '\') - """ - val _statement = RoomSQLiteQuery.acquire(_sql, 1) - val _argIndex = 1 - if (keyword == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, keyword) - } - return CoroutinesRoom.execute( - db, - false, - cancellationSignal, - callableSafeInscription(db, _statement, cancellationSignal), - ) - } + ): List = + DataProviderGenerated.fuzzyInscription(keyword, db, cancellationSignal) - @Suppress("LocalVariableName", "JoinDeclarationAndAssignment") suspend fun fuzzySearchChat( query: String?, db: MixinDatabase, cancellationSignal: CancellationSignal, - ): List { - val _sql = """ - SELECT c.conversation_id AS conversationId, c.icon_url AS groupIconUrl, c.category AS category, c.name AS groupName, - ou.identity_number AS ownerIdentityNumber, c.owner_id AS userId, ou.full_name AS fullName, ou.avatar_url AS avatarUrl, - ou.is_verified AS isVerified, ou.app_id AS appId, ou.mute_until AS ownerMuteUntil, c.mute_until AS muteUntil, - c.pin_time AS pinTime, ou.membership AS membership - FROM conversations c - INNER JOIN users ou ON ou.user_id = c.owner_id - LEFT JOIN messages m ON c.last_message_id = m.id - WHERE (c.category = 'GROUP' AND c.name LIKE '%' || ? || '%' ESCAPE '\') - OR (c.category = 'CONTACT' AND ou.relationship != 'FRIEND' - AND (ou.full_name LIKE '%' || ? || '%' ESCAPE '\' - OR ou.identity_number like '%' || ? || '%' ESCAPE '\')) - ORDER BY - (c.category = 'GROUP' AND c.name = ? COLLATE NOCASE) - OR (c.category = 'CONTACT' AND ou.relationship != 'FRIEND' - AND (ou.full_name = ? COLLATE NOCASE - OR ou.identity_number = ? COLLATE NOCASE)) DESC, - c.pin_time DESC, - m.created_at DESC - """ - val _statement = RoomSQLiteQuery.acquire(_sql, 6) - var _argIndex = 1 - if (query == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, query) - } - _argIndex = 2 - if (query == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, query) - } - _argIndex = 3 - if (query == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, query) - } - _argIndex = 4 - if (query == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, query) - } - _argIndex = 5 - if (query == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, query) - } - _argIndex = 6 - if (query == null) { - _statement.bindNull(_argIndex) - } else { - _statement.bindString(_argIndex, query) - } - return CoroutinesRoom.execute( - db, - false, - cancellationSignal, - callableChatMinimal(db, _statement, cancellationSignal), - ) - } + ): List = + DataProviderGenerated.fuzzySearchChat(query, db, cancellationSignal) suspend fun fuzzySearchMessage( ftsDatabase: FtsDatabase, @@ -436,17 +88,6 @@ class DataProvider { ): List = withContext(db.queryExecutor.asCoroutineDispatcher()) { val result = ftsDatabase.rawSearch(query, cancellationSignal) - val sql = """ - SELECT m.conversation_id AS conversationId, c.icon_url AS conversationAvatarUrl, - c.name AS conversationName, c.category AS conversationCategory, 0 as messageCount, - u.user_id AS userId, u.app_id AS appId, u.avatar_url AS userAvatarUrl, u.identity_number AS userIdentityNumber, - u.full_name AS userFullName, u.is_verified as isVerified, u.membership AS membership - FROM messages m - INNER JOIN conversations c ON c.conversation_id = m.conversation_id - INNER JOIN users u ON c.owner_id = u.user_id - WHERE m.id IN (*) - ORDER BY m.created_at DESC - """ if (result.isEmpty()) return@withContext emptyList() val ids = result.joinToString( @@ -454,13 +95,7 @@ class DataProvider { postfix = "'", separator = "', '", ) { it.messageId } - val statement = RoomSQLiteQuery.acquire(sql.replace("*", ids), 0) - return@withContext CoroutinesRoom.execute( - db, - true, - cancellationSignal, - callableSearchMessageItem(db, statement, cancellationSignal), - ).map { + return@withContext DataProviderGenerated.fuzzySearchMessageItems(db, ids).map { val obtained = result.find { item -> item.conversationId == it.conversationId } if (obtained != null) { it.messageCount = obtained.messageCount @@ -486,45 +121,7 @@ class DataProvider { database: MixinDatabase, conversationId: String, count: Int, - ) = - object : DataSource.Factory() { - override fun create(): DataSource { - val sql = - """ - SELECT m.id AS messageId, m.conversation_id AS conversationId, u.user_id AS userId, - u.full_name AS userFullName, u.identity_number AS userIdentityNumber, u.app_id AS appId, m.category AS type, - m.content AS content, m.created_at AS createdAt, m.status AS status, m.media_status AS mediaStatus, m.media_waveform AS mediaWaveform, - m.name AS mediaName, m.media_mime_type AS mediaMimeType, m.media_size AS mediaSize, m.media_width AS mediaWidth, m.media_height AS mediaHeight, - m.thumb_image AS thumbImage, m.thumb_url AS thumbUrl, m.media_url AS mediaUrl, m.media_duration AS mediaDuration, m.quote_message_id as quoteId, - m.quote_content as quoteContent, m.caption as caption, u1.full_name AS participantFullName, m.action AS actionName, u1.user_id AS participantUserId, - s.snapshot_id AS snapshotId, s.type AS snapshotType, s.amount AS snapshotAmount, a.symbol AS assetSymbol, s.asset_id AS assetId, - a.icon_url AS assetIcon, st.asset_url AS assetUrl, st.asset_width AS assetWidth, st.asset_height AS assetHeight, st.sticker_id AS stickerId, - st.name AS assetName, st.asset_type AS assetType, h.site_name AS siteName, h.site_title AS siteTitle, h.site_description AS siteDescription, - h.site_image AS siteImage, m.shared_user_id AS sharedUserId, su.full_name AS sharedUserFullName, su.identity_number AS sharedUserIdentityNumber, - su.avatar_url AS sharedUserAvatarUrl, su.is_verified AS sharedUserIsVerified, su.app_id AS sharedUserAppId, mm.mentions AS mentions, - su.membership AS sharedMembership, u.membership AS membership - FROM pin_messages pm - LEFT JOIN messages m ON m.id = pm.message_id - LEFT JOIN users u ON m.user_id = u.user_id - LEFT JOIN users u1 ON m.participant_id = u1.user_id - LEFT JOIN snapshots s ON m.snapshot_id = s.snapshot_id - LEFT JOIN assets a ON s.asset_id = a.asset_id - LEFT JOIN stickers st ON st.sticker_id = m.sticker_id - LEFT JOIN hyperlinks h ON m.hyperlink = h.hyperlink - LEFT JOIN users su ON m.shared_user_id = su.user_id - LEFT JOIN conversations c ON m.conversation_id = c.conversation_id - LEFT JOIN message_mentions mm ON m.id = mm.message_id - WHERE m.conversation_id = ? - ORDER BY m.created_at ASC - """ - val statement = RoomSQLiteQuery.acquire(sql, 1) - statement.bindString(1, conversationId) - return object : NoCountLimitOffsetDataSource(database, statement, count, "pin_messages", "messages", "users", "snapshots", "assets", "stickers", "hyperlinks", "conversations", "message_mentions") { - override fun convertRows(cursor: Cursor?): List { - return convertChatHistoryMessageItem(cursor) - } - } - } - } + ): DataSource.Factory = + DataProviderGenerated.getPinMessages(database, conversationId, count) } } diff --git a/app/src/main/java/one/mixin/android/db/provider/DataProviderQuerySpec.kt b/app/src/main/java/one/mixin/android/db/provider/DataProviderQuerySpec.kt new file mode 100644 index 0000000000..2d262a7ed9 --- /dev/null +++ b/app/src/main/java/one/mixin/android/db/provider/DataProviderQuerySpec.kt @@ -0,0 +1,333 @@ +package one.mixin.android.db.provider + +import android.os.CancellationSignal +import androidx.paging.DataSource +import one.mixin.android.db.ConversationDao +import one.mixin.android.db.MixinDatabase +import one.mixin.android.db.TokenDao.Companion.PREFIX_ASSET_ITEM +import one.mixin.android.codegen.annotation.GeneratedQuery +import one.mixin.android.codegen.annotation.GeneratedQueryProvider +import one.mixin.android.codegen.annotation.GeneratedLimitOffsetDataSourceQuery +import one.mixin.android.codegen.annotation.GeneratedNoCountDataSourceQuery +import one.mixin.android.codegen.annotation.GeneratedRawCursorQuery +import one.mixin.android.vo.ChatHistoryMessageItem +import one.mixin.android.vo.ChatMinimal +import one.mixin.android.vo.ConversationItem +import one.mixin.android.vo.SearchBot +import one.mixin.android.vo.SearchMessageItem +import one.mixin.android.vo.User +import one.mixin.android.vo.market.Market +import one.mixin.android.vo.safe.SafeCollectible +import one.mixin.android.vo.safe.TokenItem + +private const val FUZZY_SEARCH_TOKEN_SQL = + PREFIX_ASSET_ITEM + + """ + WHERE ae.balance > 0 + AND (a1.symbol LIKE '%' || ? || '%' ESCAPE '\' OR a1.name LIKE '%' || ? || '%' ESCAPE '\') + ORDER BY + a1.symbol = ? COLLATE NOCASE OR a1.name = ? COLLATE NOCASE DESC, + a1.price_usd*ae.balance DESC + """ + +private const val FUZZY_SEARCH_USER_SQL = + """ + SELECT * FROM users + WHERE user_id != ? + AND relationship = 'FRIEND' + AND identity_number != '0' + AND (full_name LIKE '%' || ? || '%' ESCAPE '\' OR identity_number like '%' || ? || '%' ESCAPE '\' OR phone like '%' || ? || '%' ESCAPE '\') + ORDER BY + full_name = ? COLLATE NOCASE OR identity_number = ? COLLATE NOCASE DESC + """ + +private const val FUZZY_SEARCH_BOTS_SQL = + """ + SELECT * FROM users + WHERE app_id IS NOT NULL + AND user_id != ? + AND relationship = 'FRIEND' + AND identity_number != '0' + AND (full_name LIKE '%' || ? || '%' ESCAPE '\' OR identity_number like '%' || ? || '%' ESCAPE '\') + ORDER BY + full_name = ? COLLATE NOCASE OR identity_number = ? COLLATE NOCASE DESC + """ + +private const val FUZZY_MARKETS_SQL = + """ + SELECT * + FROM markets + WHERE symbol LIKE '%' || ? || '%' ESCAPE '\' + OR name LIKE '%' || ? || '%' ESCAPE '\' + ORDER BY + CASE + WHEN symbol LIKE ? || '%' THEN 1 + WHEN name LIKE ? || '%' THEN 1 + ELSE 2 + END, + CAST(market_cap_rank AS INTEGER) ASC, + symbol ASC, + name ASC; + """ + +private const val FUZZY_INSCRIPTION_SQL = + """ + SELECT `i`.`collection_hash`, `i`.`inscription_hash`, `i`.`sequence`, `i`.`content_type`, `i`.`content_url`, `ic`.`collection_hash`, `ic`.`name`, `ic`.`icon_url` FROM outputs o + LEFT JOIN inscription_items i ON i.inscription_hash == o.inscription_hash + LEFT JOIN inscription_collections ic on ic.collection_hash = i.collection_hash + WHERE i.inscription_hash IS NOT NULL AND o.state = 'unspent' AND (`ic`.name LIKE '%' || ? || '%' ESCAPE '\') + """ + +private const val FUZZY_SEARCH_CHAT_SQL = + """ + SELECT c.conversation_id AS conversationId, c.icon_url AS groupIconUrl, c.category AS category, c.name AS groupName, + ou.identity_number AS ownerIdentityNumber, c.owner_id AS userId, ou.full_name AS fullName, ou.avatar_url AS avatarUrl, + ou.is_verified AS isVerified, ou.app_id AS appId, ou.mute_until AS ownerMuteUntil, c.mute_until AS muteUntil, + c.pin_time AS pinTime, ou.membership AS membership + FROM conversations c + INNER JOIN users ou ON ou.user_id = c.owner_id + LEFT JOIN messages m ON c.last_message_id = m.id + WHERE (c.category = 'GROUP' AND c.name LIKE '%' || ? || '%' ESCAPE '\') + OR (c.category = 'CONTACT' AND ou.relationship != 'FRIEND' + AND (ou.full_name LIKE '%' || ? || '%' ESCAPE '\' + OR ou.identity_number like '%' || ? || '%' ESCAPE '\')) + ORDER BY + (c.category = 'GROUP' AND c.name = ? COLLATE NOCASE) + OR (c.category = 'CONTACT' AND ou.relationship != 'FRIEND' + AND (ou.full_name = ? COLLATE NOCASE + OR ou.identity_number = ? COLLATE NOCASE)) DESC, + c.pin_time DESC, + m.created_at DESC + """ + +private const val FUZZY_SEARCH_MESSAGE_SQL = + """ + SELECT m.conversation_id AS conversationId, c.icon_url AS conversationAvatarUrl, + c.name AS conversationName, c.category AS conversationCategory, 0 as messageCount, + u.user_id AS userId, u.app_id AS appId, u.avatar_url AS userAvatarUrl, u.identity_number AS userIdentityNumber, + u.full_name AS userFullName, u.is_verified as isVerified, u.membership AS membership + FROM messages m + INNER JOIN conversations c ON c.conversation_id = m.conversation_id + INNER JOIN users u ON c.owner_id = u.user_id + WHERE m.id IN ({{ids}}) + ORDER BY m.created_at DESC + """ + +private const val OBSERVE_CONVERSATIONS_COUNT_SQL = + "SELECT count(1) FROM conversations c INNER JOIN users ou ON ou.user_id = c.owner_id WHERE c.category IS NOT NULL" + +private const val OBSERVE_CONVERSATIONS_OFFSET_SQL = + "SELECT c.rowid FROM conversations c INNER JOIN users ou ON ou.user_id = c.owner_id ORDER BY c.pin_time DESC, c.last_message_created_at DESC LIMIT ? OFFSET ?" + +private const val OBSERVE_CONVERSATIONS_QUERY_SQL = + ConversationDao.PREFIX_CONVERSATION_ITEM + + " WHERE c.rowid IN ({{ids}}) ORDER BY c.pin_time DESC, c.last_message_created_at DESC" + +private const val OBSERVE_CONVERSATIONS_BY_CIRCLE_PREFIX_SQL = + """ + SELECT c.conversation_id AS conversationId, c.icon_url AS groupIconUrl, c.category AS category, + c.name AS groupName, c.status AS status, c.last_read_message_id AS lastReadMessageId, + c.unseen_message_count AS unseenMessageCount, c.owner_id AS ownerId, cc.pin_time AS pinTime, c.mute_until AS muteUntil, + ou.avatar_url AS avatarUrl, ou.full_name AS name, ou.is_verified AS ownerVerified, ou.identity_number AS ownerIdentityNumber, + ou.mute_until AS ownerMuteUntil, ou.app_id AS appId, + m.content AS content, m.category AS contentType, m.created_at AS createdAt, + m.user_id AS senderId, m.`action` AS actionName, m.status AS messageStatus, + mu.full_name AS senderFullName, + pu.full_name AS participantFullName, pu.user_id AS participantUserId, + (SELECT count(1) FROM message_mentions me WHERE me.conversation_id = c.conversation_id AND me.has_read = 0) AS mentionCount, + mm.mentions AS mentions, ou.membership AS membership + FROM circle_conversations cc + INNER JOIN conversations c ON cc.conversation_id = c.conversation_id + INNER JOIN circles ci ON ci.circle_id = cc.circle_id + INNER JOIN users ou ON ou.user_id = c.owner_id + LEFT JOIN messages m ON c.last_message_id = m.id + LEFT JOIN message_mentions mm ON mm.message_id = m.id + LEFT JOIN users mu ON mu.user_id = m.user_id + LEFT JOIN users pu ON pu.user_id = m.participant_id + """ + +private const val OBSERVE_CONVERSATIONS_BY_CIRCLE_COUNT_SQL = + """ + SELECT count(1) FROM circle_conversations cc + INNER JOIN circles ci ON ci.circle_id = cc.circle_id + INNER JOIN conversations c ON cc.conversation_id = c.conversation_id + INNER JOIN users ou ON ou.user_id = c.owner_id + WHERE c.category IS NOT NULL AND cc.circle_id = '{{circleId}}' + """ + +private const val OBSERVE_CONVERSATIONS_BY_CIRCLE_OFFSET_SQL = + """ + SELECT cc.rowid FROM circle_conversations cc + INNER JOIN conversations c ON cc.conversation_id = c.conversation_id + INNER JOIN circles ci ON ci.circle_id = cc.circle_id + INNER JOIN users ou ON ou.user_id = c.owner_id + LEFT JOIN messages m ON c.last_message_id = m.id + WHERE c.category IS NOT NULL AND cc.circle_id = '{{circleId}}' + ORDER BY cc.pin_time DESC, + CASE + WHEN m.created_at is NULL THEN c.created_at + ELSE m.created_at + END + DESC + LIMIT ? OFFSET ? + """ + +private const val OBSERVE_CONVERSATIONS_BY_CIRCLE_QUERY_SQL = + OBSERVE_CONVERSATIONS_BY_CIRCLE_PREFIX_SQL + + """ + WHERE cc.rowid IN ({{ids}}) + ORDER BY cc.pin_time DESC, + CASE + WHEN m.created_at is NULL THEN c.created_at + ELSE m.created_at + END + DESC + """ + +private const val PIN_MESSAGES_SQL = + """ + SELECT m.id AS messageId, m.conversation_id AS conversationId, u.user_id AS userId, + u.full_name AS userFullName, u.identity_number AS userIdentityNumber, u.app_id AS appId, m.category AS type, + m.content AS content, m.created_at AS createdAt, m.status AS status, m.media_status AS mediaStatus, m.media_waveform AS mediaWaveform, + m.name AS mediaName, m.media_mime_type AS mediaMimeType, m.media_size AS mediaSize, m.media_width AS mediaWidth, m.media_height AS mediaHeight, + m.thumb_image AS thumbImage, m.thumb_url AS thumbUrl, m.media_url AS mediaUrl, m.media_duration AS mediaDuration, m.quote_message_id as quoteId, + m.quote_content as quoteContent, m.caption as caption, u1.full_name AS participantFullName, m.action AS actionName, u1.user_id AS participantUserId, + s.snapshot_id AS snapshotId, s.type AS snapshotType, s.amount AS snapshotAmount, a.symbol AS assetSymbol, s.asset_id AS assetId, + a.icon_url AS assetIcon, st.asset_url AS assetUrl, st.asset_width AS assetWidth, st.asset_height AS assetHeight, st.sticker_id AS stickerId, + st.name AS assetName, st.asset_type AS assetType, h.site_name AS siteName, h.site_title AS siteTitle, h.site_description AS siteDescription, + h.site_image AS siteImage, m.shared_user_id AS sharedUserId, su.full_name AS sharedUserFullName, su.identity_number AS sharedUserIdentityNumber, + su.avatar_url AS sharedUserAvatarUrl, su.is_verified AS sharedUserIsVerified, su.app_id AS sharedUserAppId, mm.mentions AS mentions, + su.membership AS sharedMembership, u.membership AS membership + FROM pin_messages pm + LEFT JOIN messages m ON m.id = pm.message_id + LEFT JOIN users u ON m.user_id = u.user_id + LEFT JOIN users u1 ON m.participant_id = u1.user_id + LEFT JOIN snapshots s ON m.snapshot_id = s.snapshot_id + LEFT JOIN assets a ON s.asset_id = a.asset_id + LEFT JOIN stickers st ON st.sticker_id = m.sticker_id + LEFT JOIN hyperlinks h ON m.hyperlink = h.hyperlink + LEFT JOIN users su ON m.shared_user_id = su.user_id + LEFT JOIN conversations c ON m.conversation_id = c.conversation_id + LEFT JOIN message_mentions mm ON m.id = mm.message_id + WHERE m.conversation_id = ? + ORDER BY m.created_at ASC + """ + +@GeneratedQueryProvider(generatedName = "DataProviderGenerated") +interface DataProviderQuerySpec { + @GeneratedLimitOffsetDataSourceQuery( + countSql = OBSERVE_CONVERSATIONS_COUNT_SQL, + offsetSql = OBSERVE_CONVERSATIONS_OFFSET_SQL, + querySql = OBSERVE_CONVERSATIONS_QUERY_SQL, + tables = ["message_mentions", "conversations", "users"], + converter = "convertToConversationItems", + ) + fun observeConversations(database: MixinDatabase): DataSource.Factory + + @GeneratedLimitOffsetDataSourceQuery( + countSql = OBSERVE_CONVERSATIONS_BY_CIRCLE_COUNT_SQL, + offsetSql = OBSERVE_CONVERSATIONS_BY_CIRCLE_OFFSET_SQL, + querySql = OBSERVE_CONVERSATIONS_BY_CIRCLE_QUERY_SQL, + tables = ["message_mentions", "circle_conversations", "conversations", "circles", "users"], + converter = "convertToConversationItems", + ) + fun observeConversationsByCircleId( + circleId: String, + database: MixinDatabase, + ): DataSource.Factory + + @GeneratedNoCountDataSourceQuery( + sql = PIN_MESSAGES_SQL, + binds = ["conversationId"], + count = "count", + tables = ["pin_messages", "messages", "users", "snapshots", "assets", "stickers", "hyperlinks", "conversations", "message_mentions"], + converter = "convertChatHistoryMessageItem", + ) + fun getPinMessages( + database: MixinDatabase, + conversationId: String, + count: Int, + ): DataSource.Factory + + @GeneratedQuery( + sql = FUZZY_SEARCH_TOKEN_SQL, + binds = ["symbol", "name", "symbol", "name"], + callable = "callableTokenItem", + ) + suspend fun fuzzySearchToken( + name: String?, + symbol: String?, + db: MixinDatabase, + cancellationSignal: CancellationSignal, + ): List + + @GeneratedQuery( + sql = FUZZY_SEARCH_USER_SQL, + binds = ["id", "username", "identityNumber", "phone", "username", "identityNumber"], + callable = "callableUser", + ) + suspend fun fuzzySearchUser( + username: String?, + identityNumber: String?, + phone: String?, + id: String?, + db: MixinDatabase, + cancellationSignal: CancellationSignal, + ): List + + @GeneratedQuery( + sql = FUZZY_SEARCH_BOTS_SQL, + binds = ["id", "username", "identityNumber", "username", "identityNumber"], + callable = "callableBot", + ) + suspend fun fuzzySearchBots( + username: String?, + identityNumber: String?, + id: String?, + db: MixinDatabase, + cancellationSignal: CancellationSignal, + ): List + + @GeneratedQuery( + sql = FUZZY_MARKETS_SQL, + binds = ["keyword", "keyword"], + callable = "callableMarket", + ) + suspend fun fuzzyMarkets( + keyword: String, + db: MixinDatabase, + cancellationSignal: CancellationSignal, + ): List + + @GeneratedQuery( + sql = FUZZY_INSCRIPTION_SQL, + binds = ["keyword"], + callable = "callableSafeInscription", + ) + suspend fun fuzzyInscription( + keyword: String?, + db: MixinDatabase, + cancellationSignal: CancellationSignal, + ): List + + @GeneratedQuery( + sql = FUZZY_SEARCH_CHAT_SQL, + binds = ["query", "query", "query", "query", "query", "query"], + callable = "callableChatMinimal", + ) + suspend fun fuzzySearchChat( + query: String?, + db: MixinDatabase, + cancellationSignal: CancellationSignal, + ): List + + @GeneratedRawCursorQuery( + sql = FUZZY_SEARCH_MESSAGE_SQL, + binds = [], + converter = "convertToSearchMessageItems", + ) + fun fuzzySearchMessageItems( + db: MixinDatabase, + ids: String, + ): List +} diff --git a/app/src/main/java/one/mixin/android/db/provider/LimitOrderDataProvider.kt b/app/src/main/java/one/mixin/android/db/provider/LimitOrderDataProvider.kt index cf628b70f6..6982c6214d 100644 --- a/app/src/main/java/one/mixin/android/db/provider/LimitOrderDataProvider.kt +++ b/app/src/main/java/one/mixin/android/db/provider/LimitOrderDataProvider.kt @@ -1,248 +1,82 @@ package one.mixin.android.db.provider -import android.annotation.SuppressLint import android.database.Cursor import androidx.paging.PagingSource -import androidx.paging.PagingState -import androidx.room.InvalidationTracker -import androidx.room.RoomSQLiteQuery -import androidx.room.paging.util.INITIAL_ITEM_COUNT -import androidx.room.paging.util.INVALID -import androidx.room.paging.util.getClippedRefreshKey -import androidx.room.paging.util.getLimit -import androidx.room.paging.util.getOffset -import androidx.room.withTransaction -import kotlinx.coroutines.asCoroutineDispatcher -import kotlinx.coroutines.withContext import one.mixin.android.db.WalletDatabase import one.mixin.android.ui.wallet.OrderFilterParams import one.mixin.android.vo.route.OrderItem -import java.util.concurrent.atomic.AtomicInteger -@SuppressLint("RestrictedApi") class LimitOrderDataProvider { companion object { fun allOrders( database: WalletDatabase, filter: OrderFilterParams, ): PagingSource { - val baseSelect = """ - SELECT DISTINCT - o.order_id, - o.wallet_id, - o.user_id, - o.pay_asset_id, - t.icon_url AS asset_icon_url, - t.symbol AS asset_symbol, - o.receive_asset_id, - rt.icon_url AS receive_asset_icon_url, - rt.symbol AS receive_asset_symbol, - o.pay_amount, - o.receive_amount, - o.state, - o.order_type, - pc.name AS pay_chain_name, - rc.name AS receive_chain_name, - o.created_at, - o.expected_receive_amount, - o.filled_receive_amount, - o.price, - o.expired_at, - o.pending_amount, - rt.chain_id AS receive_chain_id, - t.chain_id AS pay_chain_id - FROM orders o - LEFT JOIN tokens t ON o.pay_asset_id = t.asset_id - LEFT JOIN tokens rt ON o.receive_asset_id = rt.asset_id - LEFT JOIN chains pc ON t.chain_id = pc.chain_id - LEFT JOIN chains rc ON rt.chain_id = rc.chain_id - """.trimIndent() - - val query = filter.buildQuery() - - val whereOrderSql = query.sql.substringAfter("FROM orders o") - val whereBody = whereOrderSql.substringAfter("WHERE ", missingDelimiterValue = "").substringBefore("ORDER BY", missingDelimiterValue = "").trim() - val orderByBody = whereOrderSql.substringAfter("ORDER BY", missingDelimiterValue = "").trim() - - val countSql = "SELECT COUNT(DISTINCT o.rowid) FROM orders o $whereOrderSql" - - val offsetSql = """ - SELECT DISTINCT o.rowid FROM orders o - $whereOrderSql - LIMIT ? OFFSET ? - """.trimIndent() - - val querySqlGenerator = fun(ids: String): RoomSQLiteQuery { - val querySql = StringBuilder() - .append(baseSelect) - .append('\n') - .append("WHERE o.rowid IN ($ids)") - .apply { - if (whereBody.isNotEmpty()) { - append('\n').append("AND ").append(whereBody) - } - append('\n').append("ORDER BY ") - if (orderByBody.isNotEmpty()) { - append(orderByBody) - } else { - append("o.created_at DESC") - } - } - .toString() - return RoomSQLiteQuery.acquire(querySql, 0) - } - - return object : PagingSource() { - private val itemCount = AtomicInteger(INITIAL_ITEM_COUNT) - - private val observer = object : InvalidationTracker.Observer(arrayOf("orders")) { - override fun onInvalidated(tables: Set) { - invalidate() - } - } - - init { - database.invalidationTracker.addWeakObserver(observer) - } - - override suspend fun load(params: LoadParams): LoadResult { - return withContext(database.queryExecutor.asCoroutineDispatcher()) { - val tempCount = itemCount.get() - if (tempCount == INITIAL_ITEM_COUNT) { - database.withTransaction { - val count = countItems() - itemCount.set(count) - queryData(params, count) - } - } else { - val loadResult = queryData(params, tempCount) - database.invalidationTracker.refreshVersionsSync() - @Suppress("UNCHECKED_CAST") - if (invalid) INVALID as LoadResult.Invalid else loadResult - } - } - } - - private fun countItems(): Int { - val countStmt = RoomSQLiteQuery.acquire(countSql, 0) - val cursor = database.query(countStmt) - return try { - if (cursor.moveToFirst()) cursor.getInt(0) else 0 - } finally { - cursor.close() - countStmt.release() - } - } - - private fun queryData(params: LoadParams, itemCount: Int): LoadResult.Page { - val key = params.key ?: 0 - val limit = getLimit(params, key) - val offset = getOffset(params, key, itemCount) - - val offsetStmt = RoomSQLiteQuery.acquire(offsetSql, 2) - offsetStmt.bindLong(1, limit.toLong()) - offsetStmt.bindLong(2, offset.toLong()) - val offsetCursor = database.query(offsetStmt) - val ids = mutableListOf() - try { - while (offsetCursor.moveToNext()) { - ids.add("'${offsetCursor.getLong(0)}'") - } - } finally { - offsetCursor.close() - offsetStmt.release() - } - - val data = if (ids.isEmpty()) { - emptyList() - } else { - val sqLiteQuery = querySqlGenerator(ids.joinToString()) - val cursor = database.query(sqLiteQuery) - try { - convertRows(cursor) - } finally { - cursor.close() - sqLiteQuery.release() - } - } - - val nextPosToLoad = offset + data.size - val nextKey = if (ids.isEmpty() || ids.size < limit || nextPosToLoad >= itemCount) null else nextPosToLoad - val prevKey = if (offset <= 0 || ids.isEmpty()) null else offset - return LoadResult.Page( - data = data, - prevKey = prevKey, - nextKey = nextKey, - itemsBefore = offset, - itemsAfter = maxOf(0, itemCount - nextPosToLoad), - ) - } - - private fun convertRows(cursor: Cursor): List { - val list = ArrayList(cursor.count) - val idxOrderId = cursor.getColumnIndexOrThrow("order_id") - val idxWalletId = cursor.getColumnIndexOrThrow("wallet_id") - val idxUserId = cursor.getColumnIndexOrThrow("user_id") - val idxPayAssetId = cursor.getColumnIndexOrThrow("pay_asset_id") - val idxAssetIconUrl = cursor.getColumnIndexOrThrow("asset_icon_url") - val idxAssetSymbol = cursor.getColumnIndexOrThrow("asset_symbol") - val idxReceiveAssetId = cursor.getColumnIndexOrThrow("receive_asset_id") - val idxReceiveAssetIconUrl = cursor.getColumnIndexOrThrow("receive_asset_icon_url") - val idxReceiveAssetSymbol = cursor.getColumnIndexOrThrow("receive_asset_symbol") - val idxPayAmount = cursor.getColumnIndexOrThrow("pay_amount") - val idxReceiveAmount = cursor.getColumnIndexOrThrow("receive_amount") - val idxState = cursor.getColumnIndexOrThrow("state") - val idxOrderType = cursor.getColumnIndexOrThrow("order_type") - val idxPayChainName = cursor.getColumnIndexOrThrow("pay_chain_name") - val idxReceiveChainName = cursor.getColumnIndexOrThrow("receive_chain_name") - val idxCreatedAt = cursor.getColumnIndexOrThrow("created_at") - val idxExpectedReceiveAmount = cursor.getColumnIndexOrThrow("expected_receive_amount") - val idxFilledReceiveAmount = cursor.getColumnIndexOrThrow("filled_receive_amount") - val idxPrice = cursor.getColumnIndexOrThrow("price") - val idxExpiredAt = cursor.getColumnIndexOrThrow("expired_at") - val idxPendingAmount = cursor.getColumnIndexOrThrow("pending_amount") - val idxReceiveChainId = cursor.getColumnIndexOrThrow("receive_chain_id") - val idxPayChainId = cursor.getColumnIndexOrThrow("pay_chain_id") - - while (cursor.moveToNext()) { - list.add( - OrderItem( - orderId = cursor.getString(idxOrderId), - walletId = cursor.getString(idxWalletId), - userId = cursor.getString(idxUserId), - payAssetId = cursor.getString(idxPayAssetId), - payChainId = cursor.getString(idxPayChainId), - assetIconUrl = cursor.getString(idxAssetIconUrl), - assetSymbol = cursor.getString(idxAssetSymbol), - receiveAssetId = cursor.getString(idxReceiveAssetId), - receiveChainId = cursor.getString(idxReceiveChainId), - receiveAssetIconUrl = cursor.getString(idxReceiveAssetIconUrl), - receiveAssetSymbol = cursor.getString(idxReceiveAssetSymbol), - payAmount = cursor.getString(idxPayAmount), - receiveAmount = cursor.getString(idxReceiveAmount), - state = cursor.getString(idxState), - type = cursor.getString(idxOrderType), - payChainName = cursor.getString(idxPayChainName), - receiveChainName = cursor.getString(idxReceiveChainName), - createdAt = cursor.getString(idxCreatedAt), - expectedReceiveAmount = cursor.getString(idxExpectedReceiveAmount), - filledReceiveAmount = cursor.getString(idxFilledReceiveAmount), - price = cursor.getString(idxPrice), - expiredAt = cursor.getString(idxExpiredAt), - pendingAmount = cursor.getString(idxPendingAmount), - ) - ) - } - return list - } - - override fun getRefreshKey(state: PagingState): Int? { - return state.getClippedRefreshKey() - } - - override val jumpingSupported: Boolean - get() = true - } + val parts = filter.buildQueryParts() + return LimitOrderDataProviderGenerated.allOrders( + database, + parts.whereOrderSql, + parts.whereClauseSql, + parts.orderBySql, + ) } } } + +fun convertToOrderItems(cursor: Cursor): List { + val list = ArrayList(cursor.count) + val idxOrderId = cursor.getColumnIndexOrThrow("order_id") + val idxWalletId = cursor.getColumnIndexOrThrow("wallet_id") + val idxUserId = cursor.getColumnIndexOrThrow("user_id") + val idxPayAssetId = cursor.getColumnIndexOrThrow("pay_asset_id") + val idxAssetIconUrl = cursor.getColumnIndexOrThrow("asset_icon_url") + val idxAssetSymbol = cursor.getColumnIndexOrThrow("asset_symbol") + val idxReceiveAssetId = cursor.getColumnIndexOrThrow("receive_asset_id") + val idxReceiveAssetIconUrl = cursor.getColumnIndexOrThrow("receive_asset_icon_url") + val idxReceiveAssetSymbol = cursor.getColumnIndexOrThrow("receive_asset_symbol") + val idxPayAmount = cursor.getColumnIndexOrThrow("pay_amount") + val idxReceiveAmount = cursor.getColumnIndexOrThrow("receive_amount") + val idxState = cursor.getColumnIndexOrThrow("state") + val idxOrderType = cursor.getColumnIndexOrThrow("order_type") + val idxPayChainName = cursor.getColumnIndexOrThrow("pay_chain_name") + val idxReceiveChainName = cursor.getColumnIndexOrThrow("receive_chain_name") + val idxCreatedAt = cursor.getColumnIndexOrThrow("created_at") + val idxExpectedReceiveAmount = cursor.getColumnIndexOrThrow("expected_receive_amount") + val idxFilledReceiveAmount = cursor.getColumnIndexOrThrow("filled_receive_amount") + val idxPrice = cursor.getColumnIndexOrThrow("price") + val idxExpiredAt = cursor.getColumnIndexOrThrow("expired_at") + val idxPendingAmount = cursor.getColumnIndexOrThrow("pending_amount") + val idxReceiveChainId = cursor.getColumnIndexOrThrow("receive_chain_id") + val idxPayChainId = cursor.getColumnIndexOrThrow("pay_chain_id") + + while (cursor.moveToNext()) { + list.add( + OrderItem( + orderId = cursor.getString(idxOrderId), + walletId = cursor.getString(idxWalletId), + userId = cursor.getString(idxUserId), + payAssetId = cursor.getString(idxPayAssetId), + payChainId = cursor.getString(idxPayChainId), + assetIconUrl = cursor.getString(idxAssetIconUrl), + assetSymbol = cursor.getString(idxAssetSymbol), + receiveAssetId = cursor.getString(idxReceiveAssetId), + receiveChainId = cursor.getString(idxReceiveChainId), + receiveAssetIconUrl = cursor.getString(idxReceiveAssetIconUrl), + receiveAssetSymbol = cursor.getString(idxReceiveAssetSymbol), + payAmount = cursor.getString(idxPayAmount), + receiveAmount = cursor.getString(idxReceiveAmount), + state = cursor.getString(idxState), + type = cursor.getString(idxOrderType), + payChainName = cursor.getString(idxPayChainName), + receiveChainName = cursor.getString(idxReceiveChainName), + createdAt = cursor.getString(idxCreatedAt), + expectedReceiveAmount = cursor.getString(idxExpectedReceiveAmount), + filledReceiveAmount = cursor.getString(idxFilledReceiveAmount), + price = cursor.getString(idxPrice), + expiredAt = cursor.getString(idxExpiredAt), + pendingAmount = cursor.getString(idxPendingAmount), + ) + ) + } + return list +} diff --git a/app/src/main/java/one/mixin/android/db/provider/LimitOrderDataProviderQuerySpec.kt b/app/src/main/java/one/mixin/android/db/provider/LimitOrderDataProviderQuerySpec.kt new file mode 100644 index 0000000000..3c8494881d --- /dev/null +++ b/app/src/main/java/one/mixin/android/db/provider/LimitOrderDataProviderQuerySpec.kt @@ -0,0 +1,75 @@ +package one.mixin.android.db.provider + +import androidx.paging.PagingSource +import one.mixin.android.codegen.annotation.GeneratedPagingSourceQuery +import one.mixin.android.codegen.annotation.GeneratedQueryProvider +import one.mixin.android.db.WalletDatabase +import one.mixin.android.vo.route.OrderItem + +private const val ORDER_ITEM_SELECT_SQL = + """ + SELECT DISTINCT + o.order_id, + o.wallet_id, + o.user_id, + o.pay_asset_id, + t.icon_url AS asset_icon_url, + t.symbol AS asset_symbol, + o.receive_asset_id, + rt.icon_url AS receive_asset_icon_url, + rt.symbol AS receive_asset_symbol, + o.pay_amount, + o.receive_amount, + o.state, + o.order_type, + pc.name AS pay_chain_name, + rc.name AS receive_chain_name, + o.created_at, + o.expected_receive_amount, + o.filled_receive_amount, + o.price, + o.expired_at, + o.pending_amount, + rt.chain_id AS receive_chain_id, + t.chain_id AS pay_chain_id + FROM orders o + LEFT JOIN tokens t ON o.pay_asset_id = t.asset_id + LEFT JOIN tokens rt ON o.receive_asset_id = rt.asset_id + LEFT JOIN chains pc ON t.chain_id = pc.chain_id + LEFT JOIN chains rc ON rt.chain_id = rc.chain_id + """ + +private const val ALL_ORDERS_COUNT_SQL = + "SELECT COUNT(DISTINCT o.rowid) FROM orders o {{whereOrderSql}}" + +private const val ALL_ORDERS_OFFSET_SQL = + """ + SELECT DISTINCT o.rowid FROM orders o + {{whereOrderSql}} + LIMIT ? OFFSET ? + """ + +private const val ALL_ORDERS_QUERY_SQL = + ORDER_ITEM_SELECT_SQL + + """ + WHERE o.rowid IN ({{ids}}) + {{whereClauseSql}} + ORDER BY {{orderBySql}} + """ + +@GeneratedQueryProvider(generatedName = "LimitOrderDataProviderGenerated") +interface LimitOrderDataProviderQuerySpec { + @GeneratedPagingSourceQuery( + countSql = ALL_ORDERS_COUNT_SQL, + offsetSql = ALL_ORDERS_OFFSET_SQL, + querySql = ALL_ORDERS_QUERY_SQL, + tables = ["orders"], + converter = "convertToOrderItems", + ) + fun allOrders( + database: WalletDatabase, + whereOrderSql: String, + whereClauseSql: String, + orderBySql: String, + ): PagingSource +} diff --git a/app/src/main/java/one/mixin/android/fts/FtsDataSource.kt b/app/src/main/java/one/mixin/android/fts/FtsDataSource.kt index 7b8809472a..6ce25305ec 100644 --- a/app/src/main/java/one/mixin/android/fts/FtsDataSource.kt +++ b/app/src/main/java/one/mixin/android/fts/FtsDataSource.kt @@ -4,7 +4,6 @@ import android.os.CancellationSignal import android.util.ArrayMap import androidx.core.database.getStringOrNull import androidx.paging.ItemKeyedDataSource -import androidx.sqlite.db.SimpleSQLiteQuery import one.mixin.android.db.MixinDatabase import one.mixin.android.vo.SearchMessageDetailItem import timber.log.Timber @@ -72,9 +71,7 @@ class FtsDataSource( private val newFtsCursor by lazy { ftsDatabase.query( - SimpleSQLiteQuery( - "SELECT message_id FROM messages_metas WHERE conversation_id = '$conversationId' AND doc_id IN (SELECT docid FROM messages_fts WHERE content MATCH '$query') ORDER BY created_at DESC, rowid DESC", - ), + FtsQueryGenerated.messageIdsByConversation(conversationId, query), cancellationSignal, ) } diff --git a/app/src/main/java/one/mixin/android/fts/FtsDatabaseExtension.kt b/app/src/main/java/one/mixin/android/fts/FtsDatabaseExtension.kt index 81ae786a3e..76d24b67ab 100644 --- a/app/src/main/java/one/mixin/android/fts/FtsDatabaseExtension.kt +++ b/app/src/main/java/one/mixin/android/fts/FtsDatabaseExtension.kt @@ -2,7 +2,6 @@ package one.mixin.android.fts import android.os.CancellationSignal import androidx.core.database.getStringOrNull -import androidx.sqlite.db.SimpleSQLiteQuery import kotlinx.coroutines.runBlocking import kotlinx.coroutines.withContext import one.mixin.android.extension.createAtToLong @@ -107,14 +106,7 @@ fun FtsDatabase.rawSearch( return try { // A maximum of 999 search results are returned query( - SimpleSQLiteQuery( - """ - SELECT message_id, conversation_id, user_id, count(message_id) FROM messages_metas WHERE doc_id IN (SELECT docid FROM messages_fts WHERE content MATCH '$content') - GROUP BY conversation_id - ORDER BY max(created_at) DESC - LIMIT 999 - """, - ), + FtsQueryGenerated.rawSearch(content), cancellationSignal, ).use { val results = mutableListOf() diff --git a/app/src/main/java/one/mixin/android/fts/FtsQuerySpec.kt b/app/src/main/java/one/mixin/android/fts/FtsQuerySpec.kt new file mode 100644 index 0000000000..8148c36139 --- /dev/null +++ b/app/src/main/java/one/mixin/android/fts/FtsQuerySpec.kt @@ -0,0 +1,34 @@ +package one.mixin.android.fts + +import androidx.sqlite.db.SimpleSQLiteQuery +import one.mixin.android.codegen.annotation.GeneratedQueryProvider +import one.mixin.android.codegen.annotation.GeneratedSimpleSQLiteQuery + +@GeneratedQueryProvider(generatedName = "FtsQueryGenerated") +interface FtsQuerySpec { + @GeneratedSimpleSQLiteQuery( + sql = """ + SELECT message_id, conversation_id, user_id, count(message_id) + FROM messages_metas + WHERE doc_id IN (SELECT docid FROM messages_fts WHERE content MATCH '{{content}}') + GROUP BY conversation_id + ORDER BY max(created_at) DESC + LIMIT 999 + """, + ) + fun rawSearch(content: String): SimpleSQLiteQuery + + @GeneratedSimpleSQLiteQuery( + sql = """ + SELECT message_id + FROM messages_metas + WHERE conversation_id = '{{conversationId}}' + AND doc_id IN (SELECT docid FROM messages_fts WHERE content MATCH '{{query}}') + ORDER BY created_at DESC, rowid DESC + """, + ) + fun messageIdsByConversation( + conversationId: String, + query: String, + ): SimpleSQLiteQuery +} diff --git a/app/src/main/java/one/mixin/android/ui/conversation/ConversationViewModel.kt b/app/src/main/java/one/mixin/android/ui/conversation/ConversationViewModel.kt index 18d93bf2ff..25c3cc3575 100644 --- a/app/src/main/java/one/mixin/android/ui/conversation/ConversationViewModel.kt +++ b/app/src/main/java/one/mixin/android/ui/conversation/ConversationViewModel.kt @@ -28,6 +28,7 @@ import one.mixin.android.api.request.ParticipantRequest import one.mixin.android.api.request.RelationshipRequest import one.mixin.android.api.request.StickerAddRequest import one.mixin.android.db.MixinDatabase +import one.mixin.android.db.fetcher.MessageFetcher import one.mixin.android.extension.copyFromInputStream import one.mixin.android.extension.createAudioTemp import one.mixin.android.extension.deserialize @@ -118,10 +119,11 @@ class ConversationViewModel private val userRepository: UserRepository, private val jobManager: MixinJobManager, private val tokenRepository: TokenRepository, - private val accountRepository: AccountRepository, - private val messenger: SendMessageHelper, - private val cleanMessageHelper: CleanMessageHelper, - ) : ViewModel() { + private val accountRepository: AccountRepository, + private val messenger: SendMessageHelper, + private val cleanMessageHelper: CleanMessageHelper, + private val messageFetcher: MessageFetcher, +) : ViewModel() { suspend fun indexUnread(conversationId: String) = conversationRepository.indexUnread(conversationId) ?: 0 @@ -614,13 +616,28 @@ class ConversationViewModel jobManager.addJobInBackground(RefreshStickerAlbumJob()) } - suspend fun findMessageIndex( - conversationId: String, - messageId: String, - ) = - conversationRepository.findMessageIndex(conversationId, messageId) + suspend fun findMessageIndex( + conversationId: String, + messageId: String, + ) = + conversationRepository.findMessageIndex(conversationId, messageId) + + suspend fun initMessagesAtDate( + conversationId: String, + createdAt: String, + ) = messageFetcher.initMessagesAtDate(conversationId, createdAt) + + suspend fun initMessagesAtPosition( + conversationId: String, + index: Int, + ) = messageFetcher.initMessagesAtPosition(conversationId, index) + + suspend fun initMessagesAtPercent( + conversationId: String, + percent: Float, + ) = messageFetcher.initMessagesAtPercent(conversationId, percent) - private fun createReadSessionMessage( + private fun createReadSessionMessage( list: List, conversationId: String, ) { diff --git a/app/src/main/java/one/mixin/android/ui/wallet/FilterParams.kt b/app/src/main/java/one/mixin/android/ui/wallet/FilterParams.kt index 18c908d16f..99fc03fee3 100644 --- a/app/src/main/java/one/mixin/android/ui/wallet/FilterParams.kt +++ b/app/src/main/java/one/mixin/android/ui/wallet/FilterParams.kt @@ -2,7 +2,6 @@ package one.mixin.android.ui.wallet import androidx.sqlite.db.SimpleSQLiteQuery import one.mixin.android.R -import one.mixin.android.db.SafeSnapshotDao.Companion.SNAPSHOT_ITEM_PREFIX import one.mixin.android.tip.wc.SortOrder import one.mixin.android.vo.AddressItem import one.mixin.android.vo.Recipient @@ -136,6 +135,6 @@ class FilterParams( else -> "" } - return SimpleSQLiteQuery("$SNAPSHOT_ITEM_PREFIX $whereSql $orderSql") + return WalletFilterQueryGenerated.snapshots(whereSql, orderSql) } } diff --git a/app/src/main/java/one/mixin/android/ui/wallet/OrderFilterParams.kt b/app/src/main/java/one/mixin/android/ui/wallet/OrderFilterParams.kt index 6c8c9b0ddc..bba2374d0d 100644 --- a/app/src/main/java/one/mixin/android/ui/wallet/OrderFilterParams.kt +++ b/app/src/main/java/one/mixin/android/ui/wallet/OrderFilterParams.kt @@ -5,6 +5,30 @@ import one.mixin.android.db.web3.vo.Web3TokenItem import one.mixin.android.tip.wc.SortOrder import org.threeten.bp.Instant +internal data class OrderQueryParts( + val whereSql: String, + val orderSql: String, +) { + val whereOrderSql: String + get() = "$whereSql $orderSql".trim() + + val whereClauseSql: String + get() = + whereSql + .removePrefix("WHERE") + .trim() + .takeIf { it.isNotEmpty() } + ?.let { "AND $it" } + .orEmpty() + + val orderBySql: String + get() = + orderSql + .removePrefix("ORDER BY") + .trim() + .ifEmpty { "o.created_at DESC" } +} + class OrderFilterParams( var order: SortOrder = SortOrder.Recent, var tokenItems: List? = null, @@ -20,6 +44,11 @@ class OrderFilterParams( } fun buildQuery(): SimpleSQLiteQuery { + val parts = buildQueryParts() + return WalletFilterQueryGenerated.orders(parts.whereSql, parts.orderSql) + } + + internal fun buildQueryParts(): OrderQueryParts { val filters = mutableListOf() tokenItems?.let { if (it.isNotEmpty()) { @@ -63,7 +92,6 @@ class OrderFilterParams( SortOrder.Oldest -> "ORDER BY o.created_at ASC" else -> "ORDER BY o.created_at DESC" } - val sql = "SELECT * FROM orders o $whereSql $orderSql" - return SimpleSQLiteQuery(sql) + return OrderQueryParts(whereSql, orderSql) } } diff --git a/app/src/main/java/one/mixin/android/ui/wallet/WalletFilterQuerySpec.kt b/app/src/main/java/one/mixin/android/ui/wallet/WalletFilterQuerySpec.kt new file mode 100644 index 0000000000..dd189de0a2 --- /dev/null +++ b/app/src/main/java/one/mixin/android/ui/wallet/WalletFilterQuerySpec.kt @@ -0,0 +1,52 @@ +package one.mixin.android.ui.wallet + +import androidx.sqlite.db.SimpleSQLiteQuery +import one.mixin.android.codegen.annotation.GeneratedQueryProvider +import one.mixin.android.codegen.annotation.GeneratedSimpleSQLiteQuery +import one.mixin.android.db.SafeSnapshotDao.Companion.SNAPSHOT_ITEM_PREFIX + +private const val WEB3_TRANSACTION_QUERY_SQL = + """ + SELECT DISTINCT w.transaction_hash, w.transaction_type, w.status, w.block_number, w.chain_id, + w.address, w.fee, w.senders, w.receivers, w.approvals, w.send_asset_id, w.receive_asset_id, + w.transaction_at, w.updated_at, w.level, + c.symbol as chain_symbol, + c.icon_url as chain_icon_url, + s.icon_url as send_asset_icon_url, + s.symbol as send_asset_symbol, + r.icon_url as receive_asset_icon_url, + r.symbol as receive_asset_symbol + FROM transactions w + LEFT JOIN tokens c ON c.asset_id = w.chain_id AND c.wallet_id = '{{walletId}}' + LEFT JOIN tokens s ON s.asset_id = w.send_asset_id AND s.wallet_id = '{{walletId}}' + LEFT JOIN tokens r ON r.asset_id = w.receive_asset_id AND r.wallet_id = '{{walletId}}' + {{whereSql}} {{orderSql}} + """ + +@GeneratedQueryProvider(generatedName = "WalletFilterQueryGenerated") +interface WalletFilterQuerySpec { + @GeneratedSimpleSQLiteQuery( + sql = SNAPSHOT_ITEM_PREFIX + "{{whereSql}} {{orderSql}}", + ) + fun snapshots( + whereSql: String, + orderSql: String, + ): SimpleSQLiteQuery + + @GeneratedSimpleSQLiteQuery( + sql = WEB3_TRANSACTION_QUERY_SQL, + ) + fun web3Transactions( + whereSql: String, + orderSql: String, + walletId: String, + ): SimpleSQLiteQuery + + @GeneratedSimpleSQLiteQuery( + sql = "SELECT * FROM orders o {{whereSql}} {{orderSql}}", + ) + fun orders( + whereSql: String, + orderSql: String, + ): SimpleSQLiteQuery +} diff --git a/app/src/main/java/one/mixin/android/ui/wallet/Web3FilterParams.kt b/app/src/main/java/one/mixin/android/ui/wallet/Web3FilterParams.kt index fdff161011..cf3d70f7cb 100644 --- a/app/src/main/java/one/mixin/android/ui/wallet/Web3FilterParams.kt +++ b/app/src/main/java/one/mixin/android/ui/wallet/Web3FilterParams.kt @@ -105,21 +105,6 @@ class Web3FilterParams( else -> "" } - return SimpleSQLiteQuery( - "SELECT w.transaction_hash, w.transaction_type, w.status, w.block_number, w.chain_id, " + - "w.address, w.fee, w.senders, w.receivers, w.approvals, w.send_asset_id, w.receive_asset_id, " + - "w.transaction_at, w.updated_at, w.level, " + - "c.symbol as chain_symbol, " + - "c.icon_url as chain_icon_url, " + - "s.icon_url as send_asset_icon_url, " + - "s.symbol as send_asset_symbol, " + - "r.icon_url as receive_asset_icon_url, " + - "r.symbol as receive_asset_symbol " + - "FROM transactions w " + - "LEFT JOIN tokens c ON c.asset_id = w.chain_id AND c.wallet_id = '$walletId' " + - "LEFT JOIN tokens s ON s.asset_id = w.send_asset_id AND s.wallet_id = '$walletId' " + - "LEFT JOIN tokens r ON r.asset_id = w.receive_asset_id AND r.wallet_id = '$walletId' " + - "$whereSql $orderSql" - ) + return WalletFilterQueryGenerated.web3Transactions(whereSql, orderSql, walletId) } } diff --git a/app/src/test/java/one/mixin/android/db/fetcher/MessageFetcherAnchorTest.kt b/app/src/test/java/one/mixin/android/db/fetcher/MessageFetcherAnchorTest.kt new file mode 100644 index 0000000000..28caa21d0f --- /dev/null +++ b/app/src/test/java/one/mixin/android/db/fetcher/MessageFetcherAnchorTest.kt @@ -0,0 +1,163 @@ +package one.mixin.android.db.fetcher + +import android.content.Context +import androidx.room.Room +import androidx.test.core.app.ApplicationProvider +import kotlinx.coroutines.runBlocking +import one.mixin.android.db.MixinDatabase +import org.junit.After +import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue +import org.junit.Before +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner + +@RunWith(RobolectricTestRunner::class) +class MessageFetcherAnchorTest { + private lateinit var db: MixinDatabase + private lateinit var fetcher: MessageFetcher + + @Before + fun setUp() { + val context = ApplicationProvider.getApplicationContext() + db = Room.inMemoryDatabaseBuilder(context, MixinDatabase::class.java) + .allowMainThreadQueries() + .build() + fetcher = MessageFetcher(db) + insertUser() + insertConversation() + } + + @After + fun tearDown() { + db.close() + } + + @Test + fun initMessagesKeepsChronologicalNeighborsWhenRowIdAndCreatedAtDiffer() = runBlocking { + insertMessage(rowId = 3, messageId = "old", createdAt = "2024-01-01T00:00:00.000Z") + insertMessage(rowId = 2, messageId = "anchor", createdAt = "2024-01-02T00:00:00.000Z") + insertMessage(rowId = 1, messageId = "new", createdAt = "2024-01-03T00:00:00.000Z") + + val (position, data, unreadMessageId) = fetcher.initMessages(CONVERSATION_ID, "anchor") + + assertEquals("anchor", unreadMessageId) + assertEquals(1, position) + assertEquals(listOf("old", "anchor", "new"), data.map { it.messageId }) + } + + @Test + fun initMessagesUsesFirstUnreadMessageAsAnchor() = runBlocking { + insertMessage(rowId = 3, messageId = "old", createdAt = "2024-01-01T00:00:00.000Z") + insertMessage(rowId = 2, messageId = "unread", createdAt = "2024-01-02T00:00:00.000Z") + insertMessage(rowId = 1, messageId = "new", createdAt = "2024-01-03T00:00:00.000Z") + insertRemoteStatus("unread") + + val (position, data, unreadMessageId) = fetcher.initMessages(CONVERSATION_ID) + + assertEquals("unread", unreadMessageId) + assertEquals("unread", data[position].messageId) + assertEquals(listOf("old", "unread", "new"), data.map { it.messageId }) + } + + @Test + fun initMessagesAtDateUsesFirstMessageAtOrAfterDate() = runBlocking { + insertMessage(rowId = 3, messageId = "old", createdAt = "2024-01-01T00:00:00.000Z") + insertMessage(rowId = 2, messageId = "middle", createdAt = "2024-01-02T00:00:00.000Z") + insertMessage(rowId = 1, messageId = "new", createdAt = "2024-01-03T00:00:00.000Z") + + val (position, data, anchorMessageId) = fetcher.initMessagesAtDate(CONVERSATION_ID, "2024-01-02T12:00:00.000Z") + + assertEquals("new", anchorMessageId) + assertEquals("new", data[position].messageId) + } + + @Test + fun initMessagesAtDateFallsBackToLastMessageBeforeDate() = runBlocking { + insertMessage(rowId = 3, messageId = "old", createdAt = "2024-01-01T00:00:00.000Z") + insertMessage(rowId = 2, messageId = "middle", createdAt = "2024-01-02T00:00:00.000Z") + insertMessage(rowId = 1, messageId = "new", createdAt = "2024-01-03T00:00:00.000Z") + + val (position, data, anchorMessageId) = fetcher.initMessagesAtDate(CONVERSATION_ID, "2024-01-04T00:00:00.000Z") + + assertEquals("new", anchorMessageId) + assertEquals("new", data[position].messageId) + } + + @Test + fun initMessagesAtPositionClampsIndexAndFindsChronologicalAnchor() = runBlocking { + insertMessage(rowId = 3, messageId = "old", createdAt = "2024-01-01T00:00:00.000Z") + insertMessage(rowId = 2, messageId = "middle", createdAt = "2024-01-02T00:00:00.000Z") + insertMessage(rowId = 1, messageId = "new", createdAt = "2024-01-03T00:00:00.000Z") + + val (position, data, anchorMessageId) = fetcher.initMessagesAtPosition(CONVERSATION_ID, 99) + + assertEquals("new", anchorMessageId) + assertEquals("new", data[position].messageId) + } + + @Test + fun initMessagesAtPercentSupportsNormalizedAndWholeNumberPercent() = runBlocking { + insertMessage(rowId = 3, messageId = "old", createdAt = "2024-01-01T00:00:00.000Z") + insertMessage(rowId = 2, messageId = "middle", createdAt = "2024-01-02T00:00:00.000Z") + insertMessage(rowId = 1, messageId = "new", createdAt = "2024-01-03T00:00:00.000Z") + + val normalized = fetcher.initMessagesAtPercent(CONVERSATION_ID, 0.5f) + val wholeNumber = fetcher.initMessagesAtPercent(CONVERSATION_ID, 50f) + + assertTrue(normalized.second.isNotEmpty()) + assertEquals("middle", normalized.third) + assertEquals("middle", normalized.second[normalized.first].messageId) + assertEquals(normalized.third, wholeNumber.third) + } + + private fun insertUser() { + db.openHelper.writableDatabase.execSQL( + """ + INSERT INTO users(user_id, identity_number, relationship, biography, full_name) + VALUES (?, ?, ?, ?, ?) + """.trimIndent(), + arrayOf(USER_ID, "1000", "FRIEND", "", "Test User"), + ) + } + + private fun insertConversation() { + db.openHelper.writableDatabase.execSQL( + """ + INSERT INTO conversations(conversation_id, owner_id, category, name, created_at, status) + VALUES (?, ?, ?, ?, ?, ?) + """.trimIndent(), + arrayOf(CONVERSATION_ID, USER_ID, "CONTACT", "Test Conversation", "2024-01-01T00:00:00.000Z", 0), + ) + } + + private fun insertMessage( + rowId: Int, + messageId: String, + createdAt: String, + ) { + db.openHelper.writableDatabase.execSQL( + """ + INSERT INTO messages(rowid, id, conversation_id, user_id, category, content, status, created_at) + VALUES (?, ?, ?, ?, ?, ?, ?, ?) + """.trimIndent(), + arrayOf(rowId, messageId, CONVERSATION_ID, USER_ID, "PLAIN_TEXT", messageId, "SENT", createdAt), + ) + } + + private fun insertRemoteStatus(messageId: String) { + db.openHelper.writableDatabase.execSQL( + """ + INSERT INTO remote_messages_status(message_id, conversation_id, status) + VALUES (?, ?, ?) + """.trimIndent(), + arrayOf(messageId, CONVERSATION_ID, "DELIVERED"), + ) + } + + private companion object { + const val CONVERSATION_ID = "conversation-id" + const val USER_ID = "user-id" + } +} diff --git a/build.gradle.kts b/build.gradle.kts index 0434d5738d..a2cb5f5a00 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -26,6 +26,7 @@ plugins { id("org.jetbrains.kotlin.plugin.serialization") version "2.4.0" apply false id("com.google.devtools.ksp") version "2.3.9" apply false id("org.jetbrains.kotlin.plugin.compose") version "2.4.0" apply false + id("org.jetbrains.kotlin.jvm") version "2.4.0" apply false id("com.google.firebase.firebase-perf") version "2.0.2" apply false } diff --git a/query-codegen/build.gradle.kts b/query-codegen/build.gradle.kts new file mode 100644 index 0000000000..a9f1519d38 --- /dev/null +++ b/query-codegen/build.gradle.kts @@ -0,0 +1,15 @@ +plugins { + id("org.jetbrains.kotlin.jvm") +} + +kotlin { + jvmToolchain(17) +} + +dependencies { + implementation("com.google.devtools.ksp:symbol-processing-api:2.3.9") + + testImplementation("org.jetbrains.kotlin:kotlin-test") + testImplementation("org.jetbrains.kotlin:kotlin-test-junit") + testImplementation("junit:junit:4.13.2") +} diff --git a/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedLimitOffsetDataSourceQuery.kt b/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedLimitOffsetDataSourceQuery.kt new file mode 100644 index 0000000000..9d380f134a --- /dev/null +++ b/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedLimitOffsetDataSourceQuery.kt @@ -0,0 +1,12 @@ +package one.mixin.android.codegen.annotation + +@Target(AnnotationTarget.FUNCTION) +@Retention(AnnotationRetention.SOURCE) +annotation class GeneratedLimitOffsetDataSourceQuery( + val countSql: String, + val offsetSql: String, + val querySql: String, + val tables: Array, + val converter: String, + val database: String = "database", +) diff --git a/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedNoCountDataSourceQuery.kt b/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedNoCountDataSourceQuery.kt new file mode 100644 index 0000000000..0e9f3e6263 --- /dev/null +++ b/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedNoCountDataSourceQuery.kt @@ -0,0 +1,12 @@ +package one.mixin.android.codegen.annotation + +@Target(AnnotationTarget.FUNCTION) +@Retention(AnnotationRetention.SOURCE) +annotation class GeneratedNoCountDataSourceQuery( + val sql: String, + val binds: Array, + val count: String, + val tables: Array, + val converter: String, + val database: String = "database", +) diff --git a/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedPagingSourceQuery.kt b/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedPagingSourceQuery.kt new file mode 100644 index 0000000000..0dd33225e4 --- /dev/null +++ b/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedPagingSourceQuery.kt @@ -0,0 +1,12 @@ +package one.mixin.android.codegen.annotation + +@Target(AnnotationTarget.FUNCTION) +@Retention(AnnotationRetention.SOURCE) +annotation class GeneratedPagingSourceQuery( + val countSql: String, + val offsetSql: String, + val querySql: String, + val tables: Array, + val converter: String, + val database: String = "database", +) diff --git a/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedQuery.kt b/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedQuery.kt new file mode 100644 index 0000000000..ece603301c --- /dev/null +++ b/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedQuery.kt @@ -0,0 +1,11 @@ +package one.mixin.android.codegen.annotation + +@Target(AnnotationTarget.FUNCTION) +@Retention(AnnotationRetention.SOURCE) +annotation class GeneratedQuery( + val sql: String, + val binds: Array, + val callable: String, + val database: String = "db", + val cancellationSignal: String = "cancellationSignal", +) diff --git a/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedQueryProvider.kt b/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedQueryProvider.kt new file mode 100644 index 0000000000..7f643d7455 --- /dev/null +++ b/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedQueryProvider.kt @@ -0,0 +1,7 @@ +package one.mixin.android.codegen.annotation + +@Target(AnnotationTarget.CLASS) +@Retention(AnnotationRetention.SOURCE) +annotation class GeneratedQueryProvider( + val generatedName: String = "", +) diff --git a/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedRawCursorQuery.kt b/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedRawCursorQuery.kt new file mode 100644 index 0000000000..c3a6f077ad --- /dev/null +++ b/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedRawCursorQuery.kt @@ -0,0 +1,10 @@ +package one.mixin.android.codegen.annotation + +@Target(AnnotationTarget.FUNCTION) +@Retention(AnnotationRetention.SOURCE) +annotation class GeneratedRawCursorQuery( + val sql: String, + val binds: Array, + val converter: String, + val database: String = "db", +) diff --git a/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedSimpleSQLiteQuery.kt b/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedSimpleSQLiteQuery.kt new file mode 100644 index 0000000000..199cd9f23f --- /dev/null +++ b/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedSimpleSQLiteQuery.kt @@ -0,0 +1,7 @@ +package one.mixin.android.codegen.annotation + +@Target(AnnotationTarget.FUNCTION) +@Retention(AnnotationRetention.SOURCE) +annotation class GeneratedSimpleSQLiteQuery( + val sql: String, +) diff --git a/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryFileRenderer.kt b/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryFileRenderer.kt new file mode 100644 index 0000000000..f8a61d103c --- /dev/null +++ b/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryFileRenderer.kt @@ -0,0 +1,581 @@ +package one.mixin.android.codegen.processor + +data class QueryProviderModel( + val packageName: String, + val generatedName: String, + val functions: List, + val limitOffsetFunctions: List = emptyList(), + val noCountFunctions: List = emptyList(), + val rawCursorFunctions: List = emptyList(), + val simpleQueryFunctions: List = emptyList(), + val pagingSourceFunctions: List = emptyList(), +) + +data class QueryFunctionModel( + val name: String, + val returnType: String, + val returnTypeImports: List, + val parameters: List, + val parameterImports: List, + val sql: String, + val bindParameters: List, + val databaseParameter: String, + val cancellationSignalParameter: String, + val callableName: String, +) + +data class QueryParameterModel( + val name: String, + val type: String, +) + +data class LimitOffsetDataSourceFunctionModel( + val name: String, + val returnType: String, + val returnTypeImports: List, + val parameters: List, + val parameterImports: List, + val countSql: String, + val offsetSql: String, + val querySql: String, + val tables: List, + val databaseParameter: String, + val converterName: String, +) + +data class NoCountDataSourceFunctionModel( + val name: String, + val returnType: String, + val returnTypeImports: List, + val parameters: List, + val parameterImports: List, + val sql: String, + val bindParameters: List, + val countParameter: String, + val tables: List, + val databaseParameter: String, + val converterName: String, +) + +data class RawCursorQueryFunctionModel( + val name: String, + val returnType: String, + val returnTypeImports: List, + val parameters: List, + val parameterImports: List, + val sql: String, + val bindParameters: List, + val databaseParameter: String, + val converterName: String, +) + +data class SimpleSQLiteQueryFunctionModel( + val name: String, + val returnType: String, + val returnTypeImports: List, + val parameters: List, + val parameterImports: List, + val sql: String, +) + +data class PagingSourceQueryFunctionModel( + val name: String, + val returnType: String, + val returnTypeImports: List, + val parameters: List, + val parameterImports: List, + val countSql: String, + val offsetSql: String, + val querySql: String, + val tables: List, + val databaseParameter: String, + val converterName: String, +) + +class QueryFileRenderer { + fun render(model: QueryProviderModel): String { + val imports = + ( + listOf( + "android.annotation.SuppressLint", + ) + + model.roomSQLiteQueryImports() + + model.coroutinesImports() + + model.functions.flatMap { it.parameterImports + it.returnTypeImports } + + model.limitOffsetFunctions.flatMap { it.parameterImports + it.returnTypeImports } + + model.noCountFunctions.flatMap { it.parameterImports + it.returnTypeImports } + + model.rawCursorFunctions.flatMap { it.parameterImports + it.returnTypeImports + it.converterImport() } + + model.simpleQueryFunctions.flatMap { it.parameterImports + it.returnTypeImports } + + model.pagingSourceFunctions.flatMap { it.parameterImports + it.returnTypeImports + it.converterImport() } + + model.limitOffsetImports() + + model.noCountImports() + + model.pagingSourceImports() + ).distinct().sorted() + + val lines = mutableListOf() + lines += "package ${model.packageName}" + lines += "" + imports.forEach { lines += "import $it" } + lines += "" + lines += "@SuppressLint(\"RestrictedApi\")" + lines += "object ${model.generatedName} {" + model.functions.forEachIndexed { index, function -> + if (index > 0) { + lines += "" + } + renderFunction(lines, function) + } + model.limitOffsetFunctions.forEachIndexed { index, function -> + if (model.functions.isNotEmpty() || index > 0) { + lines += "" + } + renderLimitOffsetFunction(lines, function) + } + model.noCountFunctions.forEachIndexed { index, function -> + if (model.functions.isNotEmpty() || model.limitOffsetFunctions.isNotEmpty() || index > 0) { + lines += "" + } + renderNoCountFunction(lines, function) + } + model.rawCursorFunctions.forEachIndexed { index, function -> + if (model.functions.isNotEmpty() || model.limitOffsetFunctions.isNotEmpty() || model.noCountFunctions.isNotEmpty() || index > 0) { + lines += "" + } + renderRawCursorFunction(lines, function) + } + model.simpleQueryFunctions.forEachIndexed { index, function -> + if (model.functions.isNotEmpty() || model.limitOffsetFunctions.isNotEmpty() || model.noCountFunctions.isNotEmpty() || model.rawCursorFunctions.isNotEmpty() || index > 0) { + lines += "" + } + renderSimpleQueryFunction(lines, function) + } + model.pagingSourceFunctions.forEachIndexed { index, function -> + if (model.functions.isNotEmpty() || model.limitOffsetFunctions.isNotEmpty() || model.noCountFunctions.isNotEmpty() || model.rawCursorFunctions.isNotEmpty() || model.simpleQueryFunctions.isNotEmpty() || index > 0) { + lines += "" + } + renderPagingSourceFunction(lines, function) + } + lines += "}" + return lines.joinToString("\n") + } + + private fun renderFunction( + lines: MutableList, + function: QueryFunctionModel, + ) { + lines += " @Suppress(\"LocalVariableName\", \"JoinDeclarationAndAssignment\")" + lines += " suspend fun ${function.name}(" + function.parameters.forEach { parameter -> + lines += " ${parameter.name}: ${parameter.type}," + } + lines += " ): ${function.returnType} {" + lines += " val _sql = \"\"\"" + function.sql.lineSequence().forEach { sqlLine -> + lines += " $sqlLine" + } + lines += " \"\"\".trimIndent()" + lines += " val _statement = RoomSQLiteQuery.acquire(_sql, ${function.bindParameters.size})" + function.bindParameters.forEachIndexed { index, bindParameter -> + val argIndex = index + 1 + if (index == 0) { + lines += " var _argIndex = $argIndex" + } else { + lines += " _argIndex = $argIndex" + } + renderBind(lines, function, bindParameter) + } + lines += " return withContext(${function.databaseParameter}.queryExecutor.asCoroutineDispatcher()) {" + lines += " ${function.callableName}(${function.databaseParameter}, _statement, ${function.cancellationSignalParameter}).call()" + lines += " }" + lines += " }" + } + + private fun renderLimitOffsetFunction( + lines: MutableList, + function: LimitOffsetDataSourceFunctionModel, + ) { + val itemType = function.returnType.dataSourceItemType() + lines += " fun ${function.name}(" + function.parameters.forEach { parameter -> + lines += " ${parameter.name}: ${parameter.type}," + } + lines += " ): ${function.returnType} =" + lines += " object : DataSource.Factory() {" + lines += " override fun create(): DataSource {" + renderRoomQueryAcquire(lines, "countStatement", function.countSql, 0, " ") + renderRoomQueryAcquire(lines, "offsetStatement", function.offsetSql, 2, " ") + lines += " val querySqlGenerator = fun(ids: String): RoomSQLiteQuery {" + lines += " return RoomSQLiteQuery.acquire(" + renderSqlLiteral(lines, function.querySql.renderSqlTemplate(function.parameters.map { it.name } + "ids"), " ") + lines += " 0," + lines += " )" + lines += " }" + lines += " return object : MixinLimitOffsetDataSource<$itemType>(" + lines += " ${function.databaseParameter}," + lines += " countStatement," + lines += " offsetStatement," + lines += " querySqlGenerator," + lines += " arrayOf(${function.tables.joinToString { "\"$it\"" }})," + lines += " ) {" + lines += " override fun convertRows(cursor: Cursor?): List<$itemType> =" + lines += " ${function.converterName}(cursor)" + lines += " }" + lines += " }" + lines += " }" + } + + private fun renderRawCursorFunction( + lines: MutableList, + function: RawCursorQueryFunctionModel, + ) { + lines += " fun ${function.name}(" + function.parameters.forEach { parameter -> + lines += " ${parameter.name}: ${parameter.type}," + } + lines += " ): ${function.returnType} {" + lines += " val cursor = ${function.databaseParameter}.query(" + renderSqlLiteral(lines, function.sql.renderSqlTemplate(function.parameters.map { it.name }), " ") + lines += " arrayOf(${function.bindParameters.joinToString { function.rawBindExpression(it) }})," + lines += " )" + lines += " return cursor.use {" + lines += " ${function.converterCallName()}(it)" + lines += " }" + lines += " }" + } + + private fun renderSimpleQueryFunction( + lines: MutableList, + function: SimpleSQLiteQueryFunctionModel, + ) { + lines += " fun ${function.name}(" + function.parameters.forEach { parameter -> + lines += " ${parameter.name}: ${parameter.type}," + } + lines += " ): ${function.returnType} =" + lines += " SimpleSQLiteQuery(" + renderSqlLiteral(lines, function.sql.renderSqlTemplate(function.parameters.map { it.name }), " ") + lines += " )" + } + + private fun renderPagingSourceFunction( + lines: MutableList, + function: PagingSourceQueryFunctionModel, + ) { + val itemType = function.returnType.dataSourceItemType() + lines += " fun ${function.name}(" + function.parameters.forEach { parameter -> + lines += " ${parameter.name}: ${parameter.type}," + } + lines += " ): ${function.returnType} =" + lines += " object : PagingSource() {" + lines += " private val itemCount = AtomicInteger(INITIAL_ITEM_COUNT)" + lines += "" + lines += " private val observer = object : InvalidationTracker.Observer(arrayOf(${function.tables.joinToString { "\"$it\"" }})) {" + lines += " override fun onInvalidated(tables: Set) {" + lines += " invalidate()" + lines += " }" + lines += " }" + lines += "" + lines += " init {" + lines += " ${function.databaseParameter}.invalidationTracker.addWeakObserver(observer)" + lines += " }" + lines += "" + lines += " override suspend fun load(params: LoadParams): LoadResult {" + lines += " return withContext(${function.databaseParameter}.queryExecutor.asCoroutineDispatcher()) {" + lines += " val tempCount = itemCount.get()" + lines += " if (tempCount == INITIAL_ITEM_COUNT) {" + lines += " ${function.databaseParameter}.withTransaction {" + lines += " val count = countItems()" + lines += " itemCount.set(count)" + lines += " queryData(params, count)" + lines += " }" + lines += " } else {" + lines += " val loadResult = queryData(params, tempCount)" + lines += " ${function.databaseParameter}.invalidationTracker.refreshVersionsSync()" + lines += " @Suppress(\"UNCHECKED_CAST\")" + lines += " if (invalid) INVALID as LoadResult.Invalid else loadResult" + lines += " }" + lines += " }" + lines += " }" + lines += "" + lines += " private fun countItems(): Int {" + renderRoomQueryAcquire(lines, "countStatement", function.countSql.renderSqlTemplate(function.parameters.map { it.name }), 0, " ") + lines += " val cursor = ${function.databaseParameter}.query(countStatement)" + lines += " return try {" + lines += " if (cursor.moveToFirst()) cursor.getInt(0) else 0" + lines += " } finally {" + lines += " cursor.close()" + lines += " countStatement.release()" + lines += " }" + lines += " }" + lines += "" + lines += " private fun queryData(params: LoadParams, itemCount: Int): LoadResult.Page {" + lines += " val key = params.key ?: 0" + lines += " val limit = getLimit(params, key)" + lines += " val offset = getOffset(params, key, itemCount)" + renderRoomQueryAcquire(lines, "offsetStatement", function.offsetSql.renderSqlTemplate(function.parameters.map { it.name }), 2, " ") + lines += " offsetStatement.bindLong(1, limit.toLong())" + lines += " offsetStatement.bindLong(2, offset.toLong())" + lines += " val offsetCursor = ${function.databaseParameter}.query(offsetStatement)" + lines += " val ids = mutableListOf()" + lines += " try {" + lines += " while (offsetCursor.moveToNext()) {" + lines += " ids.add(\"'\${offsetCursor.getLong(0)}'\")" + lines += " }" + lines += " } finally {" + lines += " offsetCursor.close()" + lines += " offsetStatement.release()" + lines += " }" + lines += " val data = if (ids.isEmpty()) {" + lines += " emptyList()" + lines += " } else {" + lines += " val queryStatement = querySqlGenerator(ids.joinToString())" + lines += " val cursor = ${function.databaseParameter}.query(queryStatement)" + lines += " try {" + lines += " ${function.converterName}(cursor)" + lines += " } finally {" + lines += " cursor.close()" + lines += " queryStatement.release()" + lines += " }" + lines += " }" + lines += " val nextPosToLoad = offset + data.size" + lines += " val nextKey = if (ids.isEmpty() || ids.size < limit || nextPosToLoad >= itemCount) null else nextPosToLoad" + lines += " val prevKey = if (offset <= 0 || ids.isEmpty()) null else offset" + lines += " return LoadResult.Page(" + lines += " data = data," + lines += " prevKey = prevKey," + lines += " nextKey = nextKey," + lines += " itemsBefore = offset," + lines += " itemsAfter = maxOf(0, itemCount - nextPosToLoad)," + lines += " )" + lines += " }" + lines += "" + lines += " private fun querySqlGenerator(ids: String): RoomSQLiteQuery {" + lines += " return RoomSQLiteQuery.acquire(" + renderSqlLiteral(lines, function.querySql.renderSqlTemplate(function.parameters.map { it.name } + "ids"), " ") + lines += " 0," + lines += " )" + lines += " }" + lines += "" + lines += " override fun getRefreshKey(state: PagingState): Int? {" + lines += " return state.getClippedRefreshKey()" + lines += " }" + lines += "" + lines += " override val jumpingSupported: Boolean" + lines += " get() = true" + lines += " }" + } + + private fun renderNoCountFunction( + lines: MutableList, + function: NoCountDataSourceFunctionModel, + ) { + val itemType = function.returnType.dataSourceItemType() + lines += " fun ${function.name}(" + function.parameters.forEach { parameter -> + lines += " ${parameter.name}: ${parameter.type}," + } + lines += " ): ${function.returnType} =" + lines += " object : DataSource.Factory() {" + lines += " override fun create(): DataSource {" + renderRoomQueryAcquire(lines, "_statement", function.sql, function.bindParameters.size, " ") + function.bindParameters.forEachIndexed { index, bindParameter -> + val argIndex = index + 1 + if (index == 0) { + lines += " var _argIndex = $argIndex" + } else { + lines += " _argIndex = $argIndex" + } + renderBind(lines, function, bindParameter, " ") + } + lines += " return object : NoCountLimitOffsetDataSource<$itemType>(" + lines += " ${function.databaseParameter}," + lines += " _statement," + lines += " ${function.countParameter}," + function.tables.forEach { table -> + lines += " \"$table\"," + } + lines += " ) {" + lines += " override fun convertRows(cursor: Cursor?): List<$itemType> =" + lines += " ${function.converterName}(cursor)" + lines += " }" + lines += " }" + lines += " }" + } + + private fun renderRoomQueryAcquire( + lines: MutableList, + variableName: String, + sql: String, + argCount: Int, + indent: String, + ) { + lines += "${indent}val $variableName = RoomSQLiteQuery.acquire(" + renderSqlLiteral(lines, sql, "$indent ") + lines += "$indent $argCount," + lines += "$indent)" + } + + private fun renderSqlLiteral( + lines: MutableList, + sql: String, + indent: String, + ) { + lines += "$indent\"\"\"" + sql.lineSequence().forEach { sqlLine -> + lines += "$indent$sqlLine" + } + lines += "$indent\"\"\".trimIndent()," + } + + private fun renderBind( + lines: MutableList, + function: QueryFunctionModel, + bindParameter: String, + ) { + val parameter = + function.parameters.firstOrNull { it.name == bindParameter } + ?: error("Missing parameter $bindParameter in ${function.name}") + + when (parameter.type.removeSuffix("?")) { + "String" -> renderNullableBind(lines, parameter, "bindString", " ") + "Int", "Long" -> renderNullableLongBind(lines, parameter) + else -> error("Unsupported bind type ${parameter.type} for ${parameter.name}") + } + } + + private fun renderBind( + lines: MutableList, + function: NoCountDataSourceFunctionModel, + bindParameter: String, + indent: String, + ) { + val parameter = + function.parameters.firstOrNull { it.name == bindParameter } + ?: error("Missing parameter $bindParameter in ${function.name}") + + when (parameter.type.removeSuffix("?")) { + "String" -> renderNullableBind(lines, parameter, "bindString", indent) + "Int", "Long" -> renderNullableLongBind(lines, parameter, indent) + else -> error("Unsupported bind type ${parameter.type} for ${parameter.name}") + } + } + + private fun renderNullableBind( + lines: MutableList, + parameter: QueryParameterModel, + bindMethod: String, + indent: String, + ) { + if (parameter.type.endsWith("?")) { + lines += "${indent}if (${parameter.name} == null) {" + lines += "$indent _statement.bindNull(_argIndex)" + lines += "$indent} else {" + lines += "$indent _statement.$bindMethod(_argIndex, ${parameter.name})" + lines += "$indent}" + } else { + lines += "${indent}_statement.$bindMethod(_argIndex, ${parameter.name})" + } + } + + private fun renderNullableLongBind( + lines: MutableList, + parameter: QueryParameterModel, + indent: String = " ", + ) { + if (parameter.type.endsWith("?")) { + lines += "${indent}if (${parameter.name} == null) {" + lines += "$indent _statement.bindNull(_argIndex)" + lines += "$indent} else {" + lines += "$indent _statement.bindLong(_argIndex, ${parameter.name}.toLong())" + lines += "$indent}" + } else { + lines += "${indent}_statement.bindLong(_argIndex, ${parameter.name}.toLong())" + } + } + + private fun QueryProviderModel.limitOffsetImports(): List = + if (limitOffsetFunctions.isEmpty()) { + emptyList() + } else { + listOf( + "android.database.Cursor", + "one.mixin.android.db.datasource.MixinLimitOffsetDataSource", + ) + } + + private fun QueryProviderModel.noCountImports(): List = + if (noCountFunctions.isEmpty()) { + emptyList() + } else { + listOf( + "android.database.Cursor", + "one.mixin.android.db.datasource.NoCountLimitOffsetDataSource", + ) + } + + private fun QueryProviderModel.roomSQLiteQueryImports(): List = + if (functions.isEmpty() && limitOffsetFunctions.isEmpty() && noCountFunctions.isEmpty() && pagingSourceFunctions.isEmpty()) { + emptyList() + } else { + listOf("androidx.room.RoomSQLiteQuery") + } + + private fun QueryProviderModel.coroutinesImports(): List = + if (functions.isEmpty() && pagingSourceFunctions.isEmpty()) { + emptyList() + } else { + listOf( + "kotlinx.coroutines.asCoroutineDispatcher", + "kotlinx.coroutines.withContext", + ) + } + + private fun QueryProviderModel.pagingSourceImports(): List = + if (pagingSourceFunctions.isEmpty()) { + emptyList() + } else { + listOf( + "androidx.paging.PagingState", + "androidx.room.InvalidationTracker", + "androidx.room.paging.util.INITIAL_ITEM_COUNT", + "androidx.room.paging.util.INVALID", + "androidx.room.paging.util.getClippedRefreshKey", + "androidx.room.paging.util.getLimit", + "androidx.room.paging.util.getOffset", + "androidx.room.withTransaction", + "java.util.concurrent.atomic.AtomicInteger", + ) + } + + private fun String.dataSourceItemType(): String = + substringAfterLast(",").removeSuffix(">").trim() + + private fun String.renderSqlTemplate(parameterNames: List): String { + var rendered = this + parameterNames.forEach { parameterName -> + rendered = rendered.replace("{{$parameterName}}", "\$$parameterName") + } + return rendered + } + + private fun RawCursorQueryFunctionModel.converterImport(): List = + if (converterName.contains(".")) listOf(converterName) else emptyList() + + private fun RawCursorQueryFunctionModel.converterCallName(): String = + converterName.substringAfterLast(".") + + private fun PagingSourceQueryFunctionModel.converterImport(): List = + if (converterName.contains(".")) listOf(converterName) else emptyList() + + private fun RawCursorQueryFunctionModel.rawBindExpression(bindParameter: String): String { + val parameter = + parameters.firstOrNull { it.name == bindParameter } + ?: error("Missing parameter $bindParameter in $name") + return when (parameter.type.removeSuffix("?")) { + "String" -> parameter.name + "Int", "Long" -> parameter.name + else -> error("Unsupported raw bind type ${parameter.type} for ${parameter.name}") + } + } +} diff --git a/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryProcessor.kt b/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryProcessor.kt new file mode 100644 index 0000000000..296ebc15d9 --- /dev/null +++ b/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryProcessor.kt @@ -0,0 +1,288 @@ +package one.mixin.android.codegen.processor + +import com.google.devtools.ksp.processing.CodeGenerator +import com.google.devtools.ksp.processing.Dependencies +import com.google.devtools.ksp.processing.KSPLogger +import com.google.devtools.ksp.processing.SymbolProcessor +import com.google.devtools.ksp.processing.SymbolProcessorEnvironment +import com.google.devtools.ksp.processing.Resolver +import com.google.devtools.ksp.symbol.KSAnnotated +import com.google.devtools.ksp.symbol.KSAnnotation +import com.google.devtools.ksp.symbol.KSClassDeclaration +import com.google.devtools.ksp.symbol.KSDeclaration +import com.google.devtools.ksp.symbol.KSFile +import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import com.google.devtools.ksp.symbol.KSName +import com.google.devtools.ksp.symbol.KSType +import com.google.devtools.ksp.symbol.KSTypeArgument +import com.google.devtools.ksp.symbol.Nullability +import com.google.devtools.ksp.symbol.Variance +import com.google.devtools.ksp.validate +import one.mixin.android.codegen.annotation.GeneratedQuery +import one.mixin.android.codegen.annotation.GeneratedQueryProvider +import one.mixin.android.codegen.annotation.GeneratedLimitOffsetDataSourceQuery +import one.mixin.android.codegen.annotation.GeneratedNoCountDataSourceQuery +import one.mixin.android.codegen.annotation.GeneratedPagingSourceQuery +import one.mixin.android.codegen.annotation.GeneratedRawCursorQuery +import one.mixin.android.codegen.annotation.GeneratedSimpleSQLiteQuery + +class QueryProcessor( + environment: SymbolProcessorEnvironment, +) : SymbolProcessor { + private val codeGenerator: CodeGenerator = environment.codeGenerator + private val logger: KSPLogger = environment.logger + private val renderer = QueryFileRenderer() + + override fun process(resolver: Resolver): List { + val symbols = + resolver + .getSymbolsWithAnnotation(GeneratedQueryProvider::class.qualifiedName.orEmpty()) + .filterIsInstance() + .toList() + val invalid = symbols.filterNot { it.validate() } + symbols.filter { it.validate() }.forEach(::generateProvider) + return invalid + } + + private fun generateProvider(provider: KSClassDeclaration) { + val allFunctions = provider.getAllFunctions().toList() + val queryFunctions = allFunctions.filter { it.hasAnnotation() } + val limitOffsetFunctions = allFunctions.filter { it.hasAnnotation() } + val noCountFunctions = allFunctions.filter { it.hasAnnotation() } + val rawCursorFunctions = allFunctions.filter { it.hasAnnotation() } + val simpleQueryFunctions = allFunctions.filter { it.hasAnnotation() } + val pagingSourceFunctions = allFunctions.filter { it.hasAnnotation() } + if (queryFunctions.isEmpty() && limitOffsetFunctions.isEmpty() && noCountFunctions.isEmpty() && rawCursorFunctions.isEmpty() && simpleQueryFunctions.isEmpty() && pagingSourceFunctions.isEmpty()) return + + val providerAnnotation = provider.annotation() + val generatedName = + providerAnnotation.stringArgument("generatedName") + .takeUnless { it.isBlank() } + ?: "${provider.simpleName.asString()}Generated" + val model = + QueryProviderModel( + packageName = provider.packageName.asString(), + generatedName = generatedName, + functions = queryFunctions.map(::functionModel), + limitOffsetFunctions = limitOffsetFunctions.map(::limitOffsetFunctionModel), + noCountFunctions = noCountFunctions.map(::noCountFunctionModel), + rawCursorFunctions = rawCursorFunctions.map(::rawCursorFunctionModel), + simpleQueryFunctions = simpleQueryFunctions.map(::simpleQueryFunctionModel), + pagingSourceFunctions = pagingSourceFunctions.map(::pagingSourceFunctionModel), + ) + val files = (listOfNotNull(provider.containingFile) + (queryFunctions + limitOffsetFunctions + noCountFunctions + rawCursorFunctions + simpleQueryFunctions + pagingSourceFunctions).mapNotNull { it.containingFile }).distinct() + codeGenerator + .createNewFile( + dependencies = Dependencies(aggregating = false, sources = files.toTypedArray()), + packageName = model.packageName, + fileName = model.generatedName, + ).use { output -> + output.write(renderer.render(model).toByteArray()) + } + } + + private fun functionModel(function: KSFunctionDeclaration): QueryFunctionModel { + val annotation = function.annotation() + val importCollector = TypeImportCollector() + val parameters = function.parameters(importCollector) + val returnType = function.returnType?.resolve() + if (returnType == null) { + logger.error("GeneratedQuery functions must declare a return type", function) + } + return QueryFunctionModel( + name = function.simpleName.asString(), + returnType = returnType?.let { importCollector.render(it) } ?: "Unit", + returnTypeImports = importCollector.imports, + parameters = parameters, + parameterImports = emptyList(), + sql = annotation.stringArgument("sql"), + bindParameters = annotation.stringListArgument("binds"), + databaseParameter = annotation.stringArgument("database"), + cancellationSignalParameter = annotation.stringArgument("cancellationSignal"), + callableName = annotation.stringArgument("callable"), + ) + } + + private fun limitOffsetFunctionModel(function: KSFunctionDeclaration): LimitOffsetDataSourceFunctionModel { + val annotation = function.annotation() + val importCollector = TypeImportCollector() + val parameters = function.parameters(importCollector) + val returnType = function.returnType?.resolve() + if (returnType == null) { + logger.error("GeneratedLimitOffsetDataSourceQuery functions must declare a return type", function) + } + return LimitOffsetDataSourceFunctionModel( + name = function.simpleName.asString(), + returnType = returnType?.let { importCollector.render(it) } ?: "Unit", + returnTypeImports = importCollector.imports, + parameters = parameters, + parameterImports = emptyList(), + countSql = annotation.stringArgument("countSql"), + offsetSql = annotation.stringArgument("offsetSql"), + querySql = annotation.stringArgument("querySql"), + tables = annotation.stringListArgument("tables"), + databaseParameter = annotation.stringArgument("database"), + converterName = annotation.stringArgument("converter"), + ) + } + + private fun noCountFunctionModel(function: KSFunctionDeclaration): NoCountDataSourceFunctionModel { + val annotation = function.annotation() + val importCollector = TypeImportCollector() + val parameters = function.parameters(importCollector) + val returnType = function.returnType?.resolve() + if (returnType == null) { + logger.error("GeneratedNoCountDataSourceQuery functions must declare a return type", function) + } + return NoCountDataSourceFunctionModel( + name = function.simpleName.asString(), + returnType = returnType?.let { importCollector.render(it) } ?: "Unit", + returnTypeImports = importCollector.imports, + parameters = parameters, + parameterImports = emptyList(), + sql = annotation.stringArgument("sql"), + bindParameters = annotation.stringListArgument("binds"), + countParameter = annotation.stringArgument("count"), + tables = annotation.stringListArgument("tables"), + databaseParameter = annotation.stringArgument("database"), + converterName = annotation.stringArgument("converter"), + ) + } + + private fun rawCursorFunctionModel(function: KSFunctionDeclaration): RawCursorQueryFunctionModel { + val annotation = function.annotation() + val importCollector = TypeImportCollector() + val parameters = function.parameters(importCollector) + val returnType = function.returnType?.resolve() + if (returnType == null) { + logger.error("GeneratedRawCursorQuery functions must declare a return type", function) + } + return RawCursorQueryFunctionModel( + name = function.simpleName.asString(), + returnType = returnType?.let { importCollector.render(it) } ?: "Unit", + returnTypeImports = importCollector.imports, + parameters = parameters, + parameterImports = emptyList(), + sql = annotation.stringArgument("sql"), + bindParameters = annotation.stringListArgument("binds"), + databaseParameter = annotation.stringArgument("database"), + converterName = annotation.stringArgument("converter"), + ) + } + + private fun simpleQueryFunctionModel(function: KSFunctionDeclaration): SimpleSQLiteQueryFunctionModel { + val annotation = function.annotation() + val importCollector = TypeImportCollector() + val parameters = function.parameters(importCollector) + val returnType = function.returnType?.resolve() + if (returnType == null) { + logger.error("GeneratedSimpleSQLiteQuery functions must declare a return type", function) + } + return SimpleSQLiteQueryFunctionModel( + name = function.simpleName.asString(), + returnType = returnType?.let { importCollector.render(it) } ?: "Unit", + returnTypeImports = importCollector.imports, + parameters = parameters, + parameterImports = emptyList(), + sql = annotation.stringArgument("sql"), + ) + } + + private fun pagingSourceFunctionModel(function: KSFunctionDeclaration): PagingSourceQueryFunctionModel { + val annotation = function.annotation() + val importCollector = TypeImportCollector() + val parameters = function.parameters(importCollector) + val returnType = function.returnType?.resolve() + if (returnType == null) { + logger.error("GeneratedPagingSourceQuery functions must declare a return type", function) + } + return PagingSourceQueryFunctionModel( + name = function.simpleName.asString(), + returnType = returnType?.let { importCollector.render(it) } ?: "Unit", + returnTypeImports = importCollector.imports, + parameters = parameters, + parameterImports = emptyList(), + countSql = annotation.stringArgument("countSql"), + offsetSql = annotation.stringArgument("offsetSql"), + querySql = annotation.stringArgument("querySql"), + tables = annotation.stringListArgument("tables"), + databaseParameter = annotation.stringArgument("database"), + converterName = annotation.stringArgument("converter"), + ) + } + + private fun KSFunctionDeclaration.parameters(importCollector: TypeImportCollector): List = + parameters.map { parameter -> + val name = parameter.name?.asString() + if (name == null) { + logger.error("Generated query parameters must be named", parameter) + QueryParameterModel("", "Nothing") + } else { + QueryParameterModel(name, importCollector.render(parameter.type.resolve())) + } + } + + private inline fun KSAnnotated.hasAnnotation(): Boolean = + annotations.any { it.shortName.asString() == T::class.simpleName } + + private inline fun KSAnnotated.annotation(): KSAnnotation = + annotations.first { it.shortName.asString() == T::class.simpleName } +} + +private class TypeImportCollector { + private val mutableImports = linkedSetOf() + val imports: List + get() = mutableImports.toList() + + fun render(type: KSType): String { + val declaration = type.declaration + val (simpleName, importName) = declaration.names() + if (importName.isNotEmpty() && !importName.startsWith("kotlin.")) { + mutableImports += importName + } + val arguments = + type.arguments + .takeIf { it.isNotEmpty() } + ?.joinToString(prefix = "<", postfix = ">") { renderArgument(it) } + .orEmpty() + val nullable = if (type.nullability == Nullability.NULLABLE) "?" else "" + return "$simpleName$arguments$nullable" + } + + private fun renderArgument(argument: KSTypeArgument): String { + val type = argument.type?.resolve() ?: return "*" + val rendered = render(type) + return when (argument.variance) { + Variance.COVARIANT -> "out $rendered" + Variance.CONTRAVARIANT -> "in $rendered" + Variance.STAR -> "*" + else -> rendered + } + } +} + +private fun KSDeclaration.names(): Pair { + val parent = parentDeclaration as? KSClassDeclaration + return if (parent?.qualifiedName != null) { + "${parent.simpleName.asString()}.${simpleName.asString()}" to parent.qualifiedName!!.asString() + } else { + simpleName.asString() to (qualifiedName?.asString().orEmpty()) + } +} + +private fun KSAnnotation.stringArgument(name: String): String = + arguments.firstValue(name) as? String ?: "" + +private fun KSAnnotation.stringListArgument(name: String): List { + val value = arguments.firstValue(name) + return when (value) { + is List<*> -> value.filterIsInstance() + is Array<*> -> value.filterIsInstance() + else -> emptyList() + } +} + +private fun List.firstValue(name: String): Any? = + firstOrNull { it.name?.matches(name) == true }?.value + +private fun KSName.matches(name: String): Boolean = asString() == name diff --git a/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryProcessorProvider.kt b/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryProcessorProvider.kt new file mode 100644 index 0000000000..92a09f34fb --- /dev/null +++ b/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryProcessorProvider.kt @@ -0,0 +1,10 @@ +package one.mixin.android.codegen.processor + +import com.google.devtools.ksp.processing.SymbolProcessor +import com.google.devtools.ksp.processing.SymbolProcessorEnvironment +import com.google.devtools.ksp.processing.SymbolProcessorProvider + +class QueryProcessorProvider : SymbolProcessorProvider { + override fun create(environment: SymbolProcessorEnvironment): SymbolProcessor = + QueryProcessor(environment) +} diff --git a/query-codegen/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider b/query-codegen/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider new file mode 100644 index 0000000000..dc87fea658 --- /dev/null +++ b/query-codegen/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider @@ -0,0 +1 @@ +one.mixin.android.codegen.processor.QueryProcessorProvider diff --git a/query-codegen/src/test/kotlin/one/mixin/android/codegen/processor/QueryFileRendererTest.kt b/query-codegen/src/test/kotlin/one/mixin/android/codegen/processor/QueryFileRendererTest.kt new file mode 100644 index 0000000000..4f46062b6c --- /dev/null +++ b/query-codegen/src/test/kotlin/one/mixin/android/codegen/processor/QueryFileRendererTest.kt @@ -0,0 +1,571 @@ +package one.mixin.android.codegen.processor + +import kotlin.test.Test +import kotlin.test.assertEquals + +class QueryFileRendererTest { + @Test + fun rendersSuspendQueryWithNullableStringBinds() { + val source = + QueryFileRenderer().render( + QueryProviderModel( + packageName = "one.mixin.android.db.provider", + generatedName = "GeneratedDataProvider", + functions = + listOf( + QueryFunctionModel( + name = "fuzzySearchToken", + returnType = "List", + returnTypeImports = listOf("one.mixin.android.vo.safe.TokenItem"), + parameters = + listOf( + QueryParameterModel("name", "String?"), + QueryParameterModel("symbol", "String?"), + QueryParameterModel("db", "MixinDatabase"), + QueryParameterModel("cancellationSignal", "CancellationSignal"), + ), + parameterImports = + listOf( + "android.os.CancellationSignal", + "one.mixin.android.db.MixinDatabase", + ), + sql = + """ + SELECT * + FROM tokens + WHERE symbol LIKE '%' || ? || '%' + """.trimIndent(), + bindParameters = listOf("symbol", "name", "symbol", "name"), + databaseParameter = "db", + cancellationSignalParameter = "cancellationSignal", + callableName = "callableTokenItem", + ), + ), + ), + ) + + assertEquals( + """ + package one.mixin.android.db.provider + + import android.annotation.SuppressLint + import android.os.CancellationSignal + import androidx.room.RoomSQLiteQuery + import kotlinx.coroutines.asCoroutineDispatcher + import kotlinx.coroutines.withContext + import one.mixin.android.db.MixinDatabase + import one.mixin.android.vo.safe.TokenItem + + @SuppressLint("RestrictedApi") + object GeneratedDataProvider { + @Suppress("LocalVariableName", "JoinDeclarationAndAssignment") + suspend fun fuzzySearchToken( + name: String?, + symbol: String?, + db: MixinDatabase, + cancellationSignal: CancellationSignal, + ): List { + val _sql = ""${'"'} + SELECT * + FROM tokens + WHERE symbol LIKE '%' || ? || '%' + ""${'"'}.trimIndent() + val _statement = RoomSQLiteQuery.acquire(_sql, 4) + var _argIndex = 1 + if (symbol == null) { + _statement.bindNull(_argIndex) + } else { + _statement.bindString(_argIndex, symbol) + } + _argIndex = 2 + if (name == null) { + _statement.bindNull(_argIndex) + } else { + _statement.bindString(_argIndex, name) + } + _argIndex = 3 + if (symbol == null) { + _statement.bindNull(_argIndex) + } else { + _statement.bindString(_argIndex, symbol) + } + _argIndex = 4 + if (name == null) { + _statement.bindNull(_argIndex) + } else { + _statement.bindString(_argIndex, name) + } + return withContext(db.queryExecutor.asCoroutineDispatcher()) { + callableTokenItem(db, _statement, cancellationSignal).call() + } + } + } + """.trimIndent(), + source, + ) + } + + @Test + fun rendersLimitOffsetDataSourceFactory() { + val source = + QueryFileRenderer().render( + QueryProviderModel( + packageName = "one.mixin.android.db.provider", + generatedName = "GeneratedDataProvider", + functions = emptyList(), + limitOffsetFunctions = + listOf( + LimitOffsetDataSourceFunctionModel( + name = "observeConversations", + returnType = "DataSource.Factory", + returnTypeImports = + listOf( + "androidx.paging.DataSource", + "one.mixin.android.vo.ConversationItem", + ), + parameters = listOf(QueryParameterModel("database", "MixinDatabase")), + parameterImports = listOf("one.mixin.android.db.MixinDatabase"), + countSql = "SELECT count(1) FROM conversations", + offsetSql = "SELECT c.rowid FROM conversations c LIMIT ? OFFSET ?", + querySql = "SELECT * FROM conversations c WHERE c.rowid IN ({{ids}})", + tables = listOf("conversations", "users"), + databaseParameter = "database", + converterName = "convertToConversationItems", + ), + ), + ), + ) + + assertEquals( + """ + package one.mixin.android.db.provider + + import android.annotation.SuppressLint + import android.database.Cursor + import androidx.paging.DataSource + import androidx.room.RoomSQLiteQuery + import one.mixin.android.db.MixinDatabase + import one.mixin.android.db.datasource.MixinLimitOffsetDataSource + import one.mixin.android.vo.ConversationItem + + @SuppressLint("RestrictedApi") + object GeneratedDataProvider { + fun observeConversations( + database: MixinDatabase, + ): DataSource.Factory = + object : DataSource.Factory() { + override fun create(): DataSource { + val countStatement = RoomSQLiteQuery.acquire( + ""${'"'} + SELECT count(1) FROM conversations + ""${'"'}.trimIndent(), + 0, + ) + val offsetStatement = RoomSQLiteQuery.acquire( + ""${'"'} + SELECT c.rowid FROM conversations c LIMIT ? OFFSET ? + ""${'"'}.trimIndent(), + 2, + ) + val querySqlGenerator = fun(ids: String): RoomSQLiteQuery { + return RoomSQLiteQuery.acquire( + ""${'"'} + SELECT * FROM conversations c WHERE c.rowid IN (${'$'}ids) + ""${'"'}.trimIndent(), + 0, + ) + } + return object : MixinLimitOffsetDataSource( + database, + countStatement, + offsetStatement, + querySqlGenerator, + arrayOf("conversations", "users"), + ) { + override fun convertRows(cursor: Cursor?): List = + convertToConversationItems(cursor) + } + } + } + } + """.trimIndent(), + source, + ) + } + + @Test + fun rendersNoCountDataSourceFactory() { + val source = + QueryFileRenderer().render( + QueryProviderModel( + packageName = "one.mixin.android.db.provider", + generatedName = "GeneratedDataProvider", + functions = emptyList(), + noCountFunctions = + listOf( + NoCountDataSourceFunctionModel( + name = "getPinMessages", + returnType = "DataSource.Factory", + returnTypeImports = + listOf( + "androidx.paging.DataSource", + "one.mixin.android.vo.ChatHistoryMessageItem", + ), + parameters = + listOf( + QueryParameterModel("database", "MixinDatabase"), + QueryParameterModel("conversationId", "String"), + QueryParameterModel("count", "Int"), + ), + parameterImports = listOf("one.mixin.android.db.MixinDatabase"), + sql = "SELECT * FROM messages WHERE conversation_id = ?", + bindParameters = listOf("conversationId"), + countParameter = "count", + tables = listOf("pin_messages", "messages"), + databaseParameter = "database", + converterName = "convertChatHistoryMessageItem", + ), + ), + ), + ) + + assertEquals( + """ + package one.mixin.android.db.provider + + import android.annotation.SuppressLint + import android.database.Cursor + import androidx.paging.DataSource + import androidx.room.RoomSQLiteQuery + import one.mixin.android.db.MixinDatabase + import one.mixin.android.db.datasource.NoCountLimitOffsetDataSource + import one.mixin.android.vo.ChatHistoryMessageItem + + @SuppressLint("RestrictedApi") + object GeneratedDataProvider { + fun getPinMessages( + database: MixinDatabase, + conversationId: String, + count: Int, + ): DataSource.Factory = + object : DataSource.Factory() { + override fun create(): DataSource { + val _statement = RoomSQLiteQuery.acquire( + ""${'"'} + SELECT * FROM messages WHERE conversation_id = ? + ""${'"'}.trimIndent(), + 1, + ) + var _argIndex = 1 + _statement.bindString(_argIndex, conversationId) + return object : NoCountLimitOffsetDataSource( + database, + _statement, + count, + "pin_messages", + "messages", + ) { + override fun convertRows(cursor: Cursor?): List = + convertChatHistoryMessageItem(cursor) + } + } + } + } + """.trimIndent(), + source, + ) + } + + @Test + fun rendersRawCursorQuery() { + val source = + QueryFileRenderer().render( + QueryProviderModel( + packageName = "one.mixin.android.db.fetcher", + generatedName = "MessageFetcherGenerated", + functions = emptyList(), + rawCursorFunctions = + listOf( + RawCursorQueryFunctionModel( + name = "loadBottomMessages", + returnType = "List", + returnTypeImports = listOf("one.mixin.android.vo.MessageItem"), + parameters = + listOf( + QueryParameterModel("db", "MixinDatabase"), + QueryParameterModel("conversationId", "String"), + QueryParameterModel("limit", "Int"), + ), + parameterImports = listOf("one.mixin.android.db.MixinDatabase"), + sql = "SELECT * FROM messages WHERE conversation_id = ? LIMIT ?", + bindParameters = listOf("conversationId", "limit"), + databaseParameter = "db", + converterName = "one.mixin.android.db.provider.convertToMessageItems", + ), + ), + ), + ) + + assertEquals( + """ + package one.mixin.android.db.fetcher + + import android.annotation.SuppressLint + import one.mixin.android.db.MixinDatabase + import one.mixin.android.db.provider.convertToMessageItems + import one.mixin.android.vo.MessageItem + + @SuppressLint("RestrictedApi") + object MessageFetcherGenerated { + fun loadBottomMessages( + db: MixinDatabase, + conversationId: String, + limit: Int, + ): List { + val cursor = db.query( + ""${'"'} + SELECT * FROM messages WHERE conversation_id = ? LIMIT ? + ""${'"'}.trimIndent(), + arrayOf(conversationId, limit), + ) + return cursor.use { + convertToMessageItems(it) + } + } + } + """.trimIndent(), + source, + ) + } + + @Test + fun rendersSimpleSQLiteQueryBuilder() { + val source = + QueryFileRenderer().render( + QueryProviderModel( + packageName = "one.mixin.android.ui.wallet", + generatedName = "WalletFilterQueryGenerated", + functions = emptyList(), + simpleQueryFunctions = + listOf( + SimpleSQLiteQueryFunctionModel( + name = "snapshotsQuery", + returnType = "SimpleSQLiteQuery", + returnTypeImports = listOf("androidx.sqlite.db.SimpleSQLiteQuery"), + parameters = + listOf( + QueryParameterModel("whereSql", "String"), + QueryParameterModel("orderSql", "String"), + ), + parameterImports = emptyList(), + sql = "SELECT * FROM snapshots {{whereSql}} {{orderSql}}", + ), + ), + ), + ) + + assertEquals( + """ + package one.mixin.android.ui.wallet + + import android.annotation.SuppressLint + import androidx.sqlite.db.SimpleSQLiteQuery + + @SuppressLint("RestrictedApi") + object WalletFilterQueryGenerated { + fun snapshotsQuery( + whereSql: String, + orderSql: String, + ): SimpleSQLiteQuery = + SimpleSQLiteQuery( + ""${'"'} + SELECT * FROM snapshots ${'$'}whereSql ${'$'}orderSql + ""${'"'}.trimIndent(), + ) + } + """.trimIndent(), + source, + ) + } + + @Test + fun rendersPagingSourceQuery() { + val source = + QueryFileRenderer().render( + QueryProviderModel( + packageName = "one.mixin.android.db.provider", + generatedName = "LimitOrderDataProviderGenerated", + functions = emptyList(), + pagingSourceFunctions = + listOf( + PagingSourceQueryFunctionModel( + name = "allOrders", + returnType = "PagingSource", + returnTypeImports = + listOf( + "androidx.paging.PagingSource", + "one.mixin.android.vo.route.OrderItem", + ), + parameters = + listOf( + QueryParameterModel("database", "WalletDatabase"), + QueryParameterModel("whereSql", "String"), + QueryParameterModel("whereClauseSql", "String"), + QueryParameterModel("orderBySql", "String"), + ), + parameterImports = listOf("one.mixin.android.db.WalletDatabase"), + countSql = "SELECT COUNT(DISTINCT o.rowid) FROM orders o {{whereSql}}", + offsetSql = "SELECT DISTINCT o.rowid FROM orders o {{whereSql}} LIMIT ? OFFSET ?", + querySql = "SELECT * FROM orders o WHERE o.rowid IN ({{ids}}) {{whereClauseSql}} ORDER BY {{orderBySql}}", + tables = listOf("orders"), + databaseParameter = "database", + converterName = "convertToOrderItems", + ), + ), + ), + ) + + assertEquals( + """ + package one.mixin.android.db.provider + + import android.annotation.SuppressLint + import androidx.paging.PagingSource + import androidx.paging.PagingState + import androidx.room.InvalidationTracker + import androidx.room.RoomSQLiteQuery + import androidx.room.paging.util.INITIAL_ITEM_COUNT + import androidx.room.paging.util.INVALID + import androidx.room.paging.util.getClippedRefreshKey + import androidx.room.paging.util.getLimit + import androidx.room.paging.util.getOffset + import androidx.room.withTransaction + import java.util.concurrent.atomic.AtomicInteger + import kotlinx.coroutines.asCoroutineDispatcher + import kotlinx.coroutines.withContext + import one.mixin.android.db.WalletDatabase + import one.mixin.android.vo.route.OrderItem + + @SuppressLint("RestrictedApi") + object LimitOrderDataProviderGenerated { + fun allOrders( + database: WalletDatabase, + whereSql: String, + whereClauseSql: String, + orderBySql: String, + ): PagingSource = + object : PagingSource() { + private val itemCount = AtomicInteger(INITIAL_ITEM_COUNT) + + private val observer = object : InvalidationTracker.Observer(arrayOf("orders")) { + override fun onInvalidated(tables: Set) { + invalidate() + } + } + + init { + database.invalidationTracker.addWeakObserver(observer) + } + + override suspend fun load(params: LoadParams): LoadResult { + return withContext(database.queryExecutor.asCoroutineDispatcher()) { + val tempCount = itemCount.get() + if (tempCount == INITIAL_ITEM_COUNT) { + database.withTransaction { + val count = countItems() + itemCount.set(count) + queryData(params, count) + } + } else { + val loadResult = queryData(params, tempCount) + database.invalidationTracker.refreshVersionsSync() + @Suppress("UNCHECKED_CAST") + if (invalid) INVALID as LoadResult.Invalid else loadResult + } + } + } + + private fun countItems(): Int { + val countStatement = RoomSQLiteQuery.acquire( + ""${'"'} + SELECT COUNT(DISTINCT o.rowid) FROM orders o ${'$'}whereSql + ""${'"'}.trimIndent(), + 0, + ) + val cursor = database.query(countStatement) + return try { + if (cursor.moveToFirst()) cursor.getInt(0) else 0 + } finally { + cursor.close() + countStatement.release() + } + } + + private fun queryData(params: LoadParams, itemCount: Int): LoadResult.Page { + val key = params.key ?: 0 + val limit = getLimit(params, key) + val offset = getOffset(params, key, itemCount) + val offsetStatement = RoomSQLiteQuery.acquire( + ""${'"'} + SELECT DISTINCT o.rowid FROM orders o ${'$'}whereSql LIMIT ? OFFSET ? + ""${'"'}.trimIndent(), + 2, + ) + offsetStatement.bindLong(1, limit.toLong()) + offsetStatement.bindLong(2, offset.toLong()) + val offsetCursor = database.query(offsetStatement) + val ids = mutableListOf() + try { + while (offsetCursor.moveToNext()) { + ids.add("'${'$'}{offsetCursor.getLong(0)}'") + } + } finally { + offsetCursor.close() + offsetStatement.release() + } + val data = if (ids.isEmpty()) { + emptyList() + } else { + val queryStatement = querySqlGenerator(ids.joinToString()) + val cursor = database.query(queryStatement) + try { + convertToOrderItems(cursor) + } finally { + cursor.close() + queryStatement.release() + } + } + val nextPosToLoad = offset + data.size + val nextKey = if (ids.isEmpty() || ids.size < limit || nextPosToLoad >= itemCount) null else nextPosToLoad + val prevKey = if (offset <= 0 || ids.isEmpty()) null else offset + return LoadResult.Page( + data = data, + prevKey = prevKey, + nextKey = nextKey, + itemsBefore = offset, + itemsAfter = maxOf(0, itemCount - nextPosToLoad), + ) + } + + private fun querySqlGenerator(ids: String): RoomSQLiteQuery { + return RoomSQLiteQuery.acquire( + ""${'"'} + SELECT * FROM orders o WHERE o.rowid IN (${'$'}ids) ${'$'}whereClauseSql ORDER BY ${'$'}orderBySql + ""${'"'}.trimIndent(), + 0, + ) + } + + override fun getRefreshKey(state: PagingState): Int? { + return state.getClippedRefreshKey() + } + + override val jumpingSupported: Boolean + get() = true + } + } + """.trimIndent(), + source, + ) + } +} diff --git a/settings.gradle.kts b/settings.gradle.kts index 0e57c8ca3b..1cbdec4b1c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -10,3 +10,4 @@ plugins { } include(":app") +include(":query-codegen") From e2b97927aa197181f1f527d7474ba509ce38f1ea Mon Sep 17 00:00:00 2001 From: SeniorZhai Date: Fri, 3 Jul 2026 09:13:16 +0800 Subject: [PATCH 2/3] chore(db): upgrade to room3 --- app/build.gradle.kts | 22 +- .../2.json | 0 .../3.json | 0 .../12.json | 0 .../13.json | 0 .../14.json | 0 .../15.json | 0 .../16.json | 0 .../17.json | 0 .../18.json | 0 .../19.json | 0 .../20.json | 0 .../21.json | 0 .../22.json | 0 .../23.json | 0 .../24.json | 0 .../25.json | 0 .../26.json | 0 .../27.json | 0 .../28.json | 0 .../29.json | 0 .../30.json | 0 .../31.json | 0 .../32.json | 0 .../33.json | 0 .../34.json | 0 .../35.json | 0 .../36.json | 0 .../37.json | 0 .../38.json | 0 .../39.json | 0 .../40.json | 0 .../41.json | 0 .../42.json | 0 .../43.json | 0 .../44.json | 0 .../45.json | 0 .../46.json | 0 .../47.json | 0 .../48.json | 0 .../49.json | 0 .../50.json | 0 .../51.json | 0 .../52.json | 0 .../53.json | 0 .../54.json | 0 .../55.json | 0 .../56.json | 0 .../57.json | 0 .../58.json | 0 .../59.json | 0 .../60.json | 0 .../61.json | 0 .../62.json | 0 .../63.json | 0 .../64.json | 0 .../65.json | 0 .../66.json | 0 .../67.json | 0 .../68.json | 0 .../69.json | 0 .../70.json | 0 .../one.mixin.android.db.PerpsDatabase/1.json | 0 .../one.mixin.android.db.PerpsDatabase/2.json | 0 .../one.mixin.android.db.PerpsDatabase/3.json | 0 .../one.mixin.android.db.PerpsDatabase/4.json | 0 .../one.mixin.android.db.PerpsDatabase/5.json | 0 .../1.json | 0 .../2.json | 0 .../3.json | 0 .../4.json | 0 .../5.json | 0 .../6.json | 0 .../7.json | 0 .../1.json | 0 .../one.mixin.android.fts.FtsDatabase/1.json | 0 .../2.json | 279 ++ .../3.json | 298 ++ .../12.json | 1075 +++++ .../13.json | 1087 +++++ .../14.json | 1113 ++++++ .../15.json | 1192 ++++++ .../16.json | 1216 ++++++ .../17.json | 1301 ++++++ .../18.json | 1307 ++++++ .../19.json | 1313 ++++++ .../20.json | 1418 +++++++ .../21.json | 1424 +++++++ .../22.json | 1430 +++++++ .../23.json | 1436 +++++++ .../24.json | 1432 +++++++ .../25.json | 1478 +++++++ .../26.json | 1557 ++++++++ .../27.json | 1598 ++++++++ .../28.json | 1651 ++++++++ .../29.json | 1646 ++++++++ .../30.json | 1729 ++++++++ .../31.json | 1741 ++++++++ .../32.json | 1747 ++++++++ .../33.json | 1809 +++++++++ .../34.json | 1823 +++++++++ .../35.json | 1832 +++++++++ .../36.json | 1857 +++++++++ .../37.json | 1841 +++++++++ .../38.json | 2018 ++++++++++ .../39.json | 2049 ++++++++++ .../40.json | 2081 ++++++++++ .../41.json | 2110 ++++++++++ .../42.json | 2116 ++++++++++ .../43.json | 2159 ++++++++++ .../44.json | 2197 ++++++++++ .../45.json | 2203 ++++++++++ .../46.json | 2209 ++++++++++ .../47.json | 2242 +++++++++++ .../48.json | 2286 +++++++++++ .../49.json | 2304 +++++++++++ .../50.json | 2316 +++++++++++ .../51.json | 2814 +++++++++++++ .../52.json | 2826 +++++++++++++ .../53.json | 2849 +++++++++++++ .../54.json | 3021 ++++++++++++++ .../55.json | 3039 ++++++++++++++ .../56.json | 3045 ++++++++++++++ .../57.json | 3051 ++++++++++++++ .../58.json | 3236 +++++++++++++++ .../59.json | 3348 ++++++++++++++++ .../60.json | 3330 +++++++++++++++ .../61.json | 3350 ++++++++++++++++ .../62.json | 3438 ++++++++++++++++ .../63.json | 3445 ++++++++++++++++ .../64.json | 3536 ++++++++++++++++ .../65.json | 3553 +++++++++++++++++ .../66.json | 3418 ++++++++++++++++ .../67.json | 3424 ++++++++++++++++ .../68.json | 3436 ++++++++++++++++ .../69.json | 3346 ++++++++++++++++ .../70.json | 3351 ++++++++++++++++ .../one.mixin.android.db.PerpsDatabase/1.json | 349 ++ .../one.mixin.android.db.PerpsDatabase/2.json | 361 ++ .../one.mixin.android.db.PerpsDatabase/3.json | 383 ++ .../one.mixin.android.db.PerpsDatabase/4.json | 405 ++ .../one.mixin.android.db.PerpsDatabase/5.json | 411 ++ .../1.json | 488 +++ .../2.json | 499 +++ .../3.json | 491 +++ .../4.json | 496 +++ .../5.json | 629 +++ .../6.json | 689 ++++ .../7.json | 767 ++++ .../1.json | 336 ++ .../one.mixin.android.fts.FtsDatabase/1.json | 119 + .../one/mixin/android/db/BaseMigrationTest.kt | 9 +- .../android/db/MigrationTestHelperCompat.kt | 18 + .../mixin/android/db/PerpsMigrationTest.kt | 21 +- .../one/mixin/android/MixinApplication.kt | 5 +- .../android/api/response/MembershipOrder.kt | 12 +- .../android/api/response/perps/PerpsMarket.kt | 10 +- .../android/api/response/perps/PerpsOrder.kt | 6 +- .../api/response/perps/PerpsOrderItem.kt | 2 +- .../api/response/perps/PerpsPosition.kt | 6 +- .../api/response/perps/PerpsPositionItem.kt | 2 +- .../android/api/response/web3/WalletOutput.kt | 6 +- .../mixin/android/crypto/db/IdentityDao.kt | 6 +- .../one/mixin/android/crypto/db/PreKeyDao.kt | 6 +- .../android/crypto/db/RatchetSenderKeyDao.kt | 6 +- .../mixin/android/crypto/db/SenderKeyDao.kt | 6 +- .../one/mixin/android/crypto/db/SessionDao.kt | 6 +- .../mixin/android/crypto/db/SignalDatabase.kt | 15 +- .../android/crypto/db/SignedPreKeyDao.kt | 6 +- .../one/mixin/android/crypto/vo/Identity.kt | 10 +- .../one/mixin/android/crypto/vo/PreKey.kt | 10 +- .../android/crypto/vo/RatchetSenderKey.kt | 4 +- .../one/mixin/android/crypto/vo/SenderKey.kt | 4 +- .../one/mixin/android/crypto/vo/Session.kt | 10 +- .../mixin/android/crypto/vo/SignedPreKey.kt | 8 +- .../java/one/mixin/android/db/AddressDao.kt | 4 +- .../java/one/mixin/android/db/AlertDao.kt | 6 +- .../main/java/one/mixin/android/db/AppDao.kt | 8 +- .../java/one/mixin/android/db/AssetDao.kt | 26 +- .../main/java/one/mixin/android/db/BaseDao.kt | 10 +- .../java/one/mixin/android/db/ChainDao.kt | 4 +- .../mixin/android/db/CircleConversationDao.kt | 6 +- .../java/one/mixin/android/db/CircleDao.kt | 12 +- .../one/mixin/android/db/ConversationDao.kt | 12 +- .../mixin/android/db/ConversationExtDao.kt | 4 +- .../one/mixin/android/db/DatabaseVersion.kt | 10 + .../java/one/mixin/android/db/DepositDao.kt | 6 +- .../one/mixin/android/db/ExpiredMessageDao.kt | 4 +- .../one/mixin/android/db/FavoriteAppDao.kt | 4 +- .../one/mixin/android/db/FloodMessageDao.kt | 4 +- .../one/mixin/android/db/HistoryPriceDao.kt | 4 +- .../java/one/mixin/android/db/HyperlinkDao.kt | 4 +- .../android/db/InscriptionCollectionDao.kt | 4 +- .../one/mixin/android/db/InscriptionDao.kt | 4 +- .../main/java/one/mixin/android/db/JobDao.kt | 4 +- .../one/mixin/android/db/MarketCapRankDao.kt | 6 +- .../one/mixin/android/db/MarketCoinDao.kt | 6 +- .../java/one/mixin/android/db/MarketDao.kt | 8 +- .../one/mixin/android/db/MarketFavoredDao.kt | 2 +- .../mixin/android/db/MembershipOrderDao.kt | 4 +- .../java/one/mixin/android/db/MessageDao.kt | 58 +- .../one/mixin/android/db/MessageHistoryDao.kt | 4 +- .../one/mixin/android/db/MessageMentionDao.kt | 10 +- .../one/mixin/android/db/MixinDatabase.kt | 82 +- .../android/db/MixinDatabaseMigrations.kt | 116 +- .../one/mixin/android/db/MixinOpenHelper.kt | 65 - .../java/one/mixin/android/db/OffsetDao.kt | 6 +- .../java/one/mixin/android/db/OrderDao.kt | 4 +- .../java/one/mixin/android/db/OutputDao.kt | 8 +- .../one/mixin/android/db/ParticipantDao.kt | 8 +- .../mixin/android/db/ParticipantSessionDao.kt | 16 +- .../one/mixin/android/db/PerpsDatabase.kt | 49 +- .../one/mixin/android/db/PinMessageDao.kt | 4 +- .../java/one/mixin/android/db/PropertyDao.kt | 4 +- .../one/mixin/android/db/RawTransactionDao.kt | 4 +- .../android/db/RemoteMessageStatusDao.kt | 6 +- .../android/db/ResendSessionMessageDao.kt | 4 +- .../android/db/RoomDatabaseTransaction.kt | 6 + .../one/mixin/android/db/SafeSnapshotDao.kt | 14 +- .../java/one/mixin/android/db/SnapshotDao.kt | 4 +- .../one/mixin/android/db/StickerAlbumDao.kt | 8 +- .../java/one/mixin/android/db/StickerDao.kt | 6 +- .../android/db/StickerRelationshipDao.kt | 4 +- .../java/one/mixin/android/db/TokenDao.kt | 12 +- .../one/mixin/android/db/TokensExtraDao.kt | 4 +- .../java/one/mixin/android/db/TopAssetDao.kt | 8 +- .../java/one/mixin/android/db/TraceDao.kt | 4 +- .../mixin/android/db/TranscriptMessageDao.kt | 12 +- .../main/java/one/mixin/android/db/UserDao.kt | 16 +- .../one/mixin/android/db/WalletDatabase.kt | 68 +- .../db/converter/AssetChangeListConverter.kt | 6 +- .../db/converter/DepositEntryListConverter.kt | 6 +- .../db/converter/DescriptionsConverter.kt | 6 +- .../db/converter/FiatOrderConverter.kt | 6 +- .../db/converter/LimitOrderConverters.kt | 10 +- .../android/db/converter/ListConverter.java | 6 +- .../db/converter/MembershipConverter.kt | 6 +- .../db/converter/MessageStatusConverter.kt | 6 +- .../db/converter/OptionalListConverter.kt | 6 +- .../db/converter/OutputStateConverter.kt | 6 +- .../db/converter/PriceListConverter.kt | 6 +- .../converter/RawTransactionTypeConverter.kt | 6 +- .../db/converter/SafeChainConverter.kt | 6 +- .../db/converter/SafeDepositConverter.kt | 6 +- .../db/converter/SafeWithdrawalConverter.kt | 6 +- .../android/db/converter/TreasuryConverter.kt | 6 +- .../db/converter/Web3TypeConverters.kt | 18 +- .../WithdrawalMemoPossibilityConverter.kt | 6 +- ...DataSourceFactoryDaoReturnTypeConverter.kt | 94 + .../MixinCountLimitOffsetDataSource.kt | 30 +- .../datasource/MixinLimitOffsetDataSource.kt | 25 +- .../MixinNonCountLimitOffsetDataSource.kt | 30 +- .../NoCountLimitOffsetDataSource.java | 31 +- .../db/datasource/RoomDatabaseCompat.kt | 181 + .../mixin/android/db/datasource/RoomQuery.kt | 93 + .../db/datasource/RoomRawQueryCompat.kt | 19 + .../db/datasource/RoomStatementDatabase.kt | 94 + .../db/datasource/SQLiteConnectionCompat.kt | 62 + .../db/datasource/SQLiteStatementCursor.kt | 95 + .../android/db/pending/PendingDatabase.kt | 11 +- .../android/db/pending/PendingDatabaseImp.kt | 47 +- .../android/db/pending/PendingMessage.kt | 6 +- .../android/db/pending/PendingMessageDao.kt | 8 +- .../mixin/android/db/perps/PerpsMarketDao.kt | 8 +- .../mixin/android/db/perps/PerpsOrderDao.kt | 8 +- .../android/db/perps/PerpsPositionDao.kt | 8 +- .../android/db/provider/DataConverter.kt | 40 +- .../mixin/android/db/provider/DataProvider.kt | 4 +- .../mixin/android/db/web3/SafeWalletsDao.kt | 4 +- .../mixin/android/db/web3/WalletOutputDao.kt | 6 +- .../mixin/android/db/web3/Web3AddressDao.kt | 4 +- .../one/mixin/android/db/web3/Web3ChainDao.kt | 4 +- .../mixin/android/db/web3/Web3PropertyDao.kt | 4 +- .../android/db/web3/Web3RawTransactionDao.kt | 4 +- .../one/mixin/android/db/web3/Web3TokenDao.kt | 10 +- .../android/db/web3/Web3TokensExtraDao.kt | 4 +- .../android/db/web3/Web3TransactionDao.kt | 10 +- .../mixin/android/db/web3/Web3WalletDao.kt | 8 +- .../mixin/android/db/web3/vo/SafeWallets.kt | 6 +- .../mixin/android/db/web3/vo/WalletItem.kt | 2 +- .../mixin/android/db/web3/vo/Web3Address.kt | 6 +- .../one/mixin/android/db/web3/vo/Web3Chain.kt | 6 +- .../android/db/web3/vo/Web3RawTransaction.kt | 10 +- .../one/mixin/android/db/web3/vo/Web3Token.kt | 4 +- .../mixin/android/db/web3/vo/Web3TokenItem.kt | 2 +- .../android/db/web3/vo/Web3TokensExtra.kt | 4 +- .../android/db/web3/vo/Web3Transaction.kt | 16 +- .../android/db/web3/vo/Web3TransactionItem.kt | 10 +- .../mixin/android/db/web3/vo/Web3Wallet.kt | 12 +- .../java/one/mixin/android/di/BaseDbModule.kt | 35 +- .../one/mixin/android/fts/FtsDataSource.kt | 1 + .../java/one/mixin/android/fts/FtsDatabase.kt | 25 +- .../mixin/android/fts/FtsDatabaseExtension.kt | 1 + .../one/mixin/android/fts/FtsQuerySpec.kt | 12 +- .../java/one/mixin/android/fts/MessageFts.kt | 8 +- .../one/mixin/android/fts/MessageFtsDao.kt | 4 +- .../one/mixin/android/fts/MessageMetaDao.kt | 4 +- .../one/mixin/android/fts/MessagesMeta.kt | 8 +- .../mixin/android/job/BlazeMessageService.kt | 60 +- .../one/mixin/android/job/CheckBalanceJob.kt | 4 +- .../android/job/RefreshPerpsPositionsJob.kt | 1 + .../android/job/RestoreTransactionJob.kt | 1 + .../one/mixin/android/messenger/HedwigImp.kt | 41 +- .../repository/ConversationRepository.kt | 1 + .../android/repository/TokenRepository.kt | 24 +- .../android/repository/Web3Repository.kt | 2 +- .../android/ui/common/BottomSheetViewModel.kt | 1 + .../one/mixin/android/ui/home/MainActivity.kt | 2 +- .../home/web3/components/InscriptionState.kt | 2 +- .../android/ui/landing/UpgradeFragment.kt | 1 + .../android/ui/oldwallet/SnapshotItem.kt | 6 +- .../CancellationLimitOffsetDataSource.java | 170 - .../ui/setting/DatabaseDebugFragment.kt | 3 +- .../mixin/android/ui/sticker/AlbumAdapter.kt | 6 +- .../android/ui/transfer/TransferInserter.kt | 5 +- .../transfer/vo/compatible/TransferMessage.kt | 4 +- .../vo/compatible/TransferMessageMention.kt | 2 +- .../mixin/android/ui/wallet/FilterParams.kt | 4 +- .../android/ui/wallet/OrderFilterParams.kt | 4 +- .../ui/wallet/WalletFilterQuerySpec.kt | 16 +- .../android/ui/wallet/Web3FilterParams.kt | 4 +- .../mixin/android/ui/wallet/alert/vo/Alert.kt | 10 +- .../alert/vo/AlertFrequencyConverter.kt | 6 +- .../android/ui/wallet/alert/vo/AlertGroup.kt | 2 +- .../wallet/alert/vo/AlertStatusConverter.kt | 6 +- .../ui/wallet/alert/vo/AlertTypeConverter.kt | 6 +- .../android/ui/wallet/alert/vo/CoinItem.kt | 2 +- .../java/one/mixin/android/util/Converters.kt | 6 +- .../android/util/database/DatabaseUtil.kt | 39 +- .../main/java/one/mixin/android/vo/Address.kt | 8 +- app/src/main/java/one/mixin/android/vo/App.kt | 10 +- .../main/java/one/mixin/android/vo/AppItem.kt | 4 +- .../one/mixin/android/vo/ArrayConverters.java | 6 +- .../main/java/one/mixin/android/vo/Asset.kt | 6 +- .../java/one/mixin/android/vo/AssetsExtra.kt | 6 +- .../mixin/android/vo/AttachmentMigration.kt | 2 +- .../java/one/mixin/android/vo/CallUser.kt | 2 +- .../main/java/one/mixin/android/vo/Chain.kt | 6 +- .../java/one/mixin/android/vo/ChainItem.kt | 2 +- .../main/java/one/mixin/android/vo/Circle.kt | 6 +- .../mixin/android/vo/CircleConversation.kt | 4 +- .../java/one/mixin/android/vo/Conversation.kt | 8 +- .../android/vo/ConversationCircleItem.kt | 2 +- .../vo/ConversationCircleManagerItem.kt | 2 +- .../one/mixin/android/vo/ConversationExt.kt | 6 +- .../one/mixin/android/vo/ConversationItem.kt | 2 +- .../android/vo/ConversationStorageUsage.kt | 4 +- .../android/vo/ConversationWithStatus.kt | 2 +- .../one/mixin/android/vo/ExpiredMessage.kt | 6 +- .../java/one/mixin/android/vo/ExploreApp.kt | 2 +- .../java/one/mixin/android/vo/FavoriteApp.kt | 4 +- .../java/one/mixin/android/vo/FloodMessage.kt | 6 +- .../java/one/mixin/android/vo/ForwardUser.kt | 6 +- .../one/mixin/android/vo/FtsSearchResult.kt | 2 +- .../java/one/mixin/android/vo/GroupInfo.kt | 2 +- .../java/one/mixin/android/vo/Hyperlink.kt | 6 +- .../mixin/android/vo/InscriptionCollection.kt | 8 +- .../one/mixin/android/vo/InscriptionItem.kt | 6 +- app/src/main/java/one/mixin/android/vo/Job.kt | 8 +- .../mixin/android/vo/MediaMessageMinimal.kt | 2 +- .../java/one/mixin/android/vo/MentionUser.kt | 2 +- .../main/java/one/mixin/android/vo/Message.kt | 12 +- .../java/one/mixin/android/vo/MessageFts4.kt | 10 +- .../one/mixin/android/vo/MessageHistory.kt | 6 +- .../java/one/mixin/android/vo/MessageItem.kt | 6 +- .../java/one/mixin/android/vo/MessageMedia.kt | 2 +- .../one/mixin/android/vo/MessageMention.kt | 8 +- .../one/mixin/android/vo/MessageMinimal.kt | 4 +- .../main/java/one/mixin/android/vo/Offset.kt | 6 +- .../one/mixin/android/vo/OldDepositEntry.kt | 2 +- .../java/one/mixin/android/vo/Participant.kt | 8 +- .../mixin/android/vo/ParticipantSession.kt | 4 +- .../android/vo/ParticipantSessionMinimal.kt | 6 +- .../one/mixin/android/vo/PendingDisplay.kt | 2 +- .../java/one/mixin/android/vo/PinMessage.kt | 8 +- .../one/mixin/android/vo/PinMessageItem.kt | 2 +- .../java/one/mixin/android/vo/Property.kt | 6 +- .../one/mixin/android/vo/QuoteMessageItem.kt | 2 +- .../java/one/mixin/android/vo/QuoteMinimal.kt | 4 +- .../one/mixin/android/vo/RecentUsedApp.kt | 2 +- .../java/one/mixin/android/vo/Recipient.kt | 2 +- .../mixin/android/vo/RemoteMessageStatus.kt | 8 +- .../one/mixin/android/vo/ResendMessage.kt | 4 +- .../mixin/android/vo/ResendSessionMessage.kt | 4 +- .../java/one/mixin/android/vo/SearchBot.kt | 2 +- .../one/mixin/android/vo/SentSenderKey.kt | 4 +- .../java/one/mixin/android/vo/Snapshot.kt | 6 +- .../java/one/mixin/android/vo/SnapshotItem.kt | 6 +- .../one/mixin/android/vo/StatusMessage.kt | 2 +- .../main/java/one/mixin/android/vo/Sticker.kt | 6 +- .../java/one/mixin/android/vo/StickerAlbum.kt | 6 +- .../mixin/android/vo/StickerRelationship.kt | 4 +- .../java/one/mixin/android/vo/TokenEntry.kt | 2 +- .../java/one/mixin/android/vo/TopAsset.kt | 6 +- .../java/one/mixin/android/vo/TopAssetItem.kt | 4 +- .../main/java/one/mixin/android/vo/Trace.kt | 6 +- .../vo/TranscriptAttachmentMigration.kt | 2 +- .../one/mixin/android/vo/TranscriptMessage.kt | 4 +- .../main/java/one/mixin/android/vo/User.kt | 10 +- .../java/one/mixin/android/vo/UtxoItem.kt | 2 +- .../android/vo/WalletHomeTokenSummary.kt | 2 +- .../mixin/android/vo/market/HistoryPrice.kt | 4 +- .../one/mixin/android/vo/market/Market.kt | 10 +- .../mixin/android/vo/market/MarketCapRank.kt | 6 +- .../one/mixin/android/vo/market/MarketCoin.kt | 6 +- .../mixin/android/vo/market/MarketFavored.kt | 6 +- .../one/mixin/android/vo/market/MarketItem.kt | 6 +- .../java/one/mixin/android/vo/route/Order.kt | 8 +- .../one/mixin/android/vo/route/OrderItem.kt | 2 +- .../one/mixin/android/vo/safe/DepositEntry.kt | 10 +- .../java/one/mixin/android/vo/safe/Output.kt | 12 +- .../mixin/android/vo/safe/RawTransaction.kt | 8 +- .../mixin/android/vo/safe/SafeCollectible.kt | 2 +- .../mixin/android/vo/safe/SafeColletion.kt | 2 +- .../one/mixin/android/vo/safe/SafeSnapshot.kt | 10 +- .../java/one/mixin/android/vo/safe/Token.kt | 8 +- .../one/mixin/android/vo/safe/TokensExtra.kt | 8 +- .../one/mixin/android/db/MessageDaoTest.kt | 4 +- .../db/fetcher/MessageFetcherAnchorTest.kt | 17 +- build.gradle.kts | 4 +- .../annotation/GeneratedSimpleSQLiteQuery.kt | 7 - .../codegen/processor/QueryFileRenderer.kt | 73 +- .../codegen/processor/QueryProcessor.kt | 12 +- .../processor/QueryFileRendererTest.kt | 79 +- 424 files changed, 141053 insertions(+), 1479 deletions(-) rename app/schemas/{ => googlePlay}/one.mixin.android.crypto.db.SignalDatabase/2.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.crypto.db.SignalDatabase/3.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/12.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/13.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/14.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/15.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/16.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/17.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/18.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/19.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/20.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/21.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/22.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/23.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/24.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/25.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/26.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/27.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/28.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/29.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/30.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/31.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/32.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/33.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/34.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/35.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/36.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/37.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/38.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/39.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/40.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/41.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/42.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/43.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/44.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/45.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/46.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/47.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/48.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/49.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/50.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/51.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/52.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/53.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/54.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/55.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/56.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/57.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/58.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/59.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/60.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/61.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/62.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/63.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/64.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/65.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/66.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/67.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/68.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/69.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.MixinDatabase/70.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.PerpsDatabase/1.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.PerpsDatabase/2.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.PerpsDatabase/3.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.PerpsDatabase/4.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.PerpsDatabase/5.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.WalletDatabase/1.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.WalletDatabase/2.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.WalletDatabase/3.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.WalletDatabase/4.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.WalletDatabase/5.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.WalletDatabase/6.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.WalletDatabase/7.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.db.pending.PendingDataBaseImp/1.json (100%) rename app/schemas/{ => googlePlay}/one.mixin.android.fts.FtsDatabase/1.json (100%) create mode 100644 app/schemas/otherChannel/one.mixin.android.crypto.db.SignalDatabase/2.json create mode 100644 app/schemas/otherChannel/one.mixin.android.crypto.db.SignalDatabase/3.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/12.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/13.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/14.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/15.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/16.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/17.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/18.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/19.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/20.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/21.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/22.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/23.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/24.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/25.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/26.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/27.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/28.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/29.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/30.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/31.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/32.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/33.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/34.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/35.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/36.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/37.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/38.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/39.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/40.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/41.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/42.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/43.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/44.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/45.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/46.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/47.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/48.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/49.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/50.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/51.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/52.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/53.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/54.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/55.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/56.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/57.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/58.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/59.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/60.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/61.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/62.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/63.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/64.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/65.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/66.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/67.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/68.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/69.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/70.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.PerpsDatabase/1.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.PerpsDatabase/2.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.PerpsDatabase/3.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.PerpsDatabase/4.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.PerpsDatabase/5.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/1.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/2.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/3.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/4.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/5.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/6.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/7.json create mode 100644 app/schemas/otherChannel/one.mixin.android.db.pending.PendingDataBaseImp/1.json create mode 100644 app/schemas/otherChannel/one.mixin.android.fts.FtsDatabase/1.json create mode 100644 app/src/androidTest/java/one/mixin/android/db/MigrationTestHelperCompat.kt create mode 100644 app/src/main/java/one/mixin/android/db/DatabaseVersion.kt delete mode 100644 app/src/main/java/one/mixin/android/db/MixinOpenHelper.kt create mode 100644 app/src/main/java/one/mixin/android/db/RoomDatabaseTransaction.kt create mode 100644 app/src/main/java/one/mixin/android/db/datasource/DataSourceFactoryDaoReturnTypeConverter.kt create mode 100644 app/src/main/java/one/mixin/android/db/datasource/RoomDatabaseCompat.kt create mode 100644 app/src/main/java/one/mixin/android/db/datasource/RoomQuery.kt create mode 100644 app/src/main/java/one/mixin/android/db/datasource/RoomRawQueryCompat.kt create mode 100644 app/src/main/java/one/mixin/android/db/datasource/RoomStatementDatabase.kt create mode 100644 app/src/main/java/one/mixin/android/db/datasource/SQLiteConnectionCompat.kt create mode 100644 app/src/main/java/one/mixin/android/db/datasource/SQLiteStatementCursor.kt delete mode 100644 app/src/main/java/one/mixin/android/ui/search/CancellationLimitOffsetDataSource.java delete mode 100644 query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedSimpleSQLiteQuery.kt diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 4d0968c017..e6bfc3c640 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -4,6 +4,7 @@ plugins { id("org.jetbrains.kotlin.plugin.parcelize") id("de.undercouch.download") id("com.google.devtools.ksp") + id("androidx.room3") id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") id("org.jetbrains.kotlin.plugin.serialization") id("org.jetbrains.kotlin.plugin.compose") version "2.4.0" @@ -29,6 +30,7 @@ val pagingVersion: String by rootProject.extra val coilVersion: String by rootProject.extra val collectionx: String by rootProject.extra val roomVersion: String by rootProject.extra +val sqliteVersion: String by rootProject.extra val navigationVersion: String by rootProject.extra val workManagerVersion: String by rootProject.extra val constraintLayoutVersion: String by rootProject.extra @@ -192,7 +194,7 @@ android { } getByName("androidTest") { java.directories.add(sharedTestDir) - assets.directories.add("$projectDir/schemas") + assets.directories.add("$projectDir/schemas/googlePlay") } } @@ -320,9 +322,9 @@ bugsnag { uploadNdkMappings = false } -ksp { - arg("room.schemaLocation", "$projectDir/schemas") - arg("room.incremental", "true") +room3 { + schemaDirectory("googlePlay", "$projectDir/schemas/googlePlay") + schemaDirectory("otherChannel", "$projectDir/schemas/otherChannel") } dependencies { @@ -380,14 +382,14 @@ dependencies { implementation("androidx.lifecycle:lifecycle-service:$lifecycleVersion") implementation("androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion") implementation("androidx.lifecycle:lifecycle-process:$lifecycleVersion") - implementation("androidx.room:room-runtime:$roomVersion") - implementation("androidx.room:room-paging:$roomVersion") + implementation("androidx.room3:room3-runtime:$roomVersion") + implementation("androidx.room3:room3-paging:$roomVersion") + implementation("androidx.room3:room3-livedata:$roomVersion") + implementation("androidx.sqlite:sqlite-framework:$sqliteVersion") compileOnly(project(":query-codegen")) ksp(project(":query-codegen")) - ksp("androidx.room:room-compiler:$roomVersion") - implementation("androidx.room:room-rxjava2:$roomVersion") - implementation("androidx.room:room-ktx:$roomVersion") - androidTestImplementation("androidx.room:room-testing:$roomVersion") + ksp("androidx.room3:room3-compiler:$roomVersion") + androidTestImplementation("androidx.room3:room3-testing:$roomVersion") // media3 implementation("androidx.media3:media3-exoplayer:$media3Version") diff --git a/app/schemas/one.mixin.android.crypto.db.SignalDatabase/2.json b/app/schemas/googlePlay/one.mixin.android.crypto.db.SignalDatabase/2.json similarity index 100% rename from app/schemas/one.mixin.android.crypto.db.SignalDatabase/2.json rename to app/schemas/googlePlay/one.mixin.android.crypto.db.SignalDatabase/2.json diff --git a/app/schemas/one.mixin.android.crypto.db.SignalDatabase/3.json b/app/schemas/googlePlay/one.mixin.android.crypto.db.SignalDatabase/3.json similarity index 100% rename from app/schemas/one.mixin.android.crypto.db.SignalDatabase/3.json rename to app/schemas/googlePlay/one.mixin.android.crypto.db.SignalDatabase/3.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/12.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/12.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/12.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/12.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/13.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/13.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/13.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/13.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/14.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/14.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/14.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/14.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/15.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/15.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/15.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/15.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/16.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/16.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/16.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/16.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/17.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/17.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/17.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/17.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/18.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/18.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/18.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/18.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/19.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/19.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/19.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/19.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/20.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/20.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/20.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/20.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/21.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/21.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/21.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/21.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/22.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/22.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/22.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/22.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/23.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/23.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/23.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/23.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/24.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/24.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/24.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/24.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/25.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/25.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/25.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/25.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/26.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/26.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/26.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/26.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/27.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/27.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/27.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/27.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/28.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/28.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/28.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/28.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/29.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/29.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/29.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/29.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/30.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/30.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/30.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/30.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/31.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/31.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/31.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/31.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/32.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/32.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/32.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/32.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/33.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/33.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/33.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/33.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/34.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/34.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/34.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/34.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/35.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/35.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/35.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/35.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/36.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/36.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/36.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/36.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/37.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/37.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/37.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/37.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/38.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/38.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/38.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/38.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/39.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/39.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/39.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/39.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/40.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/40.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/40.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/40.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/41.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/41.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/41.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/41.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/42.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/42.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/42.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/42.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/43.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/43.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/43.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/43.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/44.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/44.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/44.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/44.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/45.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/45.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/45.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/45.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/46.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/46.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/46.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/46.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/47.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/47.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/47.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/47.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/48.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/48.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/48.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/48.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/49.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/49.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/49.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/49.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/50.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/50.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/50.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/50.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/51.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/51.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/51.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/51.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/52.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/52.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/52.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/52.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/53.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/53.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/53.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/53.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/54.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/54.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/54.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/54.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/55.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/55.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/55.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/55.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/56.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/56.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/56.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/56.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/57.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/57.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/57.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/57.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/58.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/58.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/58.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/58.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/59.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/59.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/59.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/59.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/60.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/60.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/60.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/60.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/61.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/61.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/61.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/61.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/62.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/62.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/62.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/62.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/63.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/63.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/63.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/63.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/64.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/64.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/64.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/64.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/65.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/65.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/65.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/65.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/66.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/66.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/66.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/66.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/67.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/67.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/67.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/67.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/68.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/68.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/68.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/68.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/69.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/69.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/69.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/69.json diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/70.json b/app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/70.json similarity index 100% rename from app/schemas/one.mixin.android.db.MixinDatabase/70.json rename to app/schemas/googlePlay/one.mixin.android.db.MixinDatabase/70.json diff --git a/app/schemas/one.mixin.android.db.PerpsDatabase/1.json b/app/schemas/googlePlay/one.mixin.android.db.PerpsDatabase/1.json similarity index 100% rename from app/schemas/one.mixin.android.db.PerpsDatabase/1.json rename to app/schemas/googlePlay/one.mixin.android.db.PerpsDatabase/1.json diff --git a/app/schemas/one.mixin.android.db.PerpsDatabase/2.json b/app/schemas/googlePlay/one.mixin.android.db.PerpsDatabase/2.json similarity index 100% rename from app/schemas/one.mixin.android.db.PerpsDatabase/2.json rename to app/schemas/googlePlay/one.mixin.android.db.PerpsDatabase/2.json diff --git a/app/schemas/one.mixin.android.db.PerpsDatabase/3.json b/app/schemas/googlePlay/one.mixin.android.db.PerpsDatabase/3.json similarity index 100% rename from app/schemas/one.mixin.android.db.PerpsDatabase/3.json rename to app/schemas/googlePlay/one.mixin.android.db.PerpsDatabase/3.json diff --git a/app/schemas/one.mixin.android.db.PerpsDatabase/4.json b/app/schemas/googlePlay/one.mixin.android.db.PerpsDatabase/4.json similarity index 100% rename from app/schemas/one.mixin.android.db.PerpsDatabase/4.json rename to app/schemas/googlePlay/one.mixin.android.db.PerpsDatabase/4.json diff --git a/app/schemas/one.mixin.android.db.PerpsDatabase/5.json b/app/schemas/googlePlay/one.mixin.android.db.PerpsDatabase/5.json similarity index 100% rename from app/schemas/one.mixin.android.db.PerpsDatabase/5.json rename to app/schemas/googlePlay/one.mixin.android.db.PerpsDatabase/5.json diff --git a/app/schemas/one.mixin.android.db.WalletDatabase/1.json b/app/schemas/googlePlay/one.mixin.android.db.WalletDatabase/1.json similarity index 100% rename from app/schemas/one.mixin.android.db.WalletDatabase/1.json rename to app/schemas/googlePlay/one.mixin.android.db.WalletDatabase/1.json diff --git a/app/schemas/one.mixin.android.db.WalletDatabase/2.json b/app/schemas/googlePlay/one.mixin.android.db.WalletDatabase/2.json similarity index 100% rename from app/schemas/one.mixin.android.db.WalletDatabase/2.json rename to app/schemas/googlePlay/one.mixin.android.db.WalletDatabase/2.json diff --git a/app/schemas/one.mixin.android.db.WalletDatabase/3.json b/app/schemas/googlePlay/one.mixin.android.db.WalletDatabase/3.json similarity index 100% rename from app/schemas/one.mixin.android.db.WalletDatabase/3.json rename to app/schemas/googlePlay/one.mixin.android.db.WalletDatabase/3.json diff --git a/app/schemas/one.mixin.android.db.WalletDatabase/4.json b/app/schemas/googlePlay/one.mixin.android.db.WalletDatabase/4.json similarity index 100% rename from app/schemas/one.mixin.android.db.WalletDatabase/4.json rename to app/schemas/googlePlay/one.mixin.android.db.WalletDatabase/4.json diff --git a/app/schemas/one.mixin.android.db.WalletDatabase/5.json b/app/schemas/googlePlay/one.mixin.android.db.WalletDatabase/5.json similarity index 100% rename from app/schemas/one.mixin.android.db.WalletDatabase/5.json rename to app/schemas/googlePlay/one.mixin.android.db.WalletDatabase/5.json diff --git a/app/schemas/one.mixin.android.db.WalletDatabase/6.json b/app/schemas/googlePlay/one.mixin.android.db.WalletDatabase/6.json similarity index 100% rename from app/schemas/one.mixin.android.db.WalletDatabase/6.json rename to app/schemas/googlePlay/one.mixin.android.db.WalletDatabase/6.json diff --git a/app/schemas/one.mixin.android.db.WalletDatabase/7.json b/app/schemas/googlePlay/one.mixin.android.db.WalletDatabase/7.json similarity index 100% rename from app/schemas/one.mixin.android.db.WalletDatabase/7.json rename to app/schemas/googlePlay/one.mixin.android.db.WalletDatabase/7.json diff --git a/app/schemas/one.mixin.android.db.pending.PendingDataBaseImp/1.json b/app/schemas/googlePlay/one.mixin.android.db.pending.PendingDataBaseImp/1.json similarity index 100% rename from app/schemas/one.mixin.android.db.pending.PendingDataBaseImp/1.json rename to app/schemas/googlePlay/one.mixin.android.db.pending.PendingDataBaseImp/1.json diff --git a/app/schemas/one.mixin.android.fts.FtsDatabase/1.json b/app/schemas/googlePlay/one.mixin.android.fts.FtsDatabase/1.json similarity index 100% rename from app/schemas/one.mixin.android.fts.FtsDatabase/1.json rename to app/schemas/googlePlay/one.mixin.android.fts.FtsDatabase/1.json diff --git a/app/schemas/otherChannel/one.mixin.android.crypto.db.SignalDatabase/2.json b/app/schemas/otherChannel/one.mixin.android.crypto.db.SignalDatabase/2.json new file mode 100644 index 0000000000..134da8090f --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.crypto.db.SignalDatabase/2.json @@ -0,0 +1,279 @@ +{ + "formatVersion": 1, + "database": { + "version": 2, + "identityHash": "5d2c36d918e9fb304b0b87bc89ab8ba5", + "entities": [ + { + "tableName": "sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`group_id` TEXT NOT NULL, `sender_id` TEXT NOT NULL, `record` BLOB NOT NULL, PRIMARY KEY(`group_id`, `sender_id`))", + "fields": [ + { + "fieldPath": "groupId", + "columnName": "group_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "senderId", + "columnName": "sender_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "record", + "columnName": "record", + "affinity": "BLOB", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "group_id", + "sender_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "identities", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `address` TEXT NOT NULL, `registration_id` INTEGER, `public_key` BLOB NOT NULL, `private_key` BLOB, `next_prekey_id` INTEGER, `timestamp` INTEGER NOT NULL)", + "fields": [ + { + "fieldPath": "_id", + "columnName": "_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "address", + "columnName": "address", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "registrationId", + "columnName": "registration_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "BLOB", + "notNull": true + }, + { + "fieldPath": "privateKey", + "columnName": "private_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "nextPreKeyId", + "columnName": "next_prekey_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "_id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_identities_address", + "unique": true, + "columnNames": [ + "address" + ], + "createSql": "CREATE UNIQUE INDEX `index_identities_address` ON `${TABLE_NAME}` (`address`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "prekeys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `prekey_id` INTEGER NOT NULL, `record` BLOB NOT NULL)", + "fields": [ + { + "fieldPath": "_id", + "columnName": "_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "preKeyId", + "columnName": "prekey_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "record", + "columnName": "record", + "affinity": "BLOB", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "_id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_prekeys_prekey_id", + "unique": true, + "columnNames": [ + "prekey_id" + ], + "createSql": "CREATE UNIQUE INDEX `index_prekeys_prekey_id` ON `${TABLE_NAME}` (`prekey_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "signed_prekeys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `prekey_id` INTEGER NOT NULL, `record` BLOB NOT NULL, `timestamp` INTEGER NOT NULL)", + "fields": [ + { + "fieldPath": "_id", + "columnName": "_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "preKeyId", + "columnName": "prekey_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "record", + "columnName": "record", + "affinity": "BLOB", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "_id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_signed_prekeys_prekey_id", + "unique": true, + "columnNames": [ + "prekey_id" + ], + "createSql": "CREATE UNIQUE INDEX `index_signed_prekeys_prekey_id` ON `${TABLE_NAME}` (`prekey_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "sessions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `address` TEXT NOT NULL, `record` BLOB NOT NULL, `timestamp` INTEGER NOT NULL)", + "fields": [ + { + "fieldPath": "_id", + "columnName": "_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "address", + "columnName": "address", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "record", + "columnName": "record", + "affinity": "BLOB", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "_id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_sessions_address", + "unique": true, + "columnNames": [ + "address" + ], + "createSql": "CREATE UNIQUE INDEX `index_sessions_address` ON `${TABLE_NAME}` (`address`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "ratchet_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`group_id` TEXT NOT NULL, `sender_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`group_id`, `sender_id`))", + "fields": [ + { + "fieldPath": "groupId", + "columnName": "group_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "senderId", + "columnName": "sender_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "group_id", + "sender_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + } + ], + "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, \"5d2c36d918e9fb304b0b87bc89ab8ba5\")" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.crypto.db.SignalDatabase/3.json b/app/schemas/otherChannel/one.mixin.android.crypto.db.SignalDatabase/3.json new file mode 100644 index 0000000000..16c01c2a66 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.crypto.db.SignalDatabase/3.json @@ -0,0 +1,298 @@ +{ + "formatVersion": 1, + "database": { + "version": 3, + "identityHash": "fc0de28023184ca8fa8f5ff934444bdc", + "entities": [ + { + "tableName": "sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`group_id` TEXT NOT NULL, `sender_id` TEXT NOT NULL, `record` BLOB NOT NULL, PRIMARY KEY(`group_id`, `sender_id`))", + "fields": [ + { + "fieldPath": "groupId", + "columnName": "group_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "senderId", + "columnName": "sender_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "record", + "columnName": "record", + "affinity": "BLOB", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "group_id", + "sender_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "identities", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `address` TEXT NOT NULL, `registration_id` INTEGER, `public_key` BLOB NOT NULL, `private_key` BLOB, `next_prekey_id` INTEGER, `timestamp` INTEGER NOT NULL)", + "fields": [ + { + "fieldPath": "_id", + "columnName": "_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "address", + "columnName": "address", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "registrationId", + "columnName": "registration_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "BLOB", + "notNull": true + }, + { + "fieldPath": "privateKey", + "columnName": "private_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "nextPreKeyId", + "columnName": "next_prekey_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "_id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_identities_address", + "unique": true, + "columnNames": [ + "address" + ], + "createSql": "CREATE UNIQUE INDEX `index_identities_address` ON `${TABLE_NAME}` (`address`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "prekeys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `prekey_id` INTEGER NOT NULL, `record` BLOB NOT NULL)", + "fields": [ + { + "fieldPath": "_id", + "columnName": "_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "preKeyId", + "columnName": "prekey_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "record", + "columnName": "record", + "affinity": "BLOB", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "_id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_prekeys_prekey_id", + "unique": true, + "columnNames": [ + "prekey_id" + ], + "createSql": "CREATE UNIQUE INDEX `index_prekeys_prekey_id` ON `${TABLE_NAME}` (`prekey_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "signed_prekeys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `prekey_id` INTEGER NOT NULL, `record` BLOB NOT NULL, `timestamp` INTEGER NOT NULL)", + "fields": [ + { + "fieldPath": "_id", + "columnName": "_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "preKeyId", + "columnName": "prekey_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "record", + "columnName": "record", + "affinity": "BLOB", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "_id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_signed_prekeys_prekey_id", + "unique": true, + "columnNames": [ + "prekey_id" + ], + "createSql": "CREATE UNIQUE INDEX `index_signed_prekeys_prekey_id` ON `${TABLE_NAME}` (`prekey_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "sessions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `address` TEXT NOT NULL, `device` INTEGER NOT NULL, `record` BLOB NOT NULL, `timestamp` INTEGER NOT NULL)", + "fields": [ + { + "fieldPath": "_id", + "columnName": "_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "address", + "columnName": "address", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "device", + "columnName": "device", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "record", + "columnName": "record", + "affinity": "BLOB", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "_id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_sessions_address_device", + "unique": true, + "columnNames": [ + "address", + "device" + ], + "createSql": "CREATE UNIQUE INDEX `index_sessions_address_device` ON `${TABLE_NAME}` (`address`, `device`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "ratchet_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`group_id` TEXT NOT NULL, `sender_id` TEXT NOT NULL, `status` TEXT NOT NULL, `message_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`group_id`, `sender_id`))", + "fields": [ + { + "fieldPath": "groupId", + "columnName": "group_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "senderId", + "columnName": "sender_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "group_id", + "sender_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + } + ], + "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, \"fc0de28023184ca8fa8f5ff934444bdc\")" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/12.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/12.json new file mode 100644 index 0000000000..c57d0fc0d1 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/12.json @@ -0,0 +1,1075 @@ +{ + "formatVersion": 1, + "database": { + "version": 12, + "identityHash": "41ab8b53c9692daaea2ce924f7a86a11", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_conversation_id", + "unique": true, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE UNIQUE INDEX `index_conversations_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_conversations_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_conversations_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mine_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `shared_user_id` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX `index_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_messages_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_messages_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `public_key` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `counter_user_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "counterUserId", + "columnName": "counter_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`album_id`, `name`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "name" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilites` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "icon_url", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilites", + "columnName": "capabilites", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `public_key` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + } + ], + "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, \"41ab8b53c9692daaea2ce924f7a86a11\")" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/13.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/13.json new file mode 100644 index 0000000000..f47a9bb25b --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/13.json @@ -0,0 +1,1087 @@ +{ + "formatVersion": 1, + "database": { + "version": 13, + "identityHash": "19a52f4d62a8892daeb8a1e519ce8049", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_conversation_id", + "unique": true, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE UNIQUE INDEX `index_conversations_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_conversations_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_conversations_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_mine_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `shared_user_id` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX `index_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_messages_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_messages_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `public_key` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `counter_user_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "counterUserId", + "columnName": "counter_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`album_id`, `name`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "name" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilites` TEXT, `creator_id` TEXT NOT NULL, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "icon_url", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilites", + "columnName": "capabilites", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `public_key` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + } + ], + "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, \"19a52f4d62a8892daeb8a1e519ce8049\")" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/14.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/14.json new file mode 100644 index 0000000000..0ca8dea241 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/14.json @@ -0,0 +1,1113 @@ +{ + "formatVersion": 1, + "database": { + "version": 14, + "identityHash": "39ba2b540583e7dba5e2ee86c9019247", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_conversation_id", + "unique": true, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE UNIQUE INDEX `index_conversations_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_conversations_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_conversations_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quote_message_id", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quote_content", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX `index_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_messages_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_messages_created_at` ON `${TABLE_NAME}` (`created_at`)" + }, + { + "name": "index_messages_user_id", + "unique": false, + "columnNames": [ + "user_id" + ], + "createSql": "CREATE INDEX `index_messages_user_id` ON `${TABLE_NAME}` (`user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `public_key` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `counter_user_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "counterUserId", + "columnName": "counter_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`album_id`, `name`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "name" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilites` TEXT, `creator_id` TEXT NOT NULL, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "icon_url", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilites", + "columnName": "capabilites", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `public_key` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + } + ], + "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, \"39ba2b540583e7dba5e2ee86c9019247\")" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/15.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/15.json new file mode 100644 index 0000000000..dc2a2d4dfc --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/15.json @@ -0,0 +1,1192 @@ +{ + "formatVersion": 1, + "database": { + "version": 15, + "identityHash": "b2187be3d58934469f2210dfadc7c3a2", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_conversation_id", + "unique": true, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE UNIQUE INDEX `index_conversations_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_conversations_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_conversations_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quote_message_id", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quote_content", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_user_id", + "unique": false, + "columnNames": [ + "user_id" + ], + "createSql": "CREATE INDEX `index_messages_user_id` ON `${TABLE_NAME}` (`user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `public_key` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `hidden` INTEGER, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `counter_user_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "counterUserId", + "columnName": "counter_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilites` TEXT, `creator_id` TEXT NOT NULL, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "icon_url", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilites", + "columnName": "capabilites", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `public_key` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + } + ], + "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, \"b2187be3d58934469f2210dfadc7c3a2\")" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/16.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/16.json new file mode 100644 index 0000000000..6ae13664de --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/16.json @@ -0,0 +1,1216 @@ +{ + "formatVersion": 1, + "database": { + "version": 16, + "identityHash": "45a7cf0fd94f05a9fb4ecf40d2287f63", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_conversation_id", + "unique": true, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE UNIQUE INDEX `index_conversations_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_conversations_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_conversations_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_user_id", + "unique": false, + "columnNames": [ + "user_id" + ], + "createSql": "CREATE INDEX `index_messages_user_id` ON `${TABLE_NAME}` (`user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `public_key` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `hidden` INTEGER, `confirmations` INTEGER NOT NULL, `account_name` TEXT, `account_tag` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "accountName", + "columnName": "account_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "accountTag", + "columnName": "account_tag", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `counter_user_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "counterUserId", + "columnName": "counter_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilites` TEXT, `creator_id` TEXT NOT NULL, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "icon_url", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilites", + "columnName": "capabilites", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `public_key` TEXT, `label` TEXT, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `account_name` TEXT, `account_tag` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "accountName", + "columnName": "account_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "accountTag", + "columnName": "account_tag", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + } + ], + "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, \"45a7cf0fd94f05a9fb4ecf40d2287f63\")" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/17.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/17.json new file mode 100644 index 0000000000..68a8642419 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/17.json @@ -0,0 +1,1301 @@ +{ + "formatVersion": 1, + "database": { + "version": 17, + "identityHash": "9fa191529af7a523a7057e10603a0a16", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_conversation_id", + "unique": true, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE UNIQUE INDEX `index_conversations_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_conversations_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_conversations_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_user_id", + "unique": false, + "columnNames": [ + "user_id" + ], + "createSql": "CREATE INDEX `index_messages_user_id` ON `${TABLE_NAME}` (`user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `public_key` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `hidden` INTEGER, `confirmations` INTEGER NOT NULL, `account_name` TEXT, `account_tag` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "accountName", + "columnName": "account_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "accountTag", + "columnName": "account_tag", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `counter_user_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "counterUserId", + "columnName": "counter_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilites` TEXT, `creator_id` TEXT NOT NULL, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "icon_url", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilites", + "columnName": "capabilites", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `public_key` TEXT, `label` TEXT, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `account_name` TEXT, `account_tag` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "accountName", + "columnName": "account_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "accountTag", + "columnName": "account_tag", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + } + ], + "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, \"9fa191529af7a523a7057e10603a0a16\")" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/18.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/18.json new file mode 100644 index 0000000000..ff08a777b0 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/18.json @@ -0,0 +1,1307 @@ +{ + "formatVersion": 1, + "database": { + "version": 18, + "identityHash": "209dba16ec8b5396ec12e98668fdca7b", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_conversation_id", + "unique": true, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE UNIQUE INDEX `index_conversations_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_conversations_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_conversations_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_user_id", + "unique": false, + "columnNames": [ + "user_id" + ], + "createSql": "CREATE INDEX `index_messages_user_id` ON `${TABLE_NAME}` (`user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `public_key` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `hidden` INTEGER, `confirmations` INTEGER NOT NULL, `account_name` TEXT, `account_tag` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "accountName", + "columnName": "account_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "accountTag", + "columnName": "account_tag", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `counter_user_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "counterUserId", + "columnName": "counter_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilites` TEXT, `creator_id` TEXT NOT NULL, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "icon_url", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilites", + "columnName": "capabilites", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `public_key` TEXT, `label` TEXT, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `account_name` TEXT, `account_tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "accountName", + "columnName": "account_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "accountTag", + "columnName": "account_tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + } + ], + "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, \"209dba16ec8b5396ec12e98668fdca7b\")" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/19.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/19.json new file mode 100644 index 0000000000..3b2cfbda44 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/19.json @@ -0,0 +1,1313 @@ +{ + "formatVersion": 1, + "database": { + "version": 19, + "identityHash": "a5bb4942506a74d8fcbceeba1b511adc", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_conversation_id", + "unique": true, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE UNIQUE INDEX `index_conversations_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_conversations_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_conversations_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_user_id", + "unique": false, + "columnNames": [ + "user_id" + ], + "createSql": "CREATE INDEX `index_messages_user_id` ON `${TABLE_NAME}` (`user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `public_key` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `hidden` INTEGER, `confirmations` INTEGER NOT NULL, `account_name` TEXT, `account_tag` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "accountName", + "columnName": "account_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "accountTag", + "columnName": "account_tag", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `counter_user_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "counterUserId", + "columnName": "counter_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilites` TEXT, `creator_id` TEXT NOT NULL, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "icon_url", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilites", + "columnName": "capabilites", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `public_key` TEXT, `label` TEXT, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `account_name` TEXT, `account_tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "accountName", + "columnName": "account_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "accountTag", + "columnName": "account_tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + } + ], + "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, \"a5bb4942506a74d8fcbceeba1b511adc\")" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/20.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/20.json new file mode 100644 index 0000000000..2829d75c19 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/20.json @@ -0,0 +1,1418 @@ +{ + "formatVersion": 1, + "database": { + "version": 20, + "identityHash": "c08fa0d306346f1fe3b367e69b7574a2", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_conversation_id", + "unique": true, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE UNIQUE INDEX `index_conversations_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_conversations_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_conversations_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_user_id", + "unique": false, + "columnNames": [ + "user_id" + ], + "createSql": "CREATE INDEX `index_messages_user_id` ON `${TABLE_NAME}` (`user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `public_key` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `hidden` INTEGER, `confirmations` INTEGER NOT NULL, `account_name` TEXT, `account_tag` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "accountName", + "columnName": "account_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "accountTag", + "columnName": "account_tag", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `counter_user_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "counterUserId", + "columnName": "counter_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilites` TEXT, `creator_id` TEXT NOT NULL, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "icon_url", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilites", + "columnName": "capabilites", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `public_key` TEXT, `label` TEXT, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `account_name` TEXT, `account_tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "accountName", + "columnName": "account_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "accountTag", + "columnName": "account_tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `public_key` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `account_name` TEXT, `account_tag` TEXT, `capitalization` REAL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "accountName", + "columnName": "account_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "accountTag", + "columnName": "account_tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "capitalization", + "columnName": "capitalization", + "affinity": "REAL", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "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, \"c08fa0d306346f1fe3b367e69b7574a2\")" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/21.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/21.json new file mode 100644 index 0000000000..fc62496969 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/21.json @@ -0,0 +1,1424 @@ +{ + "formatVersion": 1, + "database": { + "version": 21, + "identityHash": "d772a00617e291e08fabdd10c3340332", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_conversation_id", + "unique": true, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE UNIQUE INDEX `index_conversations_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_conversations_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_conversations_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_user_id", + "unique": false, + "columnNames": [ + "user_id" + ], + "createSql": "CREATE INDEX `index_messages_user_id` ON `${TABLE_NAME}` (`user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `public_key` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `hidden` INTEGER, `confirmations` INTEGER NOT NULL, `account_name` TEXT, `account_tag` TEXT, `asset_key` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "accountName", + "columnName": "account_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "accountTag", + "columnName": "account_tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `counter_user_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "counterUserId", + "columnName": "counter_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilites` TEXT, `creator_id` TEXT NOT NULL, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "icon_url", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilites", + "columnName": "capabilites", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `public_key` TEXT, `label` TEXT, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `account_name` TEXT, `account_tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "accountName", + "columnName": "account_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "accountTag", + "columnName": "account_tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `public_key` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `account_name` TEXT, `account_tag` TEXT, `capitalization` REAL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "accountName", + "columnName": "account_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "accountTag", + "columnName": "account_tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "capitalization", + "columnName": "capitalization", + "affinity": "REAL", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "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, \"d772a00617e291e08fabdd10c3340332\")" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/22.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/22.json new file mode 100644 index 0000000000..44667cb3f3 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/22.json @@ -0,0 +1,1430 @@ +{ + "formatVersion": 1, + "database": { + "version": 22, + "identityHash": "0634b2e1de83b6ae7819fc2a1216b857", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_conversation_id", + "unique": true, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE UNIQUE INDEX `index_conversations_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_conversations_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_conversations_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `thumb_url` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_user_id", + "unique": false, + "columnNames": [ + "user_id" + ], + "createSql": "CREATE INDEX `index_messages_user_id` ON `${TABLE_NAME}` (`user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `public_key` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `hidden` INTEGER, `confirmations` INTEGER NOT NULL, `account_name` TEXT, `account_tag` TEXT, `asset_key` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "accountName", + "columnName": "account_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "accountTag", + "columnName": "account_tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `counter_user_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "counterUserId", + "columnName": "counter_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilites` TEXT, `creator_id` TEXT NOT NULL, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "icon_url", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilites", + "columnName": "capabilites", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `public_key` TEXT, `label` TEXT, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `account_name` TEXT, `account_tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "accountName", + "columnName": "account_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "accountTag", + "columnName": "account_tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `public_key` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `account_name` TEXT, `account_tag` TEXT, `capitalization` REAL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "accountName", + "columnName": "account_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "accountTag", + "columnName": "account_tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "capitalization", + "columnName": "capitalization", + "affinity": "REAL", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "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, '0634b2e1de83b6ae7819fc2a1216b857')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/23.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/23.json new file mode 100644 index 0000000000..a8613747d4 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/23.json @@ -0,0 +1,1436 @@ +{ + "formatVersion": 1, + "database": { + "version": 23, + "identityHash": "e4fd5402d97c1023b4d15ab85235019b", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `biography` TEXT NOT NULL, `has_pin` INTEGER, `app_id` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_conversation_id", + "unique": true, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_conversations_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_conversations_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_user_id", + "unique": false, + "columnNames": [ + "user_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_user_id` ON `${TABLE_NAME}` (`user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `public_key` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `hidden` INTEGER, `confirmations` INTEGER NOT NULL, `account_name` TEXT, `account_tag` TEXT, `asset_key` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "accountName", + "columnName": "account_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "accountTag", + "columnName": "account_tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `counter_user_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "counterUserId", + "columnName": "counter_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilites` TEXT, `creator_id` TEXT NOT NULL, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "icon_url", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilites", + "columnName": "capabilites", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `public_key` TEXT, `label` TEXT, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `account_name` TEXT, `account_tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "accountName", + "columnName": "account_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "accountTag", + "columnName": "account_tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `public_key` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `account_name` TEXT, `account_tag` TEXT, `capitalization` REAL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "accountName", + "columnName": "account_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "accountTag", + "columnName": "account_tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "capitalization", + "columnName": "capitalization", + "affinity": "REAL", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "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, 'e4fd5402d97c1023b4d15ab85235019b')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/24.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/24.json new file mode 100644 index 0000000000..55d864f21d --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/24.json @@ -0,0 +1,1432 @@ +{ + "formatVersion": 1, + "database": { + "version": 24, + "identityHash": "c43048823b67964e1de0a5a4f67eeadb", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_conversation_id", + "unique": true, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_conversations_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_conversations_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_user_id", + "unique": false, + "columnNames": [ + "user_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_user_id` ON `${TABLE_NAME}` (`user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `counter_user_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "counterUserId", + "columnName": "counter_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilites` TEXT, `creator_id` TEXT NOT NULL, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "icon_url", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilites", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "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, 'c43048823b67964e1de0a5a4f67eeadb')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/25.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/25.json new file mode 100644 index 0000000000..7bd544f0d7 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/25.json @@ -0,0 +1,1478 @@ +{ + "formatVersion": 1, + "database": { + "version": 25, + "identityHash": "ed438aa13171c4f7eac153440c70ffcc", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_conversation_id", + "unique": true, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_conversations_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_conversations_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_user_id", + "unique": false, + "columnNames": [ + "user_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_user_id` ON `${TABLE_NAME}` (`user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `counter_user_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "counterUserId", + "columnName": "counter_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilites` TEXT, `creator_id` TEXT NOT NULL, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "icon_url", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilites", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "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, 'ed438aa13171c4f7eac153440c70ffcc')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/26.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/26.json new file mode 100644 index 0000000000..31ba2ee5bf --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/26.json @@ -0,0 +1,1557 @@ +{ + "formatVersion": 1, + "database": { + "version": 26, + "identityHash": "6d1f37185b30a3c2b9d662d656006881", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_conversation_id", + "unique": true, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_conversations_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_conversations_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_user_id", + "unique": false, + "columnNames": [ + "user_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_user_id` ON `${TABLE_NAME}` (`user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `counter_user_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "counterUserId", + "columnName": "counter_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilites` TEXT, `creator_id` TEXT NOT NULL, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "icon_url", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilites", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "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, '6d1f37185b30a3c2b9d662d656006881')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/27.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/27.json new file mode 100644 index 0000000000..4eebf7724c --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/27.json @@ -0,0 +1,1598 @@ +{ + "formatVersion": 1, + "database": { + "version": 27, + "identityHash": "967fb6d5a876dd7efe1d0017e130b0c1", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_conversation_id", + "unique": true, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_conversations_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_conversations_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_user_id", + "unique": false, + "columnNames": [ + "user_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_user_id` ON `${TABLE_NAME}` (`user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "icon_url", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "messages", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [ + "CREATE TRIGGER IF NOT EXISTS room_fts_content_sync_messages_fts_BEFORE_UPDATE BEFORE UPDATE ON `messages` BEGIN DELETE FROM `messages_fts` WHERE `docid`=OLD.`rowid`; END", + "CREATE TRIGGER IF NOT EXISTS room_fts_content_sync_messages_fts_BEFORE_DELETE BEFORE DELETE ON `messages` BEGIN DELETE FROM `messages_fts` WHERE `docid`=OLD.`rowid`; END", + "CREATE TRIGGER IF NOT EXISTS room_fts_content_sync_messages_fts_AFTER_UPDATE AFTER UPDATE ON `messages` BEGIN INSERT INTO `messages_fts`(`docid`, `content`, `name`) VALUES (NEW.`rowid`, NEW.`content`, NEW.`name`); END", + "CREATE TRIGGER IF NOT EXISTS room_fts_content_sync_messages_fts_AFTER_INSERT AFTER INSERT ON `messages` BEGIN INSERT INTO `messages_fts`(`docid`, `content`, `name`) VALUES (NEW.`rowid`, NEW.`content`, NEW.`name`); END" + ], + "tableName": "messages_fts", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`content` TEXT, `name` TEXT, tokenize=unicode61, content=`messages`)", + "fields": [ + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [], + "autoGenerate": false + }, + "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, '967fb6d5a876dd7efe1d0017e130b0c1')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/28.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/28.json new file mode 100644 index 0000000000..79611c6105 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/28.json @@ -0,0 +1,1651 @@ +{ + "formatVersion": 1, + "database": { + "version": 28, + "identityHash": "34f3a61864674580fb526b7d1769fa67", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_conversation_id", + "unique": true, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_conversations_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_conversations_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_user_id", + "unique": false, + "columnNames": [ + "user_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_user_id` ON `${TABLE_NAME}` (`user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "icon_url", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "messages", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [ + "CREATE TRIGGER IF NOT EXISTS room_fts_content_sync_messages_fts_BEFORE_UPDATE BEFORE UPDATE ON `messages` BEGIN DELETE FROM `messages_fts` WHERE `docid`=OLD.`rowid`; END", + "CREATE TRIGGER IF NOT EXISTS room_fts_content_sync_messages_fts_BEFORE_DELETE BEFORE DELETE ON `messages` BEGIN DELETE FROM `messages_fts` WHERE `docid`=OLD.`rowid`; END", + "CREATE TRIGGER IF NOT EXISTS room_fts_content_sync_messages_fts_AFTER_UPDATE AFTER UPDATE ON `messages` BEGIN INSERT INTO `messages_fts`(`docid`, `content`, `name`) VALUES (NEW.`rowid`, NEW.`content`, NEW.`name`); END", + "CREATE TRIGGER IF NOT EXISTS room_fts_content_sync_messages_fts_AFTER_INSERT AFTER INSERT ON `messages` BEGIN INSERT INTO `messages_fts`(`docid`, `content`, `name`) VALUES (NEW.`rowid`, NEW.`content`, NEW.`name`); END" + ], + "tableName": "messages_fts", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`content` TEXT, `name` TEXT, tokenize=unicode61, content=`messages`)", + "fields": [ + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "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, '34f3a61864674580fb526b7d1769fa67')" + ] + } +} diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/29.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/29.json new file mode 100644 index 0000000000..9a88ecabaa --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/29.json @@ -0,0 +1,1646 @@ +{ + "formatVersion": 1, + "database": { + "version": 29, + "identityHash": "7e3b481b55d89f367a2d6761c2456e7d", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_user_id", + "unique": false, + "columnNames": [ + "user_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_user_id` ON `${TABLE_NAME}` (`user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_snapshots_asset_id", + "unique": false, + "columnNames": [ + "asset_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_snapshots_asset_id` ON `${TABLE_NAME}` (`asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [], + "autoGenerate": false + }, + "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, '7e3b481b55d89f367a2d6761c2456e7d')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/30.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/30.json new file mode 100644 index 0000000000..e56fb76361 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/30.json @@ -0,0 +1,1729 @@ +{ + "formatVersion": 1, + "database": { + "version": 30, + "identityHash": "40fa7fad401e7ea22bfdbbe72b848a9c", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_user_id", + "unique": false, + "columnNames": [ + "user_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_user_id` ON `${TABLE_NAME}` (`user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_snapshots_asset_id", + "unique": false, + "columnNames": [ + "asset_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_snapshots_asset_id` ON `${TABLE_NAME}` (`asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "circle_id" + ], + "autoGenerate": false + }, + "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, '40fa7fad401e7ea22bfdbbe72b848a9c')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/31.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/31.json new file mode 100644 index 0000000000..445301f6a3 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/31.json @@ -0,0 +1,1741 @@ +{ + "formatVersion": 1, + "database": { + "version": 31, + "identityHash": "9ff827533b092e212bd40e78bb196709", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_user_id", + "unique": false, + "columnNames": [ + "user_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_user_id` ON `${TABLE_NAME}` (`user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_snapshots_asset_id", + "unique": false, + "columnNames": [ + "asset_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_snapshots_asset_id` ON `${TABLE_NAME}` (`asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "circle_id" + ], + "autoGenerate": false + }, + "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, '9ff827533b092e212bd40e78bb196709')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/32.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/32.json new file mode 100644 index 0000000000..27168c17e3 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/32.json @@ -0,0 +1,1747 @@ +{ + "formatVersion": 1, + "database": { + "version": 32, + "identityHash": "a7cbbda7d5acf9388ec4b83f9d4ca4b7", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_scam` INTEGER, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_user_id", + "unique": false, + "columnNames": [ + "user_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_user_id` ON `${TABLE_NAME}` (`user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_snapshots_asset_id", + "unique": false, + "columnNames": [ + "asset_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_snapshots_asset_id` ON `${TABLE_NAME}` (`asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "circle_id" + ], + "autoGenerate": false + }, + "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, 'a7cbbda7d5acf9388ec4b83f9d4ca4b7')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/33.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/33.json new file mode 100644 index 0000000000..9f58061ae9 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/33.json @@ -0,0 +1,1809 @@ +{ + "formatVersion": 1, + "database": { + "version": 33, + "identityHash": "be3076f95378649643754240ae839d51", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_user_id", + "unique": false, + "columnNames": [ + "user_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_user_id` ON `${TABLE_NAME}` (`user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_snapshots_asset_id", + "unique": false, + "columnNames": [ + "asset_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_snapshots_asset_id` ON `${TABLE_NAME}` (`asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "trace_id" + ], + "autoGenerate": false + }, + "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, 'be3076f95378649643754240ae839d51')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/34.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/34.json new file mode 100644 index 0000000000..8058e390bb --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/34.json @@ -0,0 +1,1823 @@ +{ + "formatVersion": 1, + "database": { + "version": 34, + "identityHash": "6c6aaa45aef3bf74c44cfd84ade8c6b1", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_status_user_id", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_snapshots_asset_id", + "unique": false, + "columnNames": [ + "asset_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_snapshots_asset_id` ON `${TABLE_NAME}` (`asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "trace_id" + ], + "autoGenerate": false + }, + "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, '6c6aaa45aef3bf74c44cfd84ade8c6b1')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/35.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/35.json new file mode 100644 index 0000000000..ad0f3ca1a3 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/35.json @@ -0,0 +1,1832 @@ +{ + "formatVersion": 1, + "database": { + "version": 35, + "identityHash": "3ce70b086f7ebd2261abfbcb5cfeddaa", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_status_user_id", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_snapshots_asset_id", + "unique": false, + "columnNames": [ + "asset_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_snapshots_asset_id` ON `${TABLE_NAME}` (`asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "trace_id" + ], + "autoGenerate": false + }, + "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, '3ce70b086f7ebd2261abfbcb5cfeddaa')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/36.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/36.json new file mode 100644 index 0000000000..38631f2e0e --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/36.json @@ -0,0 +1,1857 @@ +{ + "formatVersion": 1, + "database": { + "version": 36, + "identityHash": "0e1abcd31aac08daf2424bc8d33e531c", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_full_name", + "unique": false, + "columnNames": [ + "full_name" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_full_name` ON `${TABLE_NAME}` (`full_name`)" + }, + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_status_user_id", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_participants_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + }, + { + "name": "index_participants_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_participants_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_snapshots_asset_id", + "unique": false, + "columnNames": [ + "asset_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_snapshots_asset_id` ON `${TABLE_NAME}` (`asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "trace_id" + ], + "autoGenerate": false + }, + "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, '0e1abcd31aac08daf2424bc8d33e531c')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/37.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/37.json new file mode 100644 index 0000000000..277100ccb3 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/37.json @@ -0,0 +1,1841 @@ +{ + "formatVersion": 1, + "database": { + "version": 37, + "identityHash": "f68e064cead7e7a1393011e32b891201", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_status_user_id", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "trace_id" + ], + "autoGenerate": false + }, + "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, 'f68e064cead7e7a1393011e32b891201')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/38.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/38.json new file mode 100644 index 0000000000..b4dd438028 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/38.json @@ -0,0 +1,2018 @@ +{ + "formatVersion": 1, + "database": { + "version": 38, + "identityHash": "4e0c214f07516f4e850c42bbcd292128", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_user_id_status_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "status", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_user_id_status_created_at` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `status`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_status_user_id", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "trace_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "transcript_id", + "message_id" + ], + "autoGenerate": false + }, + "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, '4e0c214f07516f4e850c42bbcd292128')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/39.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/39.json new file mode 100644 index 0000000000..efad06466a --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/39.json @@ -0,0 +1,2049 @@ +{ + "formatVersion": 1, + "database": { + "version": 39, + "identityHash": "3b750204b761f3300cb4bbd71865e9a4", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "trace_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "transcript_id", + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "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, '3b750204b761f3300cb4bbd71865e9a4')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/40.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/40.json new file mode 100644 index 0000000000..ede28f9843 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/40.json @@ -0,0 +1,2081 @@ +{ + "formatVersion": 1, + "database": { + "version": 40, + "identityHash": "6e545c6d5a47c95c77fdd7150d5fc52e", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "trace_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "transcript_id", + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "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, '6e545c6d5a47c95c77fdd7150d5fc52e')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/41.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/41.json new file mode 100644 index 0000000000..d313fc79b6 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/41.json @@ -0,0 +1,2110 @@ +{ + "formatVersion": 1, + "database": { + "version": 41, + "identityHash": "565515535ac37ad8458e9993e55ac4e4", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "trace_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "transcript_id", + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "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, '565515535ac37ad8458e9993e55ac4e4')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/42.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/42.json new file mode 100644 index 0000000000..c16cf66ea4 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/42.json @@ -0,0 +1,2116 @@ +{ + "formatVersion": 1, + "database": { + "version": 42, + "identityHash": "75654105e826dcdbcf1ba9c6bba2d87c", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "trace_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "transcript_id", + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "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, '75654105e826dcdbcf1ba9c6bba2d87c')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/43.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/43.json new file mode 100644 index 0000000000..d7226fb31b --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/43.json @@ -0,0 +1,2159 @@ +{ + "formatVersion": 1, + "database": { + "version": 43, + "identityHash": "851f5fd04a63539f8ffb1ae9bd965ad0", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "trace_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "transcript_id", + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "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, '851f5fd04a63539f8ffb1ae9bd965ad0')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/44.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/44.json new file mode 100644 index 0000000000..4e6587f584 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/44.json @@ -0,0 +1,2197 @@ +{ + "formatVersion": 1, + "database": { + "version": 44, + "identityHash": "cd4adca74c0c911a679cc84087b46449", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "trace_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "transcript_id", + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "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, 'cd4adca74c0c911a679cc84087b46449')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/45.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/45.json new file mode 100644 index 0000000000..d582c3e546 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/45.json @@ -0,0 +1,2203 @@ +{ + "formatVersion": 1, + "database": { + "version": 45, + "identityHash": "258db95ff48eb22615d3e17c794cf664", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "trace_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "transcript_id", + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "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, '258db95ff48eb22615d3e17c794cf664')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/46.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/46.json new file mode 100644 index 0000000000..8f3241ee2c --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/46.json @@ -0,0 +1,2209 @@ +{ + "formatVersion": 1, + "database": { + "version": 46, + "identityHash": "9086f5d485621f2e27a9ff94522664fa", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "user_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "snapshot_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "columnNames": [ + "album_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "app_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "hyperlink" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, `fee_asset_id` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "feeAssetId", + "columnName": "fee_asset_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "address_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id", + "user_id", + "session_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "album_id", + "sticker_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "asset_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "app_id", + "user_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "created_at", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "conversation_id", + "circle_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "trace_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "transcript_id", + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "key" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "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, '9086f5d485621f2e27a9ff94522664fa')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/47.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/47.json new file mode 100644 index 0000000000..da8c2d14f2 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/47.json @@ -0,0 +1,2242 @@ +{ + "formatVersion": 1, + "database": { + "version": 47, + "identityHash": "e78888dffeba18c3a74f143386f69d2b", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, `fee_asset_id` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "feeAssetId", + "columnName": "fee_asset_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "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, 'e78888dffeba18c3a74f143386f69d2b')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/48.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/48.json new file mode 100644 index 0000000000..d0b8f702c5 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/48.json @@ -0,0 +1,2286 @@ +{ + "formatVersion": 1, + "database": { + "version": 48, + "identityHash": "cb1b8be6f7c4d3d1cd29126ea2546cc6", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, `fee_asset_id` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "feeAssetId", + "columnName": "fee_asset_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + }, + "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, 'cb1b8be6f7c4d3d1cd29126ea2546cc6')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/49.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/49.json new file mode 100644 index 0000000000..958937b905 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/49.json @@ -0,0 +1,2304 @@ +{ + "formatVersion": 1, + "database": { + "version": 49, + "identityHash": "cc8ffcc83210bd22e359e71f250d98fd", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, `fee_asset_id` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "feeAssetId", + "columnName": "fee_asset_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + }, + "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, 'cc8ffcc83210bd22e359e71f250d98fd')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/50.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/50.json new file mode 100644 index 0000000000..9c98730a08 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/50.json @@ -0,0 +1,2316 @@ +{ + "formatVersion": 1, + "database": { + "version": 50, + "identityHash": "ba26a54ce81daccb4450b56639f4a09e", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, `is_deactivated` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "isDeactivated", + "columnName": "is_deactivated", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, `withdrawal_memo_possibility` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, `fee_asset_id` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "feeAssetId", + "columnName": "fee_asset_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + }, + "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, 'ba26a54ce81daccb4450b56639f4a09e')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/51.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/51.json new file mode 100644 index 0000000000..2fdcdd875f --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/51.json @@ -0,0 +1,2814 @@ +{ + "formatVersion": 1, + "database": { + "version": 51, + "identityHash": "160c11aafe3c8695f7b9d70846459f7e", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, `is_deactivated` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "isDeactivated", + "columnName": "is_deactivated", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, `withdrawal_memo_possibility` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `hidden` INTEGER, `balance` TEXT, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_extra_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_extra_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, `fee_asset_id` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "feeAssetId", + "columnName": "fee_asset_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `withdrawal_memo_possibility` TEXT NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "outputs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`output_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `asset` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `amount` TEXT NOT NULL, `mask` TEXT NOT NULL, `keys` TEXT NOT NULL, `receivers` TEXT NOT NULL, `receivers_hash` TEXT NOT NULL, `receivers_threshold` INTEGER NOT NULL, `extra` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `signed_by` TEXT NOT NULL, `signed_at` TEXT NOT NULL, `spent_at` TEXT NOT NULL, PRIMARY KEY(`output_id`))", + "fields": [ + { + "fieldPath": "outputId", + "columnName": "output_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputIndex", + "columnName": "output_index", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "asset", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mask", + "columnName": "mask", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "keys", + "columnName": "keys", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversHash", + "columnName": "receivers_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversThreshold", + "columnName": "receivers_threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "extra", + "columnName": "extra", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedBy", + "columnName": "signed_by", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedAt", + "columnName": "signed_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "spentAt", + "columnName": "spent_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "output_id" + ] + }, + "indices": [ + { + "name": "index_outputs_asset_state_created_at", + "unique": false, + "columnNames": [ + "asset", + "state", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_asset_state_created_at` ON `${TABLE_NAME}` (`asset`, `state`, `created_at`)" + }, + { + "name": "index_outputs_transaction_hash_output_index", + "unique": true, + "columnNames": [ + "transaction_hash", + "output_index" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_outputs_transaction_hash_output_index` ON `${TABLE_NAME}` (`transaction_hash`, `output_index`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT NOT NULL, `dust` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "deposit_entries", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`entry_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `members` TEXT NOT NULL, `tag` TEXT, `signature` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `is_primary` INTEGER NOT NULL, PRIMARY KEY(`entry_id`))", + "fields": [ + { + "fieldPath": "entryId", + "columnName": "entry_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "members", + "columnName": "members", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "signature", + "columnName": "signature", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isPrimary", + "columnName": "is_primary", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "entry_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "safe_snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `user_id` TEXT NOT NULL, `opponent_id` TEXT NOT NULL, `memo` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `created_at` TEXT NOT NULL, `trace_id` TEXT, `confirmations` INTEGER, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`request_id` TEXT NOT NULL, `raw_transaction` TEXT NOT NULL, `receiver_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`request_id`))", + "fields": [ + { + "fieldPath": "requestId", + "columnName": "request_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "rawTransaction", + "columnName": "raw_transaction", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiverId", + "columnName": "receiver_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "request_id" + ] + }, + "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, '160c11aafe3c8695f7b9d70846459f7e')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/52.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/52.json new file mode 100644 index 0000000000..16c727e98d --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/52.json @@ -0,0 +1,2826 @@ +{ + "formatVersion": 1, + "database": { + "version": 52, + "identityHash": "ab2df592e2639900d96a8495b836e274", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, `is_deactivated` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "isDeactivated", + "columnName": "is_deactivated", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, `withdrawal_memo_possibility` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `hidden` INTEGER, `balance` TEXT, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_extra_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_extra_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, `fee_asset_id` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "feeAssetId", + "columnName": "fee_asset_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `withdrawal_memo_possibility` TEXT NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "outputs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`output_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `asset` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `amount` TEXT NOT NULL, `mask` TEXT NOT NULL, `keys` TEXT NOT NULL, `receivers` TEXT NOT NULL, `receivers_hash` TEXT NOT NULL, `receivers_threshold` INTEGER NOT NULL, `extra` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `signed_by` TEXT NOT NULL, `signed_at` TEXT NOT NULL, `spent_at` TEXT NOT NULL, PRIMARY KEY(`output_id`))", + "fields": [ + { + "fieldPath": "outputId", + "columnName": "output_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputIndex", + "columnName": "output_index", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "asset", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mask", + "columnName": "mask", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "keys", + "columnName": "keys", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversHash", + "columnName": "receivers_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversThreshold", + "columnName": "receivers_threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "extra", + "columnName": "extra", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedBy", + "columnName": "signed_by", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedAt", + "columnName": "signed_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "spentAt", + "columnName": "spent_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "output_id" + ] + }, + "indices": [ + { + "name": "index_outputs_asset_state_sequence", + "unique": false, + "columnNames": [ + "asset", + "state", + "sequence" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_asset_state_sequence` ON `${TABLE_NAME}` (`asset`, `state`, `sequence`)" + }, + { + "name": "index_outputs_transaction_hash_output_index", + "unique": true, + "columnNames": [ + "transaction_hash", + "output_index" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_outputs_transaction_hash_output_index` ON `${TABLE_NAME}` (`transaction_hash`, `output_index`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT NOT NULL, `dust` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "deposit_entries", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`entry_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `members` TEXT NOT NULL, `tag` TEXT, `signature` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `is_primary` INTEGER NOT NULL, PRIMARY KEY(`entry_id`))", + "fields": [ + { + "fieldPath": "entryId", + "columnName": "entry_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "members", + "columnName": "members", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "signature", + "columnName": "signature", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isPrimary", + "columnName": "is_primary", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "entry_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "safe_snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `user_id` TEXT NOT NULL, `opponent_id` TEXT NOT NULL, `memo` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `created_at` TEXT NOT NULL, `trace_id` TEXT, `confirmations` INTEGER, `opening_balance` TEXT, `closing_balance` TEXT, `deposit` TEXT, `withdrawal` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "deposit", + "columnName": "deposit", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawal", + "columnName": "withdrawal", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`request_id` TEXT NOT NULL, `raw_transaction` TEXT NOT NULL, `receiver_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`request_id`))", + "fields": [ + { + "fieldPath": "requestId", + "columnName": "request_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "rawTransaction", + "columnName": "raw_transaction", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiverId", + "columnName": "receiver_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "request_id" + ] + }, + "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, 'ab2df592e2639900d96a8495b836e274')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/53.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/53.json new file mode 100644 index 0000000000..5b4541a25a --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/53.json @@ -0,0 +1,2849 @@ +{ + "formatVersion": 1, + "database": { + "version": 53, + "identityHash": "328c44708e354a0f8f50858f54e0ebf1", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, `is_deactivated` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "isDeactivated", + "columnName": "is_deactivated", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, `withdrawal_memo_possibility` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `hidden` INTEGER, `balance` TEXT, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_extra_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_extra_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, `fee_asset_id` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "feeAssetId", + "columnName": "fee_asset_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `withdrawal_memo_possibility` TEXT NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "outputs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`output_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `asset` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `amount` TEXT NOT NULL, `mask` TEXT NOT NULL, `keys` TEXT NOT NULL, `receivers` TEXT NOT NULL, `receivers_hash` TEXT NOT NULL, `receivers_threshold` INTEGER NOT NULL, `extra` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `signed_by` TEXT NOT NULL, `signed_at` TEXT NOT NULL, `spent_at` TEXT NOT NULL, PRIMARY KEY(`output_id`))", + "fields": [ + { + "fieldPath": "outputId", + "columnName": "output_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputIndex", + "columnName": "output_index", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "asset", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mask", + "columnName": "mask", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "keys", + "columnName": "keys", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversHash", + "columnName": "receivers_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversThreshold", + "columnName": "receivers_threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "extra", + "columnName": "extra", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedBy", + "columnName": "signed_by", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedAt", + "columnName": "signed_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "spentAt", + "columnName": "spent_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "output_id" + ] + }, + "indices": [ + { + "name": "index_outputs_asset_state_sequence", + "unique": false, + "columnNames": [ + "asset", + "state", + "sequence" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_asset_state_sequence` ON `${TABLE_NAME}` (`asset`, `state`, `sequence`)" + }, + { + "name": "index_outputs_transaction_hash_output_index", + "unique": true, + "columnNames": [ + "transaction_hash", + "output_index" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_outputs_transaction_hash_output_index` ON `${TABLE_NAME}` (`transaction_hash`, `output_index`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT NOT NULL, `dust` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "deposit_entries", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`entry_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `members` TEXT NOT NULL, `tag` TEXT, `signature` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `is_primary` INTEGER NOT NULL, PRIMARY KEY(`entry_id`))", + "fields": [ + { + "fieldPath": "entryId", + "columnName": "entry_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "members", + "columnName": "members", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "signature", + "columnName": "signature", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isPrimary", + "columnName": "is_primary", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "entry_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "safe_snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `user_id` TEXT NOT NULL, `opponent_id` TEXT NOT NULL, `memo` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `created_at` TEXT NOT NULL, `trace_id` TEXT, `confirmations` INTEGER, `opening_balance` TEXT, `closing_balance` TEXT, `deposit` TEXT, `withdrawal` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "deposit", + "columnName": "deposit", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawal", + "columnName": "withdrawal", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`request_id` TEXT NOT NULL, `raw_transaction` TEXT NOT NULL, `receiver_id` TEXT NOT NULL, `type` INTEGER NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`request_id`))", + "fields": [ + { + "fieldPath": "requestId", + "columnName": "request_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "rawTransaction", + "columnName": "raw_transaction", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiverId", + "columnName": "receiver_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "request_id" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_state_type", + "unique": false, + "columnNames": [ + "state", + "type" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_state_type` ON `${TABLE_NAME}` (`state`, `type`)" + } + ], + "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, '328c44708e354a0f8f50858f54e0ebf1')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/54.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/54.json new file mode 100644 index 0000000000..a22b485f44 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/54.json @@ -0,0 +1,3021 @@ +{ + "formatVersion": 1, + "database": { + "version": 54, + "identityHash": "5ed8d1699e19b96d55895cd6aeb97d79", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, `is_deactivated` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "isDeactivated", + "columnName": "is_deactivated", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, `withdrawal_memo_possibility` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `hidden` INTEGER, `balance` TEXT, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_extra_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_extra_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, `fee_asset_id` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "feeAssetId", + "columnName": "fee_asset_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `withdrawal_memo_possibility` TEXT NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "outputs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`output_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `asset` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `amount` TEXT NOT NULL, `mask` TEXT NOT NULL, `keys` TEXT NOT NULL, `receivers` TEXT NOT NULL, `receivers_hash` TEXT NOT NULL, `receivers_threshold` INTEGER NOT NULL, `extra` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `signed_by` TEXT NOT NULL, `signed_at` TEXT NOT NULL, `spent_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`output_id`))", + "fields": [ + { + "fieldPath": "outputId", + "columnName": "output_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputIndex", + "columnName": "output_index", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "asset", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mask", + "columnName": "mask", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "keys", + "columnName": "keys", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversHash", + "columnName": "receivers_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversThreshold", + "columnName": "receivers_threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "extra", + "columnName": "extra", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedBy", + "columnName": "signed_by", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedAt", + "columnName": "signed_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "spentAt", + "columnName": "spent_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "output_id" + ] + }, + "indices": [ + { + "name": "index_outputs_asset_state_sequence", + "unique": false, + "columnNames": [ + "asset", + "state", + "sequence" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_asset_state_sequence` ON `${TABLE_NAME}` (`asset`, `state`, `sequence`)" + }, + { + "name": "index_outputs_transaction_hash_output_index", + "unique": true, + "columnNames": [ + "transaction_hash", + "output_index" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_outputs_transaction_hash_output_index` ON `${TABLE_NAME}` (`transaction_hash`, `output_index`)" + }, + { + "name": "index_outputs_inscription_hash", + "unique": false, + "columnNames": [ + "inscription_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_inscription_hash` ON `${TABLE_NAME}` (`inscription_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT NOT NULL, `dust` TEXT NOT NULL, `collection_hash` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + }, + { + "name": "index_tokens_collection_hash", + "unique": false, + "columnNames": [ + "collection_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_collection_hash` ON `${TABLE_NAME}` (`collection_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "deposit_entries", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`entry_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `members` TEXT NOT NULL, `tag` TEXT, `signature` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `is_primary` INTEGER NOT NULL, PRIMARY KEY(`entry_id`))", + "fields": [ + { + "fieldPath": "entryId", + "columnName": "entry_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "members", + "columnName": "members", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "signature", + "columnName": "signature", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isPrimary", + "columnName": "is_primary", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "entry_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "safe_snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `user_id` TEXT NOT NULL, `opponent_id` TEXT NOT NULL, `memo` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `created_at` TEXT NOT NULL, `trace_id` TEXT, `confirmations` INTEGER, `opening_balance` TEXT, `closing_balance` TEXT, `deposit` TEXT, `withdrawal` TEXT, `inscription_hash` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "deposit", + "columnName": "deposit", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawal", + "columnName": "withdrawal", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`request_id` TEXT NOT NULL, `raw_transaction` TEXT NOT NULL, `receiver_id` TEXT NOT NULL, `type` INTEGER NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`request_id`))", + "fields": [ + { + "fieldPath": "requestId", + "columnName": "request_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "rawTransaction", + "columnName": "raw_transaction", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiverId", + "columnName": "receiver_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "request_id" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_state_type", + "unique": false, + "columnNames": [ + "state", + "type" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_state_type` ON `${TABLE_NAME}` (`state`, `type`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "inscription_collections", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`collection_hash` TEXT NOT NULL, `supply` TEXT NOT NULL, `unit` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`collection_hash`))", + "fields": [ + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "supply", + "columnName": "supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unit", + "columnName": "unit", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconURL", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "collection_hash" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "inscription_items", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`inscription_hash` TEXT NOT NULL, `collection_hash` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `content_type` TEXT NOT NULL, `content_url` TEXT NOT NULL, `occupied_by` TEXT, `occupied_at` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`inscription_hash`))", + "fields": [ + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "contentType", + "columnName": "content_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "contentURL", + "columnName": "content_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "occupiedBy", + "columnName": "occupied_by", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "occupiedAt", + "columnName": "occupied_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "inscription_hash" + ] + }, + "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, '5ed8d1699e19b96d55895cd6aeb97d79')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/55.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/55.json new file mode 100644 index 0000000000..2ddc926cc6 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/55.json @@ -0,0 +1,3039 @@ +{ + "formatVersion": 1, + "database": { + "version": 55, + "identityHash": "b8e0941924dd1cea81af79be98638aac", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, `is_deactivated` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "isDeactivated", + "columnName": "is_deactivated", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, `withdrawal_memo_possibility` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `hidden` INTEGER, `balance` TEXT, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_extra_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_extra_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, `fee_asset_id` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "feeAssetId", + "columnName": "fee_asset_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `withdrawal_memo_possibility` TEXT NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "outputs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`output_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `asset` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `amount` TEXT NOT NULL, `mask` TEXT NOT NULL, `keys` TEXT NOT NULL, `receivers` TEXT NOT NULL, `receivers_hash` TEXT NOT NULL, `receivers_threshold` INTEGER NOT NULL, `extra` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `signed_by` TEXT NOT NULL, `signed_at` TEXT NOT NULL, `spent_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`output_id`))", + "fields": [ + { + "fieldPath": "outputId", + "columnName": "output_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputIndex", + "columnName": "output_index", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "asset", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mask", + "columnName": "mask", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "keys", + "columnName": "keys", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversHash", + "columnName": "receivers_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversThreshold", + "columnName": "receivers_threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "extra", + "columnName": "extra", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedBy", + "columnName": "signed_by", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedAt", + "columnName": "signed_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "spentAt", + "columnName": "spent_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "output_id" + ] + }, + "indices": [ + { + "name": "index_outputs_asset_state_sequence", + "unique": false, + "columnNames": [ + "asset", + "state", + "sequence" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_asset_state_sequence` ON `${TABLE_NAME}` (`asset`, `state`, `sequence`)" + }, + { + "name": "index_outputs_transaction_hash_output_index", + "unique": true, + "columnNames": [ + "transaction_hash", + "output_index" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_outputs_transaction_hash_output_index` ON `${TABLE_NAME}` (`transaction_hash`, `output_index`)" + }, + { + "name": "index_outputs_inscription_hash", + "unique": false, + "columnNames": [ + "inscription_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_inscription_hash` ON `${TABLE_NAME}` (`inscription_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT NOT NULL, `dust` TEXT NOT NULL, `collection_hash` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + }, + { + "name": "index_tokens_collection_hash", + "unique": false, + "columnNames": [ + "collection_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_collection_hash` ON `${TABLE_NAME}` (`collection_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "deposit_entries", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`entry_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `members` TEXT NOT NULL, `tag` TEXT, `signature` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `is_primary` INTEGER NOT NULL, PRIMARY KEY(`entry_id`))", + "fields": [ + { + "fieldPath": "entryId", + "columnName": "entry_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "members", + "columnName": "members", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "signature", + "columnName": "signature", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isPrimary", + "columnName": "is_primary", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "entry_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "safe_snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `user_id` TEXT NOT NULL, `opponent_id` TEXT NOT NULL, `memo` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `created_at` TEXT NOT NULL, `trace_id` TEXT, `confirmations` INTEGER, `opening_balance` TEXT, `closing_balance` TEXT, `deposit` TEXT, `withdrawal` TEXT, `inscription_hash` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "deposit", + "columnName": "deposit", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawal", + "columnName": "withdrawal", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`request_id` TEXT NOT NULL, `raw_transaction` TEXT NOT NULL, `receiver_id` TEXT NOT NULL, `type` INTEGER NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`request_id`))", + "fields": [ + { + "fieldPath": "requestId", + "columnName": "request_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "rawTransaction", + "columnName": "raw_transaction", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiverId", + "columnName": "receiver_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "request_id" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_state_type", + "unique": false, + "columnNames": [ + "state", + "type" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_state_type` ON `${TABLE_NAME}` (`state`, `type`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "inscription_collections", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`collection_hash` TEXT NOT NULL, `supply` TEXT NOT NULL, `unit` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `description` TEXT, PRIMARY KEY(`collection_hash`))", + "fields": [ + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "supply", + "columnName": "supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unit", + "columnName": "unit", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconURL", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "collection_hash" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "inscription_items", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`inscription_hash` TEXT NOT NULL, `collection_hash` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `content_type` TEXT NOT NULL, `content_url` TEXT NOT NULL, `occupied_by` TEXT, `occupied_at` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `owner` TEXT, `traits` TEXT, PRIMARY KEY(`inscription_hash`))", + "fields": [ + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "contentType", + "columnName": "content_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "contentURL", + "columnName": "content_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "occupiedBy", + "columnName": "occupied_by", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "occupiedAt", + "columnName": "occupied_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "owner", + "columnName": "owner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traits", + "columnName": "traits", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "inscription_hash" + ] + }, + "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, 'b8e0941924dd1cea81af79be98638aac')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/56.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/56.json new file mode 100644 index 0000000000..a15a431443 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/56.json @@ -0,0 +1,3045 @@ +{ + "formatVersion": 1, + "database": { + "version": 56, + "identityHash": "72d4256e9d8f2b60a9b626dcb3ae941e", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, `is_deactivated` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "isDeactivated", + "columnName": "is_deactivated", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, `withdrawal_memo_possibility` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `hidden` INTEGER, `balance` TEXT, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_extra_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_extra_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, `fee_asset_id` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "feeAssetId", + "columnName": "fee_asset_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `withdrawal_memo_possibility` TEXT NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "outputs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`output_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `asset` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `amount` TEXT NOT NULL, `mask` TEXT NOT NULL, `keys` TEXT NOT NULL, `receivers` TEXT NOT NULL, `receivers_hash` TEXT NOT NULL, `receivers_threshold` INTEGER NOT NULL, `extra` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `signed_by` TEXT NOT NULL, `signed_at` TEXT NOT NULL, `spent_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`output_id`))", + "fields": [ + { + "fieldPath": "outputId", + "columnName": "output_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputIndex", + "columnName": "output_index", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "asset", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mask", + "columnName": "mask", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "keys", + "columnName": "keys", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversHash", + "columnName": "receivers_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversThreshold", + "columnName": "receivers_threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "extra", + "columnName": "extra", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedBy", + "columnName": "signed_by", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedAt", + "columnName": "signed_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "spentAt", + "columnName": "spent_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "output_id" + ] + }, + "indices": [ + { + "name": "index_outputs_asset_state_sequence", + "unique": false, + "columnNames": [ + "asset", + "state", + "sequence" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_asset_state_sequence` ON `${TABLE_NAME}` (`asset`, `state`, `sequence`)" + }, + { + "name": "index_outputs_transaction_hash_output_index", + "unique": true, + "columnNames": [ + "transaction_hash", + "output_index" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_outputs_transaction_hash_output_index` ON `${TABLE_NAME}` (`transaction_hash`, `output_index`)" + }, + { + "name": "index_outputs_inscription_hash", + "unique": false, + "columnNames": [ + "inscription_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_inscription_hash` ON `${TABLE_NAME}` (`inscription_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT NOT NULL, `dust` TEXT NOT NULL, `collection_hash` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + }, + { + "name": "index_tokens_collection_hash", + "unique": false, + "columnNames": [ + "collection_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_collection_hash` ON `${TABLE_NAME}` (`collection_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "deposit_entries", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`entry_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `members` TEXT NOT NULL, `tag` TEXT, `signature` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `is_primary` INTEGER NOT NULL, PRIMARY KEY(`entry_id`))", + "fields": [ + { + "fieldPath": "entryId", + "columnName": "entry_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "members", + "columnName": "members", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "signature", + "columnName": "signature", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isPrimary", + "columnName": "is_primary", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "entry_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "safe_snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `user_id` TEXT NOT NULL, `opponent_id` TEXT NOT NULL, `memo` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `created_at` TEXT NOT NULL, `trace_id` TEXT, `confirmations` INTEGER, `opening_balance` TEXT, `closing_balance` TEXT, `deposit` TEXT, `withdrawal` TEXT, `inscription_hash` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "deposit", + "columnName": "deposit", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawal", + "columnName": "withdrawal", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`request_id` TEXT NOT NULL, `raw_transaction` TEXT NOT NULL, `receiver_id` TEXT NOT NULL, `type` INTEGER NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`request_id`))", + "fields": [ + { + "fieldPath": "requestId", + "columnName": "request_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "rawTransaction", + "columnName": "raw_transaction", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiverId", + "columnName": "receiver_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "request_id" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_state_type", + "unique": false, + "columnNames": [ + "state", + "type" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_state_type` ON `${TABLE_NAME}` (`state`, `type`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "inscription_collections", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`collection_hash` TEXT NOT NULL, `supply` TEXT NOT NULL, `unit` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `description` TEXT, `kernel_asset_id` TEXT, PRIMARY KEY(`collection_hash`))", + "fields": [ + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "supply", + "columnName": "supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unit", + "columnName": "unit", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconURL", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "collection_hash" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "inscription_items", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`inscription_hash` TEXT NOT NULL, `collection_hash` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `content_type` TEXT NOT NULL, `content_url` TEXT NOT NULL, `occupied_by` TEXT, `occupied_at` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `owner` TEXT, `traits` TEXT, PRIMARY KEY(`inscription_hash`))", + "fields": [ + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "contentType", + "columnName": "content_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "contentURL", + "columnName": "content_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "occupiedBy", + "columnName": "occupied_by", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "occupiedAt", + "columnName": "occupied_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "owner", + "columnName": "owner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traits", + "columnName": "traits", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "inscription_hash" + ] + }, + "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, '72d4256e9d8f2b60a9b626dcb3ae941e')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/57.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/57.json new file mode 100644 index 0000000000..1f1bd2317f --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/57.json @@ -0,0 +1,3051 @@ +{ + "formatVersion": 1, + "database": { + "version": 57, + "identityHash": "fbf40f8c9d7b0a29ef0ab1a622bdd8a4", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, `is_deactivated` INTEGER, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "isDeactivated", + "columnName": "is_deactivated", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, `withdrawal_memo_possibility` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `hidden` INTEGER, `balance` TEXT, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_extra_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_extra_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, `fee_asset_id` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "feeAssetId", + "columnName": "fee_asset_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `withdrawal_memo_possibility` TEXT NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "outputs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`output_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `asset` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `amount` TEXT NOT NULL, `mask` TEXT NOT NULL, `keys` TEXT NOT NULL, `receivers` TEXT NOT NULL, `receivers_hash` TEXT NOT NULL, `receivers_threshold` INTEGER NOT NULL, `extra` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `signed_by` TEXT NOT NULL, `signed_at` TEXT NOT NULL, `spent_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`output_id`))", + "fields": [ + { + "fieldPath": "outputId", + "columnName": "output_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputIndex", + "columnName": "output_index", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "asset", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mask", + "columnName": "mask", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "keys", + "columnName": "keys", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversHash", + "columnName": "receivers_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversThreshold", + "columnName": "receivers_threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "extra", + "columnName": "extra", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedBy", + "columnName": "signed_by", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedAt", + "columnName": "signed_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "spentAt", + "columnName": "spent_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "output_id" + ] + }, + "indices": [ + { + "name": "index_outputs_asset_state_sequence", + "unique": false, + "columnNames": [ + "asset", + "state", + "sequence" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_asset_state_sequence` ON `${TABLE_NAME}` (`asset`, `state`, `sequence`)" + }, + { + "name": "index_outputs_transaction_hash_output_index", + "unique": true, + "columnNames": [ + "transaction_hash", + "output_index" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_outputs_transaction_hash_output_index` ON `${TABLE_NAME}` (`transaction_hash`, `output_index`)" + }, + { + "name": "index_outputs_inscription_hash", + "unique": false, + "columnNames": [ + "inscription_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_inscription_hash` ON `${TABLE_NAME}` (`inscription_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT NOT NULL, `dust` TEXT NOT NULL, `collection_hash` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + }, + { + "name": "index_tokens_collection_hash", + "unique": false, + "columnNames": [ + "collection_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_collection_hash` ON `${TABLE_NAME}` (`collection_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "deposit_entries", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`entry_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `members` TEXT NOT NULL, `tag` TEXT, `signature` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `is_primary` INTEGER NOT NULL, PRIMARY KEY(`entry_id`))", + "fields": [ + { + "fieldPath": "entryId", + "columnName": "entry_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "members", + "columnName": "members", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "signature", + "columnName": "signature", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isPrimary", + "columnName": "is_primary", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "entry_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "safe_snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `user_id` TEXT NOT NULL, `opponent_id` TEXT NOT NULL, `memo` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `created_at` TEXT NOT NULL, `trace_id` TEXT, `confirmations` INTEGER, `opening_balance` TEXT, `closing_balance` TEXT, `deposit` TEXT, `withdrawal` TEXT, `inscription_hash` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "deposit", + "columnName": "deposit", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawal", + "columnName": "withdrawal", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`request_id` TEXT NOT NULL, `raw_transaction` TEXT NOT NULL, `receiver_id` TEXT NOT NULL, `type` INTEGER NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`request_id`))", + "fields": [ + { + "fieldPath": "requestId", + "columnName": "request_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "rawTransaction", + "columnName": "raw_transaction", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiverId", + "columnName": "receiver_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "request_id" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_state_type", + "unique": false, + "columnNames": [ + "state", + "type" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_state_type` ON `${TABLE_NAME}` (`state`, `type`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "inscription_collections", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`collection_hash` TEXT NOT NULL, `supply` TEXT NOT NULL, `unit` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `description` TEXT, `kernel_asset_id` TEXT, `treasury` TEXT, PRIMARY KEY(`collection_hash`))", + "fields": [ + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "supply", + "columnName": "supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unit", + "columnName": "unit", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconURL", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "treasury", + "columnName": "treasury", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "collection_hash" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "inscription_items", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`inscription_hash` TEXT NOT NULL, `collection_hash` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `content_type` TEXT NOT NULL, `content_url` TEXT NOT NULL, `occupied_by` TEXT, `occupied_at` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `owner` TEXT, `traits` TEXT, PRIMARY KEY(`inscription_hash`))", + "fields": [ + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "contentType", + "columnName": "content_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "contentURL", + "columnName": "content_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "occupiedBy", + "columnName": "occupied_by", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "occupiedAt", + "columnName": "occupied_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "owner", + "columnName": "owner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traits", + "columnName": "traits", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "inscription_hash" + ] + }, + "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, 'fbf40f8c9d7b0a29ef0ab1a622bdd8a4')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/58.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/58.json new file mode 100644 index 0000000000..8284500391 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/58.json @@ -0,0 +1,3236 @@ +{ + "formatVersion": 1, + "database": { + "version": 58, + "identityHash": "ab2d3f4bbd58ac019b898a95cd955474", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, `is_deactivated` INTEGER, `membership` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "isDeactivated", + "columnName": "is_deactivated", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "membership", + "columnName": "membership", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, `withdrawal_memo_possibility` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `hidden` INTEGER, `balance` TEXT, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_extra_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_extra_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, `fee_asset_id` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "feeAssetId", + "columnName": "fee_asset_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `withdrawal_memo_possibility` TEXT NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "outputs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`output_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `asset` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `amount` TEXT NOT NULL, `mask` TEXT NOT NULL, `keys` TEXT NOT NULL, `receivers` TEXT NOT NULL, `receivers_hash` TEXT NOT NULL, `receivers_threshold` INTEGER NOT NULL, `extra` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `signed_by` TEXT NOT NULL, `signed_at` TEXT NOT NULL, `spent_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`output_id`))", + "fields": [ + { + "fieldPath": "outputId", + "columnName": "output_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputIndex", + "columnName": "output_index", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "asset", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mask", + "columnName": "mask", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "keys", + "columnName": "keys", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversHash", + "columnName": "receivers_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversThreshold", + "columnName": "receivers_threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "extra", + "columnName": "extra", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedBy", + "columnName": "signed_by", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedAt", + "columnName": "signed_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "spentAt", + "columnName": "spent_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "output_id" + ] + }, + "indices": [ + { + "name": "index_outputs_asset_state_sequence", + "unique": false, + "columnNames": [ + "asset", + "state", + "sequence" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_asset_state_sequence` ON `${TABLE_NAME}` (`asset`, `state`, `sequence`)" + }, + { + "name": "index_outputs_transaction_hash_output_index", + "unique": true, + "columnNames": [ + "transaction_hash", + "output_index" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_outputs_transaction_hash_output_index` ON `${TABLE_NAME}` (`transaction_hash`, `output_index`)" + }, + { + "name": "index_outputs_inscription_hash", + "unique": false, + "columnNames": [ + "inscription_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_inscription_hash` ON `${TABLE_NAME}` (`inscription_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT NOT NULL, `dust` TEXT NOT NULL, `collection_hash` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + }, + { + "name": "index_tokens_collection_hash", + "unique": false, + "columnNames": [ + "collection_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_collection_hash` ON `${TABLE_NAME}` (`collection_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "deposit_entries", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`entry_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `members` TEXT NOT NULL, `tag` TEXT, `signature` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `is_primary` INTEGER NOT NULL, PRIMARY KEY(`entry_id`))", + "fields": [ + { + "fieldPath": "entryId", + "columnName": "entry_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "members", + "columnName": "members", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "signature", + "columnName": "signature", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isPrimary", + "columnName": "is_primary", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "entry_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "safe_snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `user_id` TEXT NOT NULL, `opponent_id` TEXT NOT NULL, `memo` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `created_at` TEXT NOT NULL, `trace_id` TEXT, `confirmations` INTEGER, `opening_balance` TEXT, `closing_balance` TEXT, `deposit` TEXT, `withdrawal` TEXT, `inscription_hash` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "deposit", + "columnName": "deposit", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawal", + "columnName": "withdrawal", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`request_id` TEXT NOT NULL, `raw_transaction` TEXT NOT NULL, `receiver_id` TEXT NOT NULL, `type` INTEGER NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`request_id`))", + "fields": [ + { + "fieldPath": "requestId", + "columnName": "request_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "rawTransaction", + "columnName": "raw_transaction", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiverId", + "columnName": "receiver_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "request_id" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_state_type", + "unique": false, + "columnNames": [ + "state", + "type" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_state_type` ON `${TABLE_NAME}` (`state`, `type`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "inscription_collections", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`collection_hash` TEXT NOT NULL, `supply` TEXT NOT NULL, `unit` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `description` TEXT, `kernel_asset_id` TEXT, `treasury` TEXT, PRIMARY KEY(`collection_hash`))", + "fields": [ + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "supply", + "columnName": "supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unit", + "columnName": "unit", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconURL", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "treasury", + "columnName": "treasury", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "collection_hash" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "inscription_items", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`inscription_hash` TEXT NOT NULL, `collection_hash` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `content_type` TEXT NOT NULL, `content_url` TEXT NOT NULL, `occupied_by` TEXT, `occupied_at` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `owner` TEXT, `traits` TEXT, PRIMARY KEY(`inscription_hash`))", + "fields": [ + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "contentType", + "columnName": "content_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "contentURL", + "columnName": "content_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "occupiedBy", + "columnName": "occupied_by", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "occupiedAt", + "columnName": "occupied_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "owner", + "columnName": "owner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traits", + "columnName": "traits", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "inscription_hash" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "markets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `current_price` TEXT NOT NULL, `market_cap` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `total_volume` TEXT NOT NULL, `high_24h` TEXT NOT NULL, `low_24h` TEXT NOT NULL, `price_change_24h` TEXT NOT NULL, `price_change_percentage_24h` TEXT NOT NULL, `market_cap_change_24h` TEXT NOT NULL, `market_cap_change_percentage_24h` TEXT NOT NULL, `circulating_supply` TEXT NOT NULL, `total_supply` TEXT NOT NULL, `max_supply` TEXT NOT NULL, `ath` TEXT NOT NULL, `ath_change_percentage` TEXT NOT NULL, `ath_date` TEXT NOT NULL, `atl` TEXT NOT NULL, `atl_change_percentage` TEXT NOT NULL, `atl_date` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "currentPrice", + "columnName": "current_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCap", + "columnName": "market_cap", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalVolume", + "columnName": "total_volume", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "high24h", + "columnName": "high_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "low24h", + "columnName": "low_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChange24h", + "columnName": "price_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage24h", + "columnName": "price_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChange24h", + "columnName": "market_cap_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChangePercentage24h", + "columnName": "market_cap_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circulatingSupply", + "columnName": "circulating_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalSupply", + "columnName": "total_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "maxSupply", + "columnName": "max_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ath", + "columnName": "ath", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athChangePercentage", + "columnName": "ath_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athDate", + "columnName": "ath_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atl", + "columnName": "atl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlChangePercentage", + "columnName": "atl_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlDate", + "columnName": "atl_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "history_prices", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `type` TEXT NOT NULL, `data` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`, `type`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id", + "type" + ] + }, + "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, 'ab2d3f4bbd58ac019b898a95cd955474')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/59.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/59.json new file mode 100644 index 0000000000..0d7960e527 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/59.json @@ -0,0 +1,3348 @@ +{ + "formatVersion": 1, + "database": { + "version": 59, + "identityHash": "08302a691b4e628f46e26e862deb2b00", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, `is_deactivated` INTEGER, `membership` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "isDeactivated", + "columnName": "is_deactivated", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "membership", + "columnName": "membership", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, `withdrawal_memo_possibility` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `hidden` INTEGER, `balance` TEXT, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_extra_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_extra_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `reserve` TEXT NOT NULL, `fee` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, `fee_asset_id` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "feeAssetId", + "columnName": "fee_asset_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `withdrawal_memo_possibility` TEXT NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "outputs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`output_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `asset` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `amount` TEXT NOT NULL, `mask` TEXT NOT NULL, `keys` TEXT NOT NULL, `receivers` TEXT NOT NULL, `receivers_hash` TEXT NOT NULL, `receivers_threshold` INTEGER NOT NULL, `extra` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `signed_by` TEXT NOT NULL, `signed_at` TEXT NOT NULL, `spent_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`output_id`))", + "fields": [ + { + "fieldPath": "outputId", + "columnName": "output_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputIndex", + "columnName": "output_index", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "asset", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mask", + "columnName": "mask", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "keys", + "columnName": "keys", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversHash", + "columnName": "receivers_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversThreshold", + "columnName": "receivers_threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "extra", + "columnName": "extra", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedBy", + "columnName": "signed_by", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedAt", + "columnName": "signed_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "spentAt", + "columnName": "spent_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "output_id" + ] + }, + "indices": [ + { + "name": "index_outputs_asset_state_sequence", + "unique": false, + "columnNames": [ + "asset", + "state", + "sequence" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_asset_state_sequence` ON `${TABLE_NAME}` (`asset`, `state`, `sequence`)" + }, + { + "name": "index_outputs_transaction_hash_output_index", + "unique": true, + "columnNames": [ + "transaction_hash", + "output_index" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_outputs_transaction_hash_output_index` ON `${TABLE_NAME}` (`transaction_hash`, `output_index`)" + }, + { + "name": "index_outputs_inscription_hash", + "unique": false, + "columnNames": [ + "inscription_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_inscription_hash` ON `${TABLE_NAME}` (`inscription_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT NOT NULL, `dust` TEXT NOT NULL, `collection_hash` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + }, + { + "name": "index_tokens_collection_hash", + "unique": false, + "columnNames": [ + "collection_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_collection_hash` ON `${TABLE_NAME}` (`collection_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "deposit_entries", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`entry_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `members` TEXT NOT NULL, `tag` TEXT, `signature` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `is_primary` INTEGER NOT NULL, PRIMARY KEY(`entry_id`))", + "fields": [ + { + "fieldPath": "entryId", + "columnName": "entry_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "members", + "columnName": "members", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "signature", + "columnName": "signature", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isPrimary", + "columnName": "is_primary", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "entry_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "safe_snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `user_id` TEXT NOT NULL, `opponent_id` TEXT NOT NULL, `memo` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `created_at` TEXT NOT NULL, `trace_id` TEXT, `confirmations` INTEGER, `opening_balance` TEXT, `closing_balance` TEXT, `deposit` TEXT, `withdrawal` TEXT, `inscription_hash` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "deposit", + "columnName": "deposit", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawal", + "columnName": "withdrawal", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`request_id` TEXT NOT NULL, `raw_transaction` TEXT NOT NULL, `receiver_id` TEXT NOT NULL, `type` INTEGER NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`request_id`))", + "fields": [ + { + "fieldPath": "requestId", + "columnName": "request_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "rawTransaction", + "columnName": "raw_transaction", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiverId", + "columnName": "receiver_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "request_id" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_state_type", + "unique": false, + "columnNames": [ + "state", + "type" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_state_type` ON `${TABLE_NAME}` (`state`, `type`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "inscription_collections", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`collection_hash` TEXT NOT NULL, `supply` TEXT NOT NULL, `unit` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `description` TEXT, `kernel_asset_id` TEXT, `treasury` TEXT, PRIMARY KEY(`collection_hash`))", + "fields": [ + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "supply", + "columnName": "supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unit", + "columnName": "unit", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconURL", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "treasury", + "columnName": "treasury", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "collection_hash" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "inscription_items", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`inscription_hash` TEXT NOT NULL, `collection_hash` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `content_type` TEXT NOT NULL, `content_url` TEXT NOT NULL, `occupied_by` TEXT, `occupied_at` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `owner` TEXT, `traits` TEXT, PRIMARY KEY(`inscription_hash`))", + "fields": [ + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "contentType", + "columnName": "content_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "contentURL", + "columnName": "content_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "occupiedBy", + "columnName": "occupied_by", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "occupiedAt", + "columnName": "occupied_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "owner", + "columnName": "owner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traits", + "columnName": "traits", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "inscription_hash" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "markets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `current_price` TEXT NOT NULL, `market_cap` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `total_volume` TEXT NOT NULL, `high_24h` TEXT NOT NULL, `low_24h` TEXT NOT NULL, `price_change_24h` TEXT NOT NULL, `price_change_percentage_1h` TEXT NOT NULL, `price_change_percentage_24h` TEXT NOT NULL, `price_change_percentage_7d` TEXT NOT NULL, `price_change_percentage_30d` TEXT NOT NULL, `market_cap_change_24h` TEXT NOT NULL, `market_cap_change_percentage_24h` TEXT NOT NULL, `circulating_supply` TEXT NOT NULL, `total_supply` TEXT NOT NULL, `max_supply` TEXT NOT NULL, `ath` TEXT NOT NULL, `ath_change_percentage` TEXT NOT NULL, `ath_date` TEXT NOT NULL, `atl` TEXT NOT NULL, `atl_change_percentage` TEXT NOT NULL, `atl_date` TEXT NOT NULL, `asset_ids` TEXT, `sparkline_in_7d` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "currentPrice", + "columnName": "current_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCap", + "columnName": "market_cap", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalVolume", + "columnName": "total_volume", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "high24h", + "columnName": "high_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "low24h", + "columnName": "low_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChange24h", + "columnName": "price_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage1H", + "columnName": "price_change_percentage_1h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage24H", + "columnName": "price_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage7D", + "columnName": "price_change_percentage_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage30D", + "columnName": "price_change_percentage_30d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChange24h", + "columnName": "market_cap_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChangePercentage24h", + "columnName": "market_cap_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circulatingSupply", + "columnName": "circulating_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalSupply", + "columnName": "total_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "maxSupply", + "columnName": "max_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ath", + "columnName": "ath", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athChangePercentage", + "columnName": "ath_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athDate", + "columnName": "ath_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atl", + "columnName": "atl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlChangePercentage", + "columnName": "atl_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlDate", + "columnName": "atl_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetIds", + "columnName": "asset_ids", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sparklineIn7d", + "columnName": "sparkline_in_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "history_prices", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `data` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`, `type`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id", + "type" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_coins", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_favored", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `is_favored` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "isFavored", + "columnName": "is_favored", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + }, + "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, '08302a691b4e628f46e26e862deb2b00')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/60.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/60.json new file mode 100644 index 0000000000..1083e0606c --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/60.json @@ -0,0 +1,3330 @@ +{ + "formatVersion": 1, + "database": { + "version": 60, + "identityHash": "d1defdb2435eefdfe2320c9b2f404766", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, `is_deactivated` INTEGER, `membership` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "isDeactivated", + "columnName": "is_deactivated", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "membership", + "columnName": "membership", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, `withdrawal_memo_possibility` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `hidden` INTEGER, `balance` TEXT, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_extra_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_extra_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `withdrawal_memo_possibility` TEXT NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "outputs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`output_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `asset` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `amount` TEXT NOT NULL, `mask` TEXT NOT NULL, `keys` TEXT NOT NULL, `receivers` TEXT NOT NULL, `receivers_hash` TEXT NOT NULL, `receivers_threshold` INTEGER NOT NULL, `extra` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `signed_by` TEXT NOT NULL, `signed_at` TEXT NOT NULL, `spent_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`output_id`))", + "fields": [ + { + "fieldPath": "outputId", + "columnName": "output_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputIndex", + "columnName": "output_index", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "asset", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mask", + "columnName": "mask", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "keys", + "columnName": "keys", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversHash", + "columnName": "receivers_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversThreshold", + "columnName": "receivers_threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "extra", + "columnName": "extra", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedBy", + "columnName": "signed_by", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedAt", + "columnName": "signed_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "spentAt", + "columnName": "spent_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "output_id" + ] + }, + "indices": [ + { + "name": "index_outputs_asset_state_sequence", + "unique": false, + "columnNames": [ + "asset", + "state", + "sequence" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_asset_state_sequence` ON `${TABLE_NAME}` (`asset`, `state`, `sequence`)" + }, + { + "name": "index_outputs_transaction_hash_output_index", + "unique": true, + "columnNames": [ + "transaction_hash", + "output_index" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_outputs_transaction_hash_output_index` ON `${TABLE_NAME}` (`transaction_hash`, `output_index`)" + }, + { + "name": "index_outputs_inscription_hash", + "unique": false, + "columnNames": [ + "inscription_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_inscription_hash` ON `${TABLE_NAME}` (`inscription_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT NOT NULL, `dust` TEXT NOT NULL, `collection_hash` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + }, + { + "name": "index_tokens_collection_hash", + "unique": false, + "columnNames": [ + "collection_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_collection_hash` ON `${TABLE_NAME}` (`collection_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "deposit_entries", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`entry_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `members` TEXT NOT NULL, `tag` TEXT, `signature` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `is_primary` INTEGER NOT NULL, PRIMARY KEY(`entry_id`))", + "fields": [ + { + "fieldPath": "entryId", + "columnName": "entry_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "members", + "columnName": "members", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "signature", + "columnName": "signature", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isPrimary", + "columnName": "is_primary", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "entry_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "safe_snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `user_id` TEXT NOT NULL, `opponent_id` TEXT NOT NULL, `memo` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `created_at` TEXT NOT NULL, `trace_id` TEXT, `confirmations` INTEGER, `opening_balance` TEXT, `closing_balance` TEXT, `deposit` TEXT, `withdrawal` TEXT, `inscription_hash` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "deposit", + "columnName": "deposit", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawal", + "columnName": "withdrawal", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`request_id` TEXT NOT NULL, `raw_transaction` TEXT NOT NULL, `receiver_id` TEXT NOT NULL, `type` INTEGER NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`request_id`))", + "fields": [ + { + "fieldPath": "requestId", + "columnName": "request_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "rawTransaction", + "columnName": "raw_transaction", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiverId", + "columnName": "receiver_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "request_id" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_state_type", + "unique": false, + "columnNames": [ + "state", + "type" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_state_type` ON `${TABLE_NAME}` (`state`, `type`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "inscription_collections", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`collection_hash` TEXT NOT NULL, `supply` TEXT NOT NULL, `unit` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `description` TEXT, `kernel_asset_id` TEXT, `treasury` TEXT, PRIMARY KEY(`collection_hash`))", + "fields": [ + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "supply", + "columnName": "supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unit", + "columnName": "unit", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconURL", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "treasury", + "columnName": "treasury", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "collection_hash" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "inscription_items", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`inscription_hash` TEXT NOT NULL, `collection_hash` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `content_type` TEXT NOT NULL, `content_url` TEXT NOT NULL, `occupied_by` TEXT, `occupied_at` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `owner` TEXT, `traits` TEXT, PRIMARY KEY(`inscription_hash`))", + "fields": [ + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "contentType", + "columnName": "content_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "contentURL", + "columnName": "content_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "occupiedBy", + "columnName": "occupied_by", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "occupiedAt", + "columnName": "occupied_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "owner", + "columnName": "owner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traits", + "columnName": "traits", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "inscription_hash" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "markets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `current_price` TEXT NOT NULL, `market_cap` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `total_volume` TEXT NOT NULL, `high_24h` TEXT NOT NULL, `low_24h` TEXT NOT NULL, `price_change_24h` TEXT NOT NULL, `price_change_percentage_1h` TEXT NOT NULL, `price_change_percentage_24h` TEXT NOT NULL, `price_change_percentage_7d` TEXT NOT NULL, `price_change_percentage_30d` TEXT NOT NULL, `market_cap_change_24h` TEXT NOT NULL, `market_cap_change_percentage_24h` TEXT NOT NULL, `circulating_supply` TEXT NOT NULL, `total_supply` TEXT NOT NULL, `max_supply` TEXT NOT NULL, `ath` TEXT NOT NULL, `ath_change_percentage` TEXT NOT NULL, `ath_date` TEXT NOT NULL, `atl` TEXT NOT NULL, `atl_change_percentage` TEXT NOT NULL, `atl_date` TEXT NOT NULL, `asset_ids` TEXT, `sparkline_in_7d` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "currentPrice", + "columnName": "current_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCap", + "columnName": "market_cap", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalVolume", + "columnName": "total_volume", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "high24h", + "columnName": "high_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "low24h", + "columnName": "low_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChange24h", + "columnName": "price_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage1H", + "columnName": "price_change_percentage_1h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage24H", + "columnName": "price_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage7D", + "columnName": "price_change_percentage_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage30D", + "columnName": "price_change_percentage_30d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChange24h", + "columnName": "market_cap_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChangePercentage24h", + "columnName": "market_cap_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circulatingSupply", + "columnName": "circulating_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalSupply", + "columnName": "total_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "maxSupply", + "columnName": "max_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ath", + "columnName": "ath", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athChangePercentage", + "columnName": "ath_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athDate", + "columnName": "ath_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atl", + "columnName": "atl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlChangePercentage", + "columnName": "atl_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlDate", + "columnName": "atl_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetIds", + "columnName": "asset_ids", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sparklineIn7d", + "columnName": "sparkline_in_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "history_prices", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `data` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`, `type`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id", + "type" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_coins", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_favored", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `is_favored` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "isFavored", + "columnName": "is_favored", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + }, + "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, 'd1defdb2435eefdfe2320c9b2f404766')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/61.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/61.json new file mode 100644 index 0000000000..f48ab95b5f --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/61.json @@ -0,0 +1,3350 @@ +{ + "formatVersion": 1, + "database": { + "version": 61, + "identityHash": "59950bf77168fb6f16409fa6587de39f", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, `is_deactivated` INTEGER, `membership` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "isDeactivated", + "columnName": "is_deactivated", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "membership", + "columnName": "membership", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, `withdrawal_memo_possibility` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `hidden` INTEGER, `balance` TEXT, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_extra_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_extra_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `withdrawal_memo_possibility` TEXT NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "outputs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`output_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `asset` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `amount` TEXT NOT NULL, `mask` TEXT NOT NULL, `keys` TEXT NOT NULL, `receivers` TEXT NOT NULL, `receivers_hash` TEXT NOT NULL, `receivers_threshold` INTEGER NOT NULL, `extra` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `signed_by` TEXT NOT NULL, `signed_at` TEXT NOT NULL, `spent_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`output_id`))", + "fields": [ + { + "fieldPath": "outputId", + "columnName": "output_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputIndex", + "columnName": "output_index", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "asset", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mask", + "columnName": "mask", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "keys", + "columnName": "keys", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversHash", + "columnName": "receivers_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversThreshold", + "columnName": "receivers_threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "extra", + "columnName": "extra", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedBy", + "columnName": "signed_by", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedAt", + "columnName": "signed_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "spentAt", + "columnName": "spent_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "output_id" + ] + }, + "indices": [ + { + "name": "index_outputs_asset_state_sequence", + "unique": false, + "columnNames": [ + "asset", + "state", + "sequence" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_asset_state_sequence` ON `${TABLE_NAME}` (`asset`, `state`, `sequence`)" + }, + { + "name": "index_outputs_transaction_hash_output_index", + "unique": true, + "columnNames": [ + "transaction_hash", + "output_index" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_outputs_transaction_hash_output_index` ON `${TABLE_NAME}` (`transaction_hash`, `output_index`)" + }, + { + "name": "index_outputs_inscription_hash", + "unique": false, + "columnNames": [ + "inscription_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_inscription_hash` ON `${TABLE_NAME}` (`inscription_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT NOT NULL, `dust` TEXT NOT NULL, `collection_hash` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + }, + { + "name": "index_tokens_collection_hash", + "unique": false, + "columnNames": [ + "collection_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_collection_hash` ON `${TABLE_NAME}` (`collection_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "deposit_entries", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`entry_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `members` TEXT NOT NULL, `tag` TEXT, `signature` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `is_primary` INTEGER NOT NULL, PRIMARY KEY(`entry_id`))", + "fields": [ + { + "fieldPath": "entryId", + "columnName": "entry_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "members", + "columnName": "members", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "signature", + "columnName": "signature", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isPrimary", + "columnName": "is_primary", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "entry_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "safe_snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `user_id` TEXT NOT NULL, `opponent_id` TEXT NOT NULL, `memo` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `created_at` TEXT NOT NULL, `trace_id` TEXT, `confirmations` INTEGER, `opening_balance` TEXT, `closing_balance` TEXT, `deposit` TEXT, `withdrawal` TEXT, `inscription_hash` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "deposit", + "columnName": "deposit", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawal", + "columnName": "withdrawal", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [ + { + "name": "index_safe_snapshots_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_safe_snapshots_created_at` ON `${TABLE_NAME}` (`created_at`)" + }, + { + "name": "index_safe_snapshots_type_asset_id", + "unique": false, + "columnNames": [ + "type", + "asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_safe_snapshots_type_asset_id` ON `${TABLE_NAME}` (`type`, `asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`request_id` TEXT NOT NULL, `raw_transaction` TEXT NOT NULL, `receiver_id` TEXT NOT NULL, `type` INTEGER NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`request_id`))", + "fields": [ + { + "fieldPath": "requestId", + "columnName": "request_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "rawTransaction", + "columnName": "raw_transaction", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiverId", + "columnName": "receiver_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "request_id" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_state_type", + "unique": false, + "columnNames": [ + "state", + "type" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_state_type` ON `${TABLE_NAME}` (`state`, `type`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "inscription_collections", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`collection_hash` TEXT NOT NULL, `supply` TEXT NOT NULL, `unit` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `description` TEXT, `kernel_asset_id` TEXT, `treasury` TEXT, PRIMARY KEY(`collection_hash`))", + "fields": [ + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "supply", + "columnName": "supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unit", + "columnName": "unit", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconURL", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "treasury", + "columnName": "treasury", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "collection_hash" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "inscription_items", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`inscription_hash` TEXT NOT NULL, `collection_hash` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `content_type` TEXT NOT NULL, `content_url` TEXT NOT NULL, `occupied_by` TEXT, `occupied_at` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `owner` TEXT, `traits` TEXT, PRIMARY KEY(`inscription_hash`))", + "fields": [ + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "contentType", + "columnName": "content_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "contentURL", + "columnName": "content_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "occupiedBy", + "columnName": "occupied_by", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "occupiedAt", + "columnName": "occupied_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "owner", + "columnName": "owner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traits", + "columnName": "traits", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "inscription_hash" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "markets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `current_price` TEXT NOT NULL, `market_cap` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `total_volume` TEXT NOT NULL, `high_24h` TEXT NOT NULL, `low_24h` TEXT NOT NULL, `price_change_24h` TEXT NOT NULL, `price_change_percentage_1h` TEXT NOT NULL, `price_change_percentage_24h` TEXT NOT NULL, `price_change_percentage_7d` TEXT NOT NULL, `price_change_percentage_30d` TEXT NOT NULL, `market_cap_change_24h` TEXT NOT NULL, `market_cap_change_percentage_24h` TEXT NOT NULL, `circulating_supply` TEXT NOT NULL, `total_supply` TEXT NOT NULL, `max_supply` TEXT NOT NULL, `ath` TEXT NOT NULL, `ath_change_percentage` TEXT NOT NULL, `ath_date` TEXT NOT NULL, `atl` TEXT NOT NULL, `atl_change_percentage` TEXT NOT NULL, `atl_date` TEXT NOT NULL, `asset_ids` TEXT, `sparkline_in_7d` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "currentPrice", + "columnName": "current_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCap", + "columnName": "market_cap", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalVolume", + "columnName": "total_volume", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "high24h", + "columnName": "high_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "low24h", + "columnName": "low_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChange24h", + "columnName": "price_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage1H", + "columnName": "price_change_percentage_1h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage24H", + "columnName": "price_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage7D", + "columnName": "price_change_percentage_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage30D", + "columnName": "price_change_percentage_30d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChange24h", + "columnName": "market_cap_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChangePercentage24h", + "columnName": "market_cap_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circulatingSupply", + "columnName": "circulating_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalSupply", + "columnName": "total_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "maxSupply", + "columnName": "max_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ath", + "columnName": "ath", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athChangePercentage", + "columnName": "ath_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athDate", + "columnName": "ath_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atl", + "columnName": "atl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlChangePercentage", + "columnName": "atl_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlDate", + "columnName": "atl_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetIds", + "columnName": "asset_ids", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sparklineIn7d", + "columnName": "sparkline_in_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "history_prices", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `data` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`, `type`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id", + "type" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_coins", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_favored", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `is_favored` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "isFavored", + "columnName": "is_favored", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + }, + "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, '59950bf77168fb6f16409fa6587de39f')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/62.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/62.json new file mode 100644 index 0000000000..e0ddc9bea7 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/62.json @@ -0,0 +1,3438 @@ +{ + "formatVersion": 1, + "database": { + "version": 62, + "identityHash": "e1e0a8b135f9f065974e72537734d377", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, `is_deactivated` INTEGER, `membership` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "isDeactivated", + "columnName": "is_deactivated", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "membership", + "columnName": "membership", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, `withdrawal_memo_possibility` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `hidden` INTEGER, `balance` TEXT, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_extra_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_extra_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `withdrawal_memo_possibility` TEXT NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "outputs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`output_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `asset` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `amount` TEXT NOT NULL, `mask` TEXT NOT NULL, `keys` TEXT NOT NULL, `receivers` TEXT NOT NULL, `receivers_hash` TEXT NOT NULL, `receivers_threshold` INTEGER NOT NULL, `extra` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `signed_by` TEXT NOT NULL, `signed_at` TEXT NOT NULL, `spent_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`output_id`))", + "fields": [ + { + "fieldPath": "outputId", + "columnName": "output_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputIndex", + "columnName": "output_index", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "asset", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mask", + "columnName": "mask", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "keys", + "columnName": "keys", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversHash", + "columnName": "receivers_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversThreshold", + "columnName": "receivers_threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "extra", + "columnName": "extra", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedBy", + "columnName": "signed_by", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedAt", + "columnName": "signed_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "spentAt", + "columnName": "spent_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "output_id" + ] + }, + "indices": [ + { + "name": "index_outputs_asset_state_sequence", + "unique": false, + "columnNames": [ + "asset", + "state", + "sequence" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_asset_state_sequence` ON `${TABLE_NAME}` (`asset`, `state`, `sequence`)" + }, + { + "name": "index_outputs_transaction_hash_output_index", + "unique": true, + "columnNames": [ + "transaction_hash", + "output_index" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_outputs_transaction_hash_output_index` ON `${TABLE_NAME}` (`transaction_hash`, `output_index`)" + }, + { + "name": "index_outputs_inscription_hash", + "unique": false, + "columnNames": [ + "inscription_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_inscription_hash` ON `${TABLE_NAME}` (`inscription_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT NOT NULL, `dust` TEXT NOT NULL, `collection_hash` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + }, + { + "name": "index_tokens_collection_hash", + "unique": false, + "columnNames": [ + "collection_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_collection_hash` ON `${TABLE_NAME}` (`collection_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "deposit_entries", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`entry_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `members` TEXT NOT NULL, `tag` TEXT, `signature` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `is_primary` INTEGER NOT NULL, PRIMARY KEY(`entry_id`))", + "fields": [ + { + "fieldPath": "entryId", + "columnName": "entry_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "members", + "columnName": "members", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "signature", + "columnName": "signature", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isPrimary", + "columnName": "is_primary", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "entry_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "safe_snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `user_id` TEXT NOT NULL, `opponent_id` TEXT NOT NULL, `memo` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `created_at` TEXT NOT NULL, `trace_id` TEXT, `confirmations` INTEGER, `opening_balance` TEXT, `closing_balance` TEXT, `deposit` TEXT, `withdrawal` TEXT, `inscription_hash` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "deposit", + "columnName": "deposit", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawal", + "columnName": "withdrawal", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [ + { + "name": "index_safe_snapshots_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_safe_snapshots_created_at` ON `${TABLE_NAME}` (`created_at`)" + }, + { + "name": "index_safe_snapshots_type_asset_id", + "unique": false, + "columnNames": [ + "type", + "asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_safe_snapshots_type_asset_id` ON `${TABLE_NAME}` (`type`, `asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`request_id` TEXT NOT NULL, `raw_transaction` TEXT NOT NULL, `receiver_id` TEXT NOT NULL, `type` INTEGER NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`request_id`))", + "fields": [ + { + "fieldPath": "requestId", + "columnName": "request_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "rawTransaction", + "columnName": "raw_transaction", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiverId", + "columnName": "receiver_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "request_id" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_state_type", + "unique": false, + "columnNames": [ + "state", + "type" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_state_type` ON `${TABLE_NAME}` (`state`, `type`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "inscription_collections", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`collection_hash` TEXT NOT NULL, `supply` TEXT NOT NULL, `unit` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `description` TEXT, `kernel_asset_id` TEXT, `treasury` TEXT, PRIMARY KEY(`collection_hash`))", + "fields": [ + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "supply", + "columnName": "supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unit", + "columnName": "unit", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconURL", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "treasury", + "columnName": "treasury", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "collection_hash" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "inscription_items", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`inscription_hash` TEXT NOT NULL, `collection_hash` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `content_type` TEXT NOT NULL, `content_url` TEXT NOT NULL, `occupied_by` TEXT, `occupied_at` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `owner` TEXT, `traits` TEXT, PRIMARY KEY(`inscription_hash`))", + "fields": [ + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "contentType", + "columnName": "content_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "contentURL", + "columnName": "content_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "occupiedBy", + "columnName": "occupied_by", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "occupiedAt", + "columnName": "occupied_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "owner", + "columnName": "owner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traits", + "columnName": "traits", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "inscription_hash" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "markets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `current_price` TEXT NOT NULL, `market_cap` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `total_volume` TEXT NOT NULL, `high_24h` TEXT NOT NULL, `low_24h` TEXT NOT NULL, `price_change_24h` TEXT NOT NULL, `price_change_percentage_1h` TEXT NOT NULL, `price_change_percentage_24h` TEXT NOT NULL, `price_change_percentage_7d` TEXT NOT NULL, `price_change_percentage_30d` TEXT NOT NULL, `market_cap_change_24h` TEXT NOT NULL, `market_cap_change_percentage_24h` TEXT NOT NULL, `circulating_supply` TEXT NOT NULL, `total_supply` TEXT NOT NULL, `max_supply` TEXT NOT NULL, `ath` TEXT NOT NULL, `ath_change_percentage` TEXT NOT NULL, `ath_date` TEXT NOT NULL, `atl` TEXT NOT NULL, `atl_change_percentage` TEXT NOT NULL, `atl_date` TEXT NOT NULL, `asset_ids` TEXT, `sparkline_in_7d` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "currentPrice", + "columnName": "current_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCap", + "columnName": "market_cap", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalVolume", + "columnName": "total_volume", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "high24h", + "columnName": "high_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "low24h", + "columnName": "low_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChange24h", + "columnName": "price_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage1H", + "columnName": "price_change_percentage_1h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage24H", + "columnName": "price_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage7D", + "columnName": "price_change_percentage_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage30D", + "columnName": "price_change_percentage_30d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChange24h", + "columnName": "market_cap_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChangePercentage24h", + "columnName": "market_cap_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circulatingSupply", + "columnName": "circulating_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalSupply", + "columnName": "total_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "maxSupply", + "columnName": "max_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ath", + "columnName": "ath", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athChangePercentage", + "columnName": "ath_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athDate", + "columnName": "ath_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atl", + "columnName": "atl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlChangePercentage", + "columnName": "atl_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlDate", + "columnName": "atl_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetIds", + "columnName": "asset_ids", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sparklineIn7d", + "columnName": "sparkline_in_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "history_prices", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `data` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`, `type`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id", + "type" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_coins", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_favored", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `is_favored` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "isFavored", + "columnName": "is_favored", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_alerts", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`alert_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `frequency` TEXT NOT NULL, `status` TEXT NOT NULL, `value` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`alert_id`))", + "fields": [ + { + "fieldPath": "alertId", + "columnName": "alert_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "frequency", + "columnName": "frequency", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "alert_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_cap_ranks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + }, + "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, 'e1e0a8b135f9f065974e72537734d377')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/63.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/63.json new file mode 100644 index 0000000000..38b0175310 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/63.json @@ -0,0 +1,3445 @@ +{ + "formatVersion": 1, + "database": { + "version": 63, + "identityHash": "ceda1faafc44c52d20ec8a503b3a3ad4", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, `is_deactivated` INTEGER, `membership` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "isDeactivated", + "columnName": "is_deactivated", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "membership", + "columnName": "membership", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, `withdrawal_memo_possibility` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `hidden` INTEGER, `balance` TEXT, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_extra_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_extra_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `withdrawal_memo_possibility` TEXT NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "outputs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`output_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `asset` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `amount` TEXT NOT NULL, `mask` TEXT NOT NULL, `keys` TEXT NOT NULL, `receivers` TEXT NOT NULL, `receivers_hash` TEXT NOT NULL, `receivers_threshold` INTEGER NOT NULL, `extra` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `signed_by` TEXT NOT NULL, `signed_at` TEXT NOT NULL, `spent_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`output_id`))", + "fields": [ + { + "fieldPath": "outputId", + "columnName": "output_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputIndex", + "columnName": "output_index", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "asset", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mask", + "columnName": "mask", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "keys", + "columnName": "keys", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversHash", + "columnName": "receivers_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversThreshold", + "columnName": "receivers_threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "extra", + "columnName": "extra", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedBy", + "columnName": "signed_by", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedAt", + "columnName": "signed_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "spentAt", + "columnName": "spent_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "output_id" + ] + }, + "indices": [ + { + "name": "index_outputs_asset_state_sequence", + "unique": false, + "columnNames": [ + "asset", + "state", + "sequence" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_asset_state_sequence` ON `${TABLE_NAME}` (`asset`, `state`, `sequence`)" + }, + { + "name": "index_outputs_transaction_hash_output_index", + "unique": true, + "columnNames": [ + "transaction_hash", + "output_index" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_outputs_transaction_hash_output_index` ON `${TABLE_NAME}` (`transaction_hash`, `output_index`)" + }, + { + "name": "index_outputs_inscription_hash", + "unique": false, + "columnNames": [ + "inscription_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_inscription_hash` ON `${TABLE_NAME}` (`inscription_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT NOT NULL, `dust` TEXT NOT NULL, `collection_hash` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + }, + { + "name": "index_tokens_collection_hash", + "unique": false, + "columnNames": [ + "collection_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_collection_hash` ON `${TABLE_NAME}` (`collection_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "deposit_entries", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`entry_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `members` TEXT NOT NULL, `tag` TEXT, `signature` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `is_primary` INTEGER NOT NULL, PRIMARY KEY(`entry_id`))", + "fields": [ + { + "fieldPath": "entryId", + "columnName": "entry_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "members", + "columnName": "members", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "signature", + "columnName": "signature", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isPrimary", + "columnName": "is_primary", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "entry_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "safe_snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `user_id` TEXT NOT NULL, `opponent_id` TEXT NOT NULL, `memo` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `created_at` TEXT NOT NULL, `trace_id` TEXT, `confirmations` INTEGER, `opening_balance` TEXT, `closing_balance` TEXT, `deposit` TEXT, `withdrawal` TEXT, `inscription_hash` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "deposit", + "columnName": "deposit", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawal", + "columnName": "withdrawal", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [ + { + "name": "index_safe_snapshots_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_safe_snapshots_created_at` ON `${TABLE_NAME}` (`created_at`)" + }, + { + "name": "index_safe_snapshots_type_asset_id", + "unique": false, + "columnNames": [ + "type", + "asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_safe_snapshots_type_asset_id` ON `${TABLE_NAME}` (`type`, `asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`request_id` TEXT NOT NULL, `raw_transaction` TEXT NOT NULL, `receiver_id` TEXT NOT NULL, `type` INTEGER NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`request_id`))", + "fields": [ + { + "fieldPath": "requestId", + "columnName": "request_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "rawTransaction", + "columnName": "raw_transaction", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiverId", + "columnName": "receiver_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "request_id" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_state_type", + "unique": false, + "columnNames": [ + "state", + "type" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_state_type` ON `${TABLE_NAME}` (`state`, `type`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "inscription_collections", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`collection_hash` TEXT NOT NULL, `supply` TEXT NOT NULL, `unit` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `description` TEXT, `kernel_asset_id` TEXT, `treasury` TEXT, PRIMARY KEY(`collection_hash`))", + "fields": [ + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "supply", + "columnName": "supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unit", + "columnName": "unit", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconURL", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "treasury", + "columnName": "treasury", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "collection_hash" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "inscription_items", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`inscription_hash` TEXT NOT NULL, `collection_hash` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `content_type` TEXT NOT NULL, `content_url` TEXT NOT NULL, `occupied_by` TEXT, `occupied_at` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `owner` TEXT, `traits` TEXT, PRIMARY KEY(`inscription_hash`))", + "fields": [ + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "contentType", + "columnName": "content_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "contentURL", + "columnName": "content_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "occupiedBy", + "columnName": "occupied_by", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "occupiedAt", + "columnName": "occupied_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "owner", + "columnName": "owner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traits", + "columnName": "traits", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "inscription_hash" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "markets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `current_price` TEXT NOT NULL, `market_cap` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `total_volume` TEXT NOT NULL, `high_24h` TEXT NOT NULL, `low_24h` TEXT NOT NULL, `price_change_24h` TEXT NOT NULL, `price_change_percentage_1h` TEXT NOT NULL, `price_change_percentage_24h` TEXT NOT NULL, `price_change_percentage_7d` TEXT NOT NULL, `price_change_percentage_30d` TEXT NOT NULL, `market_cap_change_24h` TEXT NOT NULL, `market_cap_change_percentage_24h` TEXT NOT NULL, `circulating_supply` TEXT NOT NULL, `total_supply` TEXT NOT NULL, `max_supply` TEXT NOT NULL, `ath` TEXT NOT NULL, `ath_change_percentage` TEXT NOT NULL, `ath_date` TEXT NOT NULL, `atl` TEXT NOT NULL, `atl_change_percentage` TEXT NOT NULL, `atl_date` TEXT NOT NULL, `asset_ids` TEXT, `sparkline_in_7d` TEXT NOT NULL, `sparkline_in_24h` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "currentPrice", + "columnName": "current_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCap", + "columnName": "market_cap", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalVolume", + "columnName": "total_volume", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "high24h", + "columnName": "high_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "low24h", + "columnName": "low_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChange24h", + "columnName": "price_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage1H", + "columnName": "price_change_percentage_1h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage24H", + "columnName": "price_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage7D", + "columnName": "price_change_percentage_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage30D", + "columnName": "price_change_percentage_30d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChange24h", + "columnName": "market_cap_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChangePercentage24h", + "columnName": "market_cap_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circulatingSupply", + "columnName": "circulating_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalSupply", + "columnName": "total_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "maxSupply", + "columnName": "max_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ath", + "columnName": "ath", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athChangePercentage", + "columnName": "ath_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athDate", + "columnName": "ath_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atl", + "columnName": "atl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlChangePercentage", + "columnName": "atl_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlDate", + "columnName": "atl_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetIds", + "columnName": "asset_ids", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sparklineIn7d", + "columnName": "sparkline_in_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sparklineIn24h", + "columnName": "sparkline_in_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "history_prices", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `data` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`, `type`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id", + "type" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_coins", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_favored", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `is_favored` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "isFavored", + "columnName": "is_favored", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_alerts", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`alert_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `frequency` TEXT NOT NULL, `status` TEXT NOT NULL, `value` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`alert_id`))", + "fields": [ + { + "fieldPath": "alertId", + "columnName": "alert_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "frequency", + "columnName": "frequency", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "alert_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_cap_ranks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + }, + "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, 'ceda1faafc44c52d20ec8a503b3a3ad4')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/64.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/64.json new file mode 100644 index 0000000000..a95bcc6d06 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/64.json @@ -0,0 +1,3536 @@ +{ + "formatVersion": 1, + "database": { + "version": 64, + "identityHash": "47e62efc3602d28d5c9db51af6f5b7e5", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, `is_deactivated` INTEGER, `membership` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "isDeactivated", + "columnName": "is_deactivated", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "membership", + "columnName": "membership", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, `withdrawal_memo_possibility` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `hidden` INTEGER, `balance` TEXT, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_extra_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_extra_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `withdrawal_memo_possibility` TEXT NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "outputs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`output_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `asset` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `amount` TEXT NOT NULL, `mask` TEXT NOT NULL, `keys` TEXT NOT NULL, `receivers` TEXT NOT NULL, `receivers_hash` TEXT NOT NULL, `receivers_threshold` INTEGER NOT NULL, `extra` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `signed_by` TEXT NOT NULL, `signed_at` TEXT NOT NULL, `spent_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`output_id`))", + "fields": [ + { + "fieldPath": "outputId", + "columnName": "output_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputIndex", + "columnName": "output_index", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "asset", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mask", + "columnName": "mask", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "keys", + "columnName": "keys", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversHash", + "columnName": "receivers_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversThreshold", + "columnName": "receivers_threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "extra", + "columnName": "extra", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedBy", + "columnName": "signed_by", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedAt", + "columnName": "signed_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "spentAt", + "columnName": "spent_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "output_id" + ] + }, + "indices": [ + { + "name": "index_outputs_asset_state_sequence", + "unique": false, + "columnNames": [ + "asset", + "state", + "sequence" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_asset_state_sequence` ON `${TABLE_NAME}` (`asset`, `state`, `sequence`)" + }, + { + "name": "index_outputs_transaction_hash_output_index", + "unique": true, + "columnNames": [ + "transaction_hash", + "output_index" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_outputs_transaction_hash_output_index` ON `${TABLE_NAME}` (`transaction_hash`, `output_index`)" + }, + { + "name": "index_outputs_inscription_hash", + "unique": false, + "columnNames": [ + "inscription_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_inscription_hash` ON `${TABLE_NAME}` (`inscription_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT NOT NULL, `dust` TEXT NOT NULL, `collection_hash` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + }, + { + "name": "index_tokens_collection_hash", + "unique": false, + "columnNames": [ + "collection_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_collection_hash` ON `${TABLE_NAME}` (`collection_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "deposit_entries", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`entry_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `members` TEXT NOT NULL, `tag` TEXT, `signature` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `is_primary` INTEGER NOT NULL, PRIMARY KEY(`entry_id`))", + "fields": [ + { + "fieldPath": "entryId", + "columnName": "entry_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "members", + "columnName": "members", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "signature", + "columnName": "signature", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isPrimary", + "columnName": "is_primary", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "entry_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "safe_snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `user_id` TEXT NOT NULL, `opponent_id` TEXT NOT NULL, `memo` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `created_at` TEXT NOT NULL, `trace_id` TEXT, `confirmations` INTEGER, `opening_balance` TEXT, `closing_balance` TEXT, `deposit` TEXT, `withdrawal` TEXT, `inscription_hash` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "deposit", + "columnName": "deposit", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawal", + "columnName": "withdrawal", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [ + { + "name": "index_safe_snapshots_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_safe_snapshots_created_at` ON `${TABLE_NAME}` (`created_at`)" + }, + { + "name": "index_safe_snapshots_type_asset_id", + "unique": false, + "columnNames": [ + "type", + "asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_safe_snapshots_type_asset_id` ON `${TABLE_NAME}` (`type`, `asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`request_id` TEXT NOT NULL, `raw_transaction` TEXT NOT NULL, `receiver_id` TEXT NOT NULL, `type` INTEGER NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`request_id`))", + "fields": [ + { + "fieldPath": "requestId", + "columnName": "request_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "rawTransaction", + "columnName": "raw_transaction", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiverId", + "columnName": "receiver_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "request_id" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_state_type", + "unique": false, + "columnNames": [ + "state", + "type" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_state_type` ON `${TABLE_NAME}` (`state`, `type`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "inscription_collections", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`collection_hash` TEXT NOT NULL, `supply` TEXT NOT NULL, `unit` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `description` TEXT, `kernel_asset_id` TEXT, `treasury` TEXT, PRIMARY KEY(`collection_hash`))", + "fields": [ + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "supply", + "columnName": "supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unit", + "columnName": "unit", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconURL", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "treasury", + "columnName": "treasury", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "collection_hash" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "inscription_items", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`inscription_hash` TEXT NOT NULL, `collection_hash` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `content_type` TEXT NOT NULL, `content_url` TEXT NOT NULL, `occupied_by` TEXT, `occupied_at` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `owner` TEXT, `traits` TEXT, PRIMARY KEY(`inscription_hash`))", + "fields": [ + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "contentType", + "columnName": "content_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "contentURL", + "columnName": "content_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "occupiedBy", + "columnName": "occupied_by", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "occupiedAt", + "columnName": "occupied_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "owner", + "columnName": "owner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traits", + "columnName": "traits", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "inscription_hash" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "markets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `current_price` TEXT NOT NULL, `market_cap` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `total_volume` TEXT NOT NULL, `high_24h` TEXT NOT NULL, `low_24h` TEXT NOT NULL, `price_change_24h` TEXT NOT NULL, `price_change_percentage_1h` TEXT NOT NULL, `price_change_percentage_24h` TEXT NOT NULL, `price_change_percentage_7d` TEXT NOT NULL, `price_change_percentage_30d` TEXT NOT NULL, `market_cap_change_24h` TEXT NOT NULL, `market_cap_change_percentage_24h` TEXT NOT NULL, `circulating_supply` TEXT NOT NULL, `total_supply` TEXT NOT NULL, `max_supply` TEXT NOT NULL, `ath` TEXT NOT NULL, `ath_change_percentage` TEXT NOT NULL, `ath_date` TEXT NOT NULL, `atl` TEXT NOT NULL, `atl_change_percentage` TEXT NOT NULL, `atl_date` TEXT NOT NULL, `asset_ids` TEXT, `sparkline_in_7d` TEXT NOT NULL, `sparkline_in_24h` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "currentPrice", + "columnName": "current_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCap", + "columnName": "market_cap", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalVolume", + "columnName": "total_volume", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "high24h", + "columnName": "high_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "low24h", + "columnName": "low_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChange24h", + "columnName": "price_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage1H", + "columnName": "price_change_percentage_1h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage24H", + "columnName": "price_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage7D", + "columnName": "price_change_percentage_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage30D", + "columnName": "price_change_percentage_30d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChange24h", + "columnName": "market_cap_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChangePercentage24h", + "columnName": "market_cap_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circulatingSupply", + "columnName": "circulating_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalSupply", + "columnName": "total_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "maxSupply", + "columnName": "max_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ath", + "columnName": "ath", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athChangePercentage", + "columnName": "ath_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athDate", + "columnName": "ath_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atl", + "columnName": "atl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlChangePercentage", + "columnName": "atl_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlDate", + "columnName": "atl_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetIds", + "columnName": "asset_ids", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sparklineIn7d", + "columnName": "sparkline_in_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sparklineIn24h", + "columnName": "sparkline_in_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "history_prices", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `data` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`, `type`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id", + "type" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_coins", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_favored", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `is_favored` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "isFavored", + "columnName": "is_favored", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_alerts", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`alert_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `frequency` TEXT NOT NULL, `status` TEXT NOT NULL, `value` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`alert_id`))", + "fields": [ + { + "fieldPath": "alertId", + "columnName": "alert_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "frequency", + "columnName": "frequency", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "alert_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_cap_ranks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "swap_orders", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`order_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `pay_asset_id` TEXT NOT NULL, `receive_asset_id` TEXT NOT NULL, `pay_amount` TEXT NOT NULL, `receive_amount` TEXT NOT NULL, `pay_trace_id` TEXT NOT NULL, `receive_trace_id` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_type` TEXT NOT NULL, PRIMARY KEY(`order_id`))", + "fields": [ + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payAssetId", + "columnName": "pay_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiveAssetId", + "columnName": "receive_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payAmount", + "columnName": "pay_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiveAmount", + "columnName": "receive_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payTraceId", + "columnName": "pay_trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiveTraceId", + "columnName": "receive_trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderType", + "columnName": "order_type", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "order_id" + ] + }, + "indices": [ + { + "name": "index_swap_orders_state_created_at", + "unique": false, + "columnNames": [ + "state", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_swap_orders_state_created_at` ON `${TABLE_NAME}` (`state`, `created_at`)" + } + ], + "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, '47e62efc3602d28d5c9db51af6f5b7e5')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/65.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/65.json new file mode 100644 index 0000000000..89b9911430 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/65.json @@ -0,0 +1,3553 @@ +{ + "formatVersion": 1, + "database": { + "version": 65, + "identityHash": "ea59ef6c056664f70f7cb67941e1c68d", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, `is_deactivated` INTEGER, `membership` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "isDeactivated", + "columnName": "is_deactivated", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "membership", + "columnName": "membership", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, `withdrawal_memo_possibility` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `hidden` INTEGER, `balance` TEXT, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_extra_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_extra_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [ + { + "name": "index_addresses_chain_id_updated_at", + "unique": false, + "columnNames": [ + "chain_id", + "updated_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_addresses_chain_id_updated_at` ON `${TABLE_NAME}` (`chain_id`, `updated_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ], + "foreignKeys": [] + }, + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `withdrawal_memo_possibility` TEXT NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "outputs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`output_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `asset` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `amount` TEXT NOT NULL, `mask` TEXT NOT NULL, `keys` TEXT NOT NULL, `receivers` TEXT NOT NULL, `receivers_hash` TEXT NOT NULL, `receivers_threshold` INTEGER NOT NULL, `extra` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `signed_by` TEXT NOT NULL, `signed_at` TEXT NOT NULL, `spent_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`output_id`))", + "fields": [ + { + "fieldPath": "outputId", + "columnName": "output_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputIndex", + "columnName": "output_index", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "asset", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mask", + "columnName": "mask", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "keys", + "columnName": "keys", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversHash", + "columnName": "receivers_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversThreshold", + "columnName": "receivers_threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "extra", + "columnName": "extra", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedBy", + "columnName": "signed_by", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedAt", + "columnName": "signed_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "spentAt", + "columnName": "spent_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "output_id" + ] + }, + "indices": [ + { + "name": "index_outputs_asset_state_sequence", + "unique": false, + "columnNames": [ + "asset", + "state", + "sequence" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_asset_state_sequence` ON `${TABLE_NAME}` (`asset`, `state`, `sequence`)" + }, + { + "name": "index_outputs_transaction_hash_output_index", + "unique": true, + "columnNames": [ + "transaction_hash", + "output_index" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_outputs_transaction_hash_output_index` ON `${TABLE_NAME}` (`transaction_hash`, `output_index`)" + }, + { + "name": "index_outputs_inscription_hash", + "unique": false, + "columnNames": [ + "inscription_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_inscription_hash` ON `${TABLE_NAME}` (`inscription_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT NOT NULL, `dust` TEXT NOT NULL, `collection_hash` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + }, + { + "name": "index_tokens_collection_hash", + "unique": false, + "columnNames": [ + "collection_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_collection_hash` ON `${TABLE_NAME}` (`collection_hash`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "deposit_entries", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`entry_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `members` TEXT NOT NULL, `tag` TEXT, `signature` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `is_primary` INTEGER NOT NULL, PRIMARY KEY(`entry_id`))", + "fields": [ + { + "fieldPath": "entryId", + "columnName": "entry_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "members", + "columnName": "members", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "signature", + "columnName": "signature", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isPrimary", + "columnName": "is_primary", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "entry_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "safe_snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `user_id` TEXT NOT NULL, `opponent_id` TEXT NOT NULL, `memo` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `created_at` TEXT NOT NULL, `trace_id` TEXT, `confirmations` INTEGER, `opening_balance` TEXT, `closing_balance` TEXT, `deposit` TEXT, `withdrawal` TEXT, `inscription_hash` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "deposit", + "columnName": "deposit", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "withdrawal", + "columnName": "withdrawal", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [ + { + "name": "index_safe_snapshots_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_safe_snapshots_created_at` ON `${TABLE_NAME}` (`created_at`)" + }, + { + "name": "index_safe_snapshots_type_asset_id", + "unique": false, + "columnNames": [ + "type", + "asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_safe_snapshots_type_asset_id` ON `${TABLE_NAME}` (`type`, `asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`request_id` TEXT NOT NULL, `raw_transaction` TEXT NOT NULL, `receiver_id` TEXT NOT NULL, `type` INTEGER NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`request_id`))", + "fields": [ + { + "fieldPath": "requestId", + "columnName": "request_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "rawTransaction", + "columnName": "raw_transaction", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiverId", + "columnName": "receiver_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "request_id" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_state_type", + "unique": false, + "columnNames": [ + "state", + "type" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_state_type` ON `${TABLE_NAME}` (`state`, `type`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "inscription_collections", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`collection_hash` TEXT NOT NULL, `supply` TEXT NOT NULL, `unit` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `description` TEXT, `kernel_asset_id` TEXT, `treasury` TEXT, PRIMARY KEY(`collection_hash`))", + "fields": [ + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "supply", + "columnName": "supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unit", + "columnName": "unit", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconURL", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "treasury", + "columnName": "treasury", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "collection_hash" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "inscription_items", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`inscription_hash` TEXT NOT NULL, `collection_hash` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `content_type` TEXT NOT NULL, `content_url` TEXT NOT NULL, `occupied_by` TEXT, `occupied_at` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `owner` TEXT, `traits` TEXT, PRIMARY KEY(`inscription_hash`))", + "fields": [ + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "contentType", + "columnName": "content_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "contentURL", + "columnName": "content_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "occupiedBy", + "columnName": "occupied_by", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "occupiedAt", + "columnName": "occupied_at", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "owner", + "columnName": "owner", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "traits", + "columnName": "traits", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "inscription_hash" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "markets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `current_price` TEXT NOT NULL, `market_cap` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `total_volume` TEXT NOT NULL, `high_24h` TEXT NOT NULL, `low_24h` TEXT NOT NULL, `price_change_24h` TEXT NOT NULL, `price_change_percentage_1h` TEXT NOT NULL, `price_change_percentage_24h` TEXT NOT NULL, `price_change_percentage_7d` TEXT NOT NULL, `price_change_percentage_30d` TEXT NOT NULL, `market_cap_change_24h` TEXT NOT NULL, `market_cap_change_percentage_24h` TEXT NOT NULL, `circulating_supply` TEXT NOT NULL, `total_supply` TEXT NOT NULL, `max_supply` TEXT NOT NULL, `ath` TEXT NOT NULL, `ath_change_percentage` TEXT NOT NULL, `ath_date` TEXT NOT NULL, `atl` TEXT NOT NULL, `atl_change_percentage` TEXT NOT NULL, `atl_date` TEXT NOT NULL, `asset_ids` TEXT, `sparkline_in_7d` TEXT NOT NULL, `sparkline_in_24h` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "currentPrice", + "columnName": "current_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCap", + "columnName": "market_cap", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalVolume", + "columnName": "total_volume", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "high24h", + "columnName": "high_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "low24h", + "columnName": "low_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChange24h", + "columnName": "price_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage1H", + "columnName": "price_change_percentage_1h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage24H", + "columnName": "price_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage7D", + "columnName": "price_change_percentage_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage30D", + "columnName": "price_change_percentage_30d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChange24h", + "columnName": "market_cap_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChangePercentage24h", + "columnName": "market_cap_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circulatingSupply", + "columnName": "circulating_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalSupply", + "columnName": "total_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "maxSupply", + "columnName": "max_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ath", + "columnName": "ath", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athChangePercentage", + "columnName": "ath_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athDate", + "columnName": "ath_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atl", + "columnName": "atl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlChangePercentage", + "columnName": "atl_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlDate", + "columnName": "atl_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetIds", + "columnName": "asset_ids", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sparklineIn7d", + "columnName": "sparkline_in_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sparklineIn24h", + "columnName": "sparkline_in_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "history_prices", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `data` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`, `type`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id", + "type" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_coins", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_favored", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `is_favored` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "isFavored", + "columnName": "is_favored", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_alerts", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`alert_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `frequency` TEXT NOT NULL, `status` TEXT NOT NULL, `value` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`alert_id`))", + "fields": [ + { + "fieldPath": "alertId", + "columnName": "alert_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "frequency", + "columnName": "frequency", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "alert_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "market_cap_ranks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "swap_orders", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`order_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `pay_asset_id` TEXT NOT NULL, `receive_asset_id` TEXT NOT NULL, `pay_amount` TEXT NOT NULL, `receive_amount` TEXT NOT NULL, `pay_trace_id` TEXT NOT NULL, `receive_trace_id` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_type` TEXT NOT NULL, PRIMARY KEY(`order_id`))", + "fields": [ + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payAssetId", + "columnName": "pay_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiveAssetId", + "columnName": "receive_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payAmount", + "columnName": "pay_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiveAmount", + "columnName": "receive_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payTraceId", + "columnName": "pay_trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiveTraceId", + "columnName": "receive_trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderType", + "columnName": "order_type", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "order_id" + ] + }, + "indices": [ + { + "name": "index_swap_orders_state_created_at", + "unique": false, + "columnNames": [ + "state", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_swap_orders_state_created_at` ON `${TABLE_NAME}` (`state`, `created_at`)" + } + ], + "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, 'ea59ef6c056664f70f7cb67941e1c68d')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/66.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/66.json new file mode 100644 index 0000000000..f0532558a3 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/66.json @@ -0,0 +1,3418 @@ +{ + "formatVersion": 1, + "database": { + "version": 66, + "identityHash": "fc15117c1177a178e1cff3bde53c8aaa", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, `is_deactivated` INTEGER, `membership` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT" + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT" + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT" + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT" + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT" + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER" + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT" + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER" + }, + { + "fieldPath": "isDeactivated", + "columnName": "is_deactivated", + "affinity": "INTEGER" + }, + { + "fieldPath": "membership", + "columnName": "membership", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT" + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT" + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT" + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT" + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT" + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT" + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT" + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT" + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT" + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER" + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT" + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT" + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT" + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT" + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT" + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT" + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT" + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT" + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT" + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT" + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT" + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT" + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT" + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT" + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT" + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT" + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT" + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + } + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + } + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, `withdrawal_memo_possibility` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT" + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT" + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT" + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + } + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + } + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `hidden` INTEGER, `balance` TEXT, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER" + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT" + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_extra_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_extra_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT" + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT" + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT" + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT" + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT" + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT" + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER" + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT" + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT" + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + } + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + } + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + } + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT" + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + } + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT" + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + } + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT" + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT" + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT" + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + } + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT" + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + } + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + } + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [ + { + "name": "index_addresses_chain_id_updated_at", + "unique": false, + "columnNames": [ + "chain_id", + "updated_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_addresses_chain_id_updated_at` ON `${TABLE_NAME}` (`chain_id`, `updated_at`)" + } + ] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + } + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + } + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + } + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + } + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + } + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER" + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT" + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT" + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT" + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ] + }, + { + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + } + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + } + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT" + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT" + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + } + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT" + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB" + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT" + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT" + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT" + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT" + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT" + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT" + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + } + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + } + ] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + } + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + } + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + } + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `withdrawal_memo_possibility` TEXT NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + } + }, + { + "tableName": "outputs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`output_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `asset` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `amount` TEXT NOT NULL, `mask` TEXT NOT NULL, `keys` TEXT NOT NULL, `receivers` TEXT NOT NULL, `receivers_hash` TEXT NOT NULL, `receivers_threshold` INTEGER NOT NULL, `extra` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `signed_by` TEXT NOT NULL, `signed_at` TEXT NOT NULL, `spent_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`output_id`))", + "fields": [ + { + "fieldPath": "outputId", + "columnName": "output_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputIndex", + "columnName": "output_index", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "asset", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mask", + "columnName": "mask", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "keys", + "columnName": "keys", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversHash", + "columnName": "receivers_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversThreshold", + "columnName": "receivers_threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "extra", + "columnName": "extra", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedBy", + "columnName": "signed_by", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedAt", + "columnName": "signed_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "spentAt", + "columnName": "spent_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "output_id" + ] + }, + "indices": [ + { + "name": "index_outputs_asset_state_sequence", + "unique": false, + "columnNames": [ + "asset", + "state", + "sequence" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_asset_state_sequence` ON `${TABLE_NAME}` (`asset`, `state`, `sequence`)" + }, + { + "name": "index_outputs_transaction_hash_output_index", + "unique": true, + "columnNames": [ + "transaction_hash", + "output_index" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_outputs_transaction_hash_output_index` ON `${TABLE_NAME}` (`transaction_hash`, `output_index`)" + }, + { + "name": "index_outputs_inscription_hash", + "unique": false, + "columnNames": [ + "inscription_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_inscription_hash` ON `${TABLE_NAME}` (`inscription_hash`)" + } + ] + }, + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT NOT NULL, `dust` TEXT NOT NULL, `collection_hash` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + }, + { + "name": "index_tokens_collection_hash", + "unique": false, + "columnNames": [ + "collection_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_collection_hash` ON `${TABLE_NAME}` (`collection_hash`)" + } + ] + }, + { + "tableName": "deposit_entries", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`entry_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `members` TEXT NOT NULL, `tag` TEXT, `signature` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `is_primary` INTEGER NOT NULL, PRIMARY KEY(`entry_id`))", + "fields": [ + { + "fieldPath": "entryId", + "columnName": "entry_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "members", + "columnName": "members", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "signature", + "columnName": "signature", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isPrimary", + "columnName": "is_primary", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "entry_id" + ] + } + }, + { + "tableName": "safe_snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `user_id` TEXT NOT NULL, `opponent_id` TEXT NOT NULL, `memo` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `created_at` TEXT NOT NULL, `trace_id` TEXT, `confirmations` INTEGER, `opening_balance` TEXT, `closing_balance` TEXT, `deposit` TEXT, `withdrawal` TEXT, `inscription_hash` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT" + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER" + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT" + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT" + }, + { + "fieldPath": "deposit", + "columnName": "deposit", + "affinity": "TEXT" + }, + { + "fieldPath": "withdrawal", + "columnName": "withdrawal", + "affinity": "TEXT" + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [ + { + "name": "index_safe_snapshots_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_safe_snapshots_created_at` ON `${TABLE_NAME}` (`created_at`)" + }, + { + "name": "index_safe_snapshots_type_asset_id", + "unique": false, + "columnNames": [ + "type", + "asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_safe_snapshots_type_asset_id` ON `${TABLE_NAME}` (`type`, `asset_id`)" + } + ] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`request_id` TEXT NOT NULL, `raw_transaction` TEXT NOT NULL, `receiver_id` TEXT NOT NULL, `type` INTEGER NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`request_id`))", + "fields": [ + { + "fieldPath": "requestId", + "columnName": "request_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "rawTransaction", + "columnName": "raw_transaction", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiverId", + "columnName": "receiver_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "request_id" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_state_type", + "unique": false, + "columnNames": [ + "state", + "type" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_state_type` ON `${TABLE_NAME}` (`state`, `type`)" + } + ] + }, + { + "tableName": "inscription_collections", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`collection_hash` TEXT NOT NULL, `supply` TEXT NOT NULL, `unit` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `description` TEXT, `kernel_asset_id` TEXT, `treasury` TEXT, PRIMARY KEY(`collection_hash`))", + "fields": [ + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "supply", + "columnName": "supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unit", + "columnName": "unit", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconURL", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT" + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT" + }, + { + "fieldPath": "treasury", + "columnName": "treasury", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "collection_hash" + ] + } + }, + { + "tableName": "inscription_items", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`inscription_hash` TEXT NOT NULL, `collection_hash` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `content_type` TEXT NOT NULL, `content_url` TEXT NOT NULL, `occupied_by` TEXT, `occupied_at` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `owner` TEXT, `traits` TEXT, PRIMARY KEY(`inscription_hash`))", + "fields": [ + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "contentType", + "columnName": "content_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "contentURL", + "columnName": "content_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "occupiedBy", + "columnName": "occupied_by", + "affinity": "TEXT" + }, + { + "fieldPath": "occupiedAt", + "columnName": "occupied_at", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "owner", + "columnName": "owner", + "affinity": "TEXT" + }, + { + "fieldPath": "traits", + "columnName": "traits", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "inscription_hash" + ] + } + }, + { + "tableName": "markets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `current_price` TEXT NOT NULL, `market_cap` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `total_volume` TEXT NOT NULL, `high_24h` TEXT NOT NULL, `low_24h` TEXT NOT NULL, `price_change_24h` TEXT NOT NULL, `price_change_percentage_1h` TEXT NOT NULL, `price_change_percentage_24h` TEXT NOT NULL, `price_change_percentage_7d` TEXT NOT NULL, `price_change_percentage_30d` TEXT NOT NULL, `market_cap_change_24h` TEXT NOT NULL, `market_cap_change_percentage_24h` TEXT NOT NULL, `circulating_supply` TEXT NOT NULL, `total_supply` TEXT NOT NULL, `max_supply` TEXT NOT NULL, `ath` TEXT NOT NULL, `ath_change_percentage` TEXT NOT NULL, `ath_date` TEXT NOT NULL, `atl` TEXT NOT NULL, `atl_change_percentage` TEXT NOT NULL, `atl_date` TEXT NOT NULL, `asset_ids` TEXT, `sparkline_in_7d` TEXT NOT NULL, `sparkline_in_24h` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "currentPrice", + "columnName": "current_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCap", + "columnName": "market_cap", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalVolume", + "columnName": "total_volume", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "high24h", + "columnName": "high_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "low24h", + "columnName": "low_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChange24h", + "columnName": "price_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage1H", + "columnName": "price_change_percentage_1h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage24H", + "columnName": "price_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage7D", + "columnName": "price_change_percentage_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage30D", + "columnName": "price_change_percentage_30d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChange24h", + "columnName": "market_cap_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChangePercentage24h", + "columnName": "market_cap_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circulatingSupply", + "columnName": "circulating_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalSupply", + "columnName": "total_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "maxSupply", + "columnName": "max_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ath", + "columnName": "ath", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athChangePercentage", + "columnName": "ath_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athDate", + "columnName": "ath_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atl", + "columnName": "atl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlChangePercentage", + "columnName": "atl_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlDate", + "columnName": "atl_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetIds", + "columnName": "asset_ids", + "affinity": "TEXT" + }, + { + "fieldPath": "sparklineIn7d", + "columnName": "sparkline_in_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sparklineIn24h", + "columnName": "sparkline_in_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + } + }, + { + "tableName": "history_prices", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `data` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`, `type`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id", + "type" + ] + } + }, + { + "tableName": "market_coins", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + } + }, + { + "tableName": "market_favored", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `is_favored` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "isFavored", + "columnName": "is_favored", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + } + }, + { + "tableName": "market_alerts", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`alert_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `frequency` TEXT NOT NULL, `status` TEXT NOT NULL, `value` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`alert_id`))", + "fields": [ + { + "fieldPath": "alertId", + "columnName": "alert_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "frequency", + "columnName": "frequency", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "alert_id" + ] + } + }, + { + "tableName": "market_cap_ranks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + } + }, + { + "tableName": "swap_orders", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`order_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `pay_asset_id` TEXT NOT NULL, `receive_asset_id` TEXT NOT NULL, `pay_amount` TEXT NOT NULL, `receive_amount` TEXT NOT NULL, `pay_trace_id` TEXT NOT NULL, `receive_trace_id` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_type` TEXT NOT NULL, PRIMARY KEY(`order_id`))", + "fields": [ + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payAssetId", + "columnName": "pay_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiveAssetId", + "columnName": "receive_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payAmount", + "columnName": "pay_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiveAmount", + "columnName": "receive_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payTraceId", + "columnName": "pay_trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiveTraceId", + "columnName": "receive_trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderType", + "columnName": "order_type", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "order_id" + ] + }, + "indices": [ + { + "name": "index_swap_orders_state_created_at", + "unique": false, + "columnNames": [ + "state", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_swap_orders_state_created_at` ON `${TABLE_NAME}` (`state`, `created_at`)" + } + ] + }, + { + "tableName": "membership_orders", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`order_id` TEXT NOT NULL, `category` TEXT NOT NULL, `amount` TEXT NOT NULL, `amount_actual` TEXT NOT NULL, `amount_original` TEXT NOT NULL, `after` TEXT NOT NULL, `before` TEXT NOT NULL, `created_at` TEXT NOT NULL, `fiat_order` TEXT, `stars` INTEGER NOT NULL, `payment_url` TEXT, `status` TEXT NOT NULL, PRIMARY KEY(`order_id`))", + "fields": [ + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amountActual", + "columnName": "amount_actual", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amountOriginal", + "columnName": "amount_original", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "after", + "columnName": "after", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "before", + "columnName": "before", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fiatOrder", + "columnName": "fiat_order", + "affinity": "TEXT" + }, + { + "fieldPath": "stars", + "columnName": "stars", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "paymentUrl", + "columnName": "payment_url", + "affinity": "TEXT" + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "order_id" + ] + }, + "indices": [ + { + "name": "index_membership_orders_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_membership_orders_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ] + } + ], + "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, 'fc15117c1177a178e1cff3bde53c8aaa')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/67.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/67.json new file mode 100644 index 0000000000..46e33e7b87 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/67.json @@ -0,0 +1,3424 @@ +{ + "formatVersion": 1, + "database": { + "version": 67, + "identityHash": "efcaacf22d0ea3345bbba09642e7f210", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, `is_deactivated` INTEGER, `membership` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT" + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT" + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT" + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT" + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT" + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER" + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT" + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER" + }, + { + "fieldPath": "isDeactivated", + "columnName": "is_deactivated", + "affinity": "INTEGER" + }, + { + "fieldPath": "membership", + "columnName": "membership", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT" + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT" + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT" + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT" + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT" + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT" + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT" + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT" + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT" + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER" + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT" + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT" + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT" + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT" + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT" + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT" + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT" + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT" + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT" + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT" + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT" + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT" + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT" + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT" + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT" + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT" + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT" + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + } + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + } + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, `withdrawal_memo_possibility` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT" + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT" + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT" + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + } + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + } + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `hidden` INTEGER, `balance` TEXT, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER" + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT" + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_extra_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_extra_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT" + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT" + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT" + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT" + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT" + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT" + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER" + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT" + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT" + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + } + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + } + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + } + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT" + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + } + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT" + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + } + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT" + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT" + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT" + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + } + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT" + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + } + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + } + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [ + { + "name": "index_addresses_chain_id_updated_at", + "unique": false, + "columnNames": [ + "chain_id", + "updated_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_addresses_chain_id_updated_at` ON `${TABLE_NAME}` (`chain_id`, `updated_at`)" + } + ] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + } + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + } + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + } + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + } + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + } + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER" + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT" + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT" + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT" + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ] + }, + { + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + } + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + } + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT" + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT" + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + } + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT" + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB" + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT" + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT" + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT" + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT" + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT" + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT" + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + } + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + } + ] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + } + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + } + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + } + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `withdrawal_memo_possibility` TEXT NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + } + }, + { + "tableName": "outputs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`output_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `asset` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `amount` TEXT NOT NULL, `mask` TEXT NOT NULL, `keys` TEXT NOT NULL, `receivers` TEXT NOT NULL, `receivers_hash` TEXT NOT NULL, `receivers_threshold` INTEGER NOT NULL, `extra` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `signed_by` TEXT NOT NULL, `signed_at` TEXT NOT NULL, `spent_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`output_id`))", + "fields": [ + { + "fieldPath": "outputId", + "columnName": "output_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputIndex", + "columnName": "output_index", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "asset", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mask", + "columnName": "mask", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "keys", + "columnName": "keys", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversHash", + "columnName": "receivers_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversThreshold", + "columnName": "receivers_threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "extra", + "columnName": "extra", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedBy", + "columnName": "signed_by", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedAt", + "columnName": "signed_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "spentAt", + "columnName": "spent_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "output_id" + ] + }, + "indices": [ + { + "name": "index_outputs_asset_state_sequence", + "unique": false, + "columnNames": [ + "asset", + "state", + "sequence" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_asset_state_sequence` ON `${TABLE_NAME}` (`asset`, `state`, `sequence`)" + }, + { + "name": "index_outputs_transaction_hash_output_index", + "unique": true, + "columnNames": [ + "transaction_hash", + "output_index" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_outputs_transaction_hash_output_index` ON `${TABLE_NAME}` (`transaction_hash`, `output_index`)" + }, + { + "name": "index_outputs_inscription_hash", + "unique": false, + "columnNames": [ + "inscription_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_inscription_hash` ON `${TABLE_NAME}` (`inscription_hash`)" + } + ] + }, + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT NOT NULL, `dust` TEXT NOT NULL, `collection_hash` TEXT, `precision` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT" + }, + { + "fieldPath": "precision", + "columnName": "precision", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + }, + { + "name": "index_tokens_collection_hash", + "unique": false, + "columnNames": [ + "collection_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_collection_hash` ON `${TABLE_NAME}` (`collection_hash`)" + } + ] + }, + { + "tableName": "deposit_entries", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`entry_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `members` TEXT NOT NULL, `tag` TEXT, `signature` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `is_primary` INTEGER NOT NULL, PRIMARY KEY(`entry_id`))", + "fields": [ + { + "fieldPath": "entryId", + "columnName": "entry_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "members", + "columnName": "members", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "signature", + "columnName": "signature", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isPrimary", + "columnName": "is_primary", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "entry_id" + ] + } + }, + { + "tableName": "safe_snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `user_id` TEXT NOT NULL, `opponent_id` TEXT NOT NULL, `memo` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `created_at` TEXT NOT NULL, `trace_id` TEXT, `confirmations` INTEGER, `opening_balance` TEXT, `closing_balance` TEXT, `deposit` TEXT, `withdrawal` TEXT, `inscription_hash` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT" + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER" + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT" + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT" + }, + { + "fieldPath": "deposit", + "columnName": "deposit", + "affinity": "TEXT" + }, + { + "fieldPath": "withdrawal", + "columnName": "withdrawal", + "affinity": "TEXT" + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [ + { + "name": "index_safe_snapshots_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_safe_snapshots_created_at` ON `${TABLE_NAME}` (`created_at`)" + }, + { + "name": "index_safe_snapshots_type_asset_id", + "unique": false, + "columnNames": [ + "type", + "asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_safe_snapshots_type_asset_id` ON `${TABLE_NAME}` (`type`, `asset_id`)" + } + ] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`request_id` TEXT NOT NULL, `raw_transaction` TEXT NOT NULL, `receiver_id` TEXT NOT NULL, `type` INTEGER NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`request_id`))", + "fields": [ + { + "fieldPath": "requestId", + "columnName": "request_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "rawTransaction", + "columnName": "raw_transaction", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiverId", + "columnName": "receiver_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "request_id" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_state_type", + "unique": false, + "columnNames": [ + "state", + "type" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_state_type` ON `${TABLE_NAME}` (`state`, `type`)" + } + ] + }, + { + "tableName": "inscription_collections", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`collection_hash` TEXT NOT NULL, `supply` TEXT NOT NULL, `unit` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `description` TEXT, `kernel_asset_id` TEXT, `treasury` TEXT, PRIMARY KEY(`collection_hash`))", + "fields": [ + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "supply", + "columnName": "supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unit", + "columnName": "unit", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconURL", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT" + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT" + }, + { + "fieldPath": "treasury", + "columnName": "treasury", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "collection_hash" + ] + } + }, + { + "tableName": "inscription_items", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`inscription_hash` TEXT NOT NULL, `collection_hash` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `content_type` TEXT NOT NULL, `content_url` TEXT NOT NULL, `occupied_by` TEXT, `occupied_at` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `owner` TEXT, `traits` TEXT, PRIMARY KEY(`inscription_hash`))", + "fields": [ + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "contentType", + "columnName": "content_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "contentURL", + "columnName": "content_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "occupiedBy", + "columnName": "occupied_by", + "affinity": "TEXT" + }, + { + "fieldPath": "occupiedAt", + "columnName": "occupied_at", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "owner", + "columnName": "owner", + "affinity": "TEXT" + }, + { + "fieldPath": "traits", + "columnName": "traits", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "inscription_hash" + ] + } + }, + { + "tableName": "markets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `current_price` TEXT NOT NULL, `market_cap` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `total_volume` TEXT NOT NULL, `high_24h` TEXT NOT NULL, `low_24h` TEXT NOT NULL, `price_change_24h` TEXT NOT NULL, `price_change_percentage_1h` TEXT NOT NULL, `price_change_percentage_24h` TEXT NOT NULL, `price_change_percentage_7d` TEXT NOT NULL, `price_change_percentage_30d` TEXT NOT NULL, `market_cap_change_24h` TEXT NOT NULL, `market_cap_change_percentage_24h` TEXT NOT NULL, `circulating_supply` TEXT NOT NULL, `total_supply` TEXT NOT NULL, `max_supply` TEXT NOT NULL, `ath` TEXT NOT NULL, `ath_change_percentage` TEXT NOT NULL, `ath_date` TEXT NOT NULL, `atl` TEXT NOT NULL, `atl_change_percentage` TEXT NOT NULL, `atl_date` TEXT NOT NULL, `asset_ids` TEXT, `sparkline_in_7d` TEXT NOT NULL, `sparkline_in_24h` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "currentPrice", + "columnName": "current_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCap", + "columnName": "market_cap", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalVolume", + "columnName": "total_volume", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "high24h", + "columnName": "high_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "low24h", + "columnName": "low_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChange24h", + "columnName": "price_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage1H", + "columnName": "price_change_percentage_1h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage24H", + "columnName": "price_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage7D", + "columnName": "price_change_percentage_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage30D", + "columnName": "price_change_percentage_30d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChange24h", + "columnName": "market_cap_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChangePercentage24h", + "columnName": "market_cap_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circulatingSupply", + "columnName": "circulating_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalSupply", + "columnName": "total_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "maxSupply", + "columnName": "max_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ath", + "columnName": "ath", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athChangePercentage", + "columnName": "ath_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athDate", + "columnName": "ath_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atl", + "columnName": "atl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlChangePercentage", + "columnName": "atl_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlDate", + "columnName": "atl_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetIds", + "columnName": "asset_ids", + "affinity": "TEXT" + }, + { + "fieldPath": "sparklineIn7d", + "columnName": "sparkline_in_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sparklineIn24h", + "columnName": "sparkline_in_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + } + }, + { + "tableName": "history_prices", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `data` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`, `type`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id", + "type" + ] + } + }, + { + "tableName": "market_coins", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + } + }, + { + "tableName": "market_favored", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `is_favored` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "isFavored", + "columnName": "is_favored", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + } + }, + { + "tableName": "market_alerts", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`alert_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `frequency` TEXT NOT NULL, `status` TEXT NOT NULL, `value` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`alert_id`))", + "fields": [ + { + "fieldPath": "alertId", + "columnName": "alert_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "frequency", + "columnName": "frequency", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "alert_id" + ] + } + }, + { + "tableName": "market_cap_ranks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + } + }, + { + "tableName": "swap_orders", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`order_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `pay_asset_id` TEXT NOT NULL, `receive_asset_id` TEXT NOT NULL, `pay_amount` TEXT NOT NULL, `receive_amount` TEXT NOT NULL, `pay_trace_id` TEXT NOT NULL, `receive_trace_id` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_type` TEXT NOT NULL, PRIMARY KEY(`order_id`))", + "fields": [ + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payAssetId", + "columnName": "pay_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiveAssetId", + "columnName": "receive_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payAmount", + "columnName": "pay_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiveAmount", + "columnName": "receive_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payTraceId", + "columnName": "pay_trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiveTraceId", + "columnName": "receive_trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderType", + "columnName": "order_type", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "order_id" + ] + }, + "indices": [ + { + "name": "index_swap_orders_state_created_at", + "unique": false, + "columnNames": [ + "state", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_swap_orders_state_created_at` ON `${TABLE_NAME}` (`state`, `created_at`)" + } + ] + }, + { + "tableName": "membership_orders", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`order_id` TEXT NOT NULL, `category` TEXT NOT NULL, `amount` TEXT NOT NULL, `amount_actual` TEXT NOT NULL, `amount_original` TEXT NOT NULL, `after` TEXT NOT NULL, `before` TEXT NOT NULL, `created_at` TEXT NOT NULL, `fiat_order` TEXT, `stars` INTEGER NOT NULL, `payment_url` TEXT, `status` TEXT NOT NULL, PRIMARY KEY(`order_id`))", + "fields": [ + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amountActual", + "columnName": "amount_actual", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amountOriginal", + "columnName": "amount_original", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "after", + "columnName": "after", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "before", + "columnName": "before", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fiatOrder", + "columnName": "fiat_order", + "affinity": "TEXT" + }, + { + "fieldPath": "stars", + "columnName": "stars", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "paymentUrl", + "columnName": "payment_url", + "affinity": "TEXT" + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "order_id" + ] + }, + "indices": [ + { + "name": "index_membership_orders_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_membership_orders_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ] + } + ], + "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, 'efcaacf22d0ea3345bbba09642e7f210')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/68.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/68.json new file mode 100644 index 0000000000..504cf95063 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/68.json @@ -0,0 +1,3436 @@ +{ + "formatVersion": 1, + "database": { + "version": 68, + "identityHash": "d41443d604d8252b00187e1aaf6d2653", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, `is_deactivated` INTEGER, `membership` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT" + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT" + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT" + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT" + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT" + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER" + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT" + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER" + }, + { + "fieldPath": "isDeactivated", + "columnName": "is_deactivated", + "affinity": "INTEGER" + }, + { + "fieldPath": "membership", + "columnName": "membership", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT" + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT" + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT" + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT" + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT" + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT" + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT" + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT" + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT" + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER" + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT" + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT" + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT" + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT" + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT" + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT" + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT" + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT" + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT" + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT" + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT" + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT" + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT" + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT" + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT" + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT" + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT" + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + } + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + } + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, `withdrawal_memo_possibility` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT" + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT" + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT" + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + } + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + } + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `hidden` INTEGER, `balance` TEXT, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER" + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT" + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_extra_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_extra_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT" + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT" + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT" + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT" + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT" + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT" + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER" + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT" + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT" + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + } + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + } + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + } + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT" + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + } + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT" + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + } + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT" + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT" + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT" + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + } + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT" + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + } + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + } + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [ + { + "name": "index_addresses_chain_id_updated_at", + "unique": false, + "columnNames": [ + "chain_id", + "updated_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_addresses_chain_id_updated_at` ON `${TABLE_NAME}` (`chain_id`, `updated_at`)" + } + ] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + } + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + } + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + } + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + } + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + } + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER" + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT" + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT" + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT" + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ] + }, + { + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + } + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + } + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT" + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT" + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + } + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT" + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB" + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT" + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT" + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT" + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT" + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT" + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT" + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + } + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + } + ] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + } + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + } + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + } + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `withdrawal_memo_possibility` TEXT NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + } + }, + { + "tableName": "outputs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`output_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `asset` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `amount` TEXT NOT NULL, `mask` TEXT NOT NULL, `keys` TEXT NOT NULL, `receivers` TEXT NOT NULL, `receivers_hash` TEXT NOT NULL, `receivers_threshold` INTEGER NOT NULL, `extra` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `signed_by` TEXT NOT NULL, `signed_at` TEXT NOT NULL, `spent_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`output_id`))", + "fields": [ + { + "fieldPath": "outputId", + "columnName": "output_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputIndex", + "columnName": "output_index", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "asset", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mask", + "columnName": "mask", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "keys", + "columnName": "keys", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversHash", + "columnName": "receivers_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversThreshold", + "columnName": "receivers_threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "extra", + "columnName": "extra", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedBy", + "columnName": "signed_by", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedAt", + "columnName": "signed_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "spentAt", + "columnName": "spent_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "output_id" + ] + }, + "indices": [ + { + "name": "index_outputs_asset_state_sequence", + "unique": false, + "columnNames": [ + "asset", + "state", + "sequence" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_asset_state_sequence` ON `${TABLE_NAME}` (`asset`, `state`, `sequence`)" + }, + { + "name": "index_outputs_transaction_hash_output_index", + "unique": true, + "columnNames": [ + "transaction_hash", + "output_index" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_outputs_transaction_hash_output_index` ON `${TABLE_NAME}` (`transaction_hash`, `output_index`)" + }, + { + "name": "index_outputs_inscription_hash", + "unique": false, + "columnNames": [ + "inscription_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_inscription_hash` ON `${TABLE_NAME}` (`inscription_hash`)" + } + ] + }, + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT NOT NULL, `dust` TEXT NOT NULL, `collection_hash` TEXT, `precision` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT" + }, + { + "fieldPath": "precision", + "columnName": "precision", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + }, + { + "name": "index_tokens_collection_hash", + "unique": false, + "columnNames": [ + "collection_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_collection_hash` ON `${TABLE_NAME}` (`collection_hash`)" + } + ] + }, + { + "tableName": "deposit_entries", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`entry_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `members` TEXT NOT NULL, `tag` TEXT, `signature` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `is_primary` INTEGER NOT NULL, `minimum` TEXT NOT NULL, `maximum` TEXT NOT NULL, PRIMARY KEY(`entry_id`))", + "fields": [ + { + "fieldPath": "entryId", + "columnName": "entry_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "members", + "columnName": "members", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "signature", + "columnName": "signature", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isPrimary", + "columnName": "is_primary", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "minimum", + "columnName": "minimum", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "maximum", + "columnName": "maximum", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "entry_id" + ] + } + }, + { + "tableName": "safe_snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `user_id` TEXT NOT NULL, `opponent_id` TEXT NOT NULL, `memo` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `created_at` TEXT NOT NULL, `trace_id` TEXT, `confirmations` INTEGER, `opening_balance` TEXT, `closing_balance` TEXT, `deposit` TEXT, `withdrawal` TEXT, `inscription_hash` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT" + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER" + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT" + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT" + }, + { + "fieldPath": "deposit", + "columnName": "deposit", + "affinity": "TEXT" + }, + { + "fieldPath": "withdrawal", + "columnName": "withdrawal", + "affinity": "TEXT" + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [ + { + "name": "index_safe_snapshots_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_safe_snapshots_created_at` ON `${TABLE_NAME}` (`created_at`)" + }, + { + "name": "index_safe_snapshots_type_asset_id", + "unique": false, + "columnNames": [ + "type", + "asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_safe_snapshots_type_asset_id` ON `${TABLE_NAME}` (`type`, `asset_id`)" + } + ] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`request_id` TEXT NOT NULL, `raw_transaction` TEXT NOT NULL, `receiver_id` TEXT NOT NULL, `type` INTEGER NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`request_id`))", + "fields": [ + { + "fieldPath": "requestId", + "columnName": "request_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "rawTransaction", + "columnName": "raw_transaction", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiverId", + "columnName": "receiver_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "request_id" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_state_type", + "unique": false, + "columnNames": [ + "state", + "type" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_state_type` ON `${TABLE_NAME}` (`state`, `type`)" + } + ] + }, + { + "tableName": "inscription_collections", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`collection_hash` TEXT NOT NULL, `supply` TEXT NOT NULL, `unit` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `description` TEXT, `kernel_asset_id` TEXT, `treasury` TEXT, PRIMARY KEY(`collection_hash`))", + "fields": [ + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "supply", + "columnName": "supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unit", + "columnName": "unit", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconURL", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT" + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT" + }, + { + "fieldPath": "treasury", + "columnName": "treasury", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "collection_hash" + ] + } + }, + { + "tableName": "inscription_items", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`inscription_hash` TEXT NOT NULL, `collection_hash` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `content_type` TEXT NOT NULL, `content_url` TEXT NOT NULL, `occupied_by` TEXT, `occupied_at` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `owner` TEXT, `traits` TEXT, PRIMARY KEY(`inscription_hash`))", + "fields": [ + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "contentType", + "columnName": "content_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "contentURL", + "columnName": "content_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "occupiedBy", + "columnName": "occupied_by", + "affinity": "TEXT" + }, + { + "fieldPath": "occupiedAt", + "columnName": "occupied_at", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "owner", + "columnName": "owner", + "affinity": "TEXT" + }, + { + "fieldPath": "traits", + "columnName": "traits", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "inscription_hash" + ] + } + }, + { + "tableName": "markets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `current_price` TEXT NOT NULL, `market_cap` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `total_volume` TEXT NOT NULL, `high_24h` TEXT NOT NULL, `low_24h` TEXT NOT NULL, `price_change_24h` TEXT NOT NULL, `price_change_percentage_1h` TEXT NOT NULL, `price_change_percentage_24h` TEXT NOT NULL, `price_change_percentage_7d` TEXT NOT NULL, `price_change_percentage_30d` TEXT NOT NULL, `market_cap_change_24h` TEXT NOT NULL, `market_cap_change_percentage_24h` TEXT NOT NULL, `circulating_supply` TEXT NOT NULL, `total_supply` TEXT NOT NULL, `max_supply` TEXT NOT NULL, `ath` TEXT NOT NULL, `ath_change_percentage` TEXT NOT NULL, `ath_date` TEXT NOT NULL, `atl` TEXT NOT NULL, `atl_change_percentage` TEXT NOT NULL, `atl_date` TEXT NOT NULL, `asset_ids` TEXT, `sparkline_in_7d` TEXT NOT NULL, `sparkline_in_24h` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "currentPrice", + "columnName": "current_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCap", + "columnName": "market_cap", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalVolume", + "columnName": "total_volume", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "high24h", + "columnName": "high_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "low24h", + "columnName": "low_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChange24h", + "columnName": "price_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage1H", + "columnName": "price_change_percentage_1h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage24H", + "columnName": "price_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage7D", + "columnName": "price_change_percentage_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage30D", + "columnName": "price_change_percentage_30d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChange24h", + "columnName": "market_cap_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChangePercentage24h", + "columnName": "market_cap_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circulatingSupply", + "columnName": "circulating_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalSupply", + "columnName": "total_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "maxSupply", + "columnName": "max_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ath", + "columnName": "ath", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athChangePercentage", + "columnName": "ath_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athDate", + "columnName": "ath_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atl", + "columnName": "atl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlChangePercentage", + "columnName": "atl_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlDate", + "columnName": "atl_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetIds", + "columnName": "asset_ids", + "affinity": "TEXT" + }, + { + "fieldPath": "sparklineIn7d", + "columnName": "sparkline_in_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sparklineIn24h", + "columnName": "sparkline_in_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + } + }, + { + "tableName": "history_prices", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `data` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`, `type`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id", + "type" + ] + } + }, + { + "tableName": "market_coins", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + } + }, + { + "tableName": "market_favored", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `is_favored` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "isFavored", + "columnName": "is_favored", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + } + }, + { + "tableName": "market_alerts", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`alert_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `frequency` TEXT NOT NULL, `status` TEXT NOT NULL, `value` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`alert_id`))", + "fields": [ + { + "fieldPath": "alertId", + "columnName": "alert_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "frequency", + "columnName": "frequency", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "alert_id" + ] + } + }, + { + "tableName": "market_cap_ranks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + } + }, + { + "tableName": "swap_orders", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`order_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `pay_asset_id` TEXT NOT NULL, `receive_asset_id` TEXT NOT NULL, `pay_amount` TEXT NOT NULL, `receive_amount` TEXT NOT NULL, `pay_trace_id` TEXT NOT NULL, `receive_trace_id` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_type` TEXT NOT NULL, PRIMARY KEY(`order_id`))", + "fields": [ + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payAssetId", + "columnName": "pay_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiveAssetId", + "columnName": "receive_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payAmount", + "columnName": "pay_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiveAmount", + "columnName": "receive_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payTraceId", + "columnName": "pay_trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiveTraceId", + "columnName": "receive_trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderType", + "columnName": "order_type", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "order_id" + ] + }, + "indices": [ + { + "name": "index_swap_orders_state_created_at", + "unique": false, + "columnNames": [ + "state", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_swap_orders_state_created_at` ON `${TABLE_NAME}` (`state`, `created_at`)" + } + ] + }, + { + "tableName": "membership_orders", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`order_id` TEXT NOT NULL, `category` TEXT NOT NULL, `amount` TEXT NOT NULL, `amount_actual` TEXT NOT NULL, `amount_original` TEXT NOT NULL, `after` TEXT NOT NULL, `before` TEXT NOT NULL, `created_at` TEXT NOT NULL, `fiat_order` TEXT, `stars` INTEGER NOT NULL, `payment_url` TEXT, `status` TEXT NOT NULL, PRIMARY KEY(`order_id`))", + "fields": [ + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amountActual", + "columnName": "amount_actual", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amountOriginal", + "columnName": "amount_original", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "after", + "columnName": "after", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "before", + "columnName": "before", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fiatOrder", + "columnName": "fiat_order", + "affinity": "TEXT" + }, + { + "fieldPath": "stars", + "columnName": "stars", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "paymentUrl", + "columnName": "payment_url", + "affinity": "TEXT" + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "order_id" + ] + }, + "indices": [ + { + "name": "index_membership_orders_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_membership_orders_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ] + } + ], + "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, 'd41443d604d8252b00187e1aaf6d2653')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/69.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/69.json new file mode 100644 index 0000000000..0ffb359a5e --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/69.json @@ -0,0 +1,3346 @@ +{ + "formatVersion": 1, + "database": { + "version": 69, + "identityHash": "a49373f3e5e79b69c09e11d526d973d6", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, `is_deactivated` INTEGER, `membership` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT" + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT" + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT" + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT" + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT" + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER" + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT" + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER" + }, + { + "fieldPath": "isDeactivated", + "columnName": "is_deactivated", + "affinity": "INTEGER" + }, + { + "fieldPath": "membership", + "columnName": "membership", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT" + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT" + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT" + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT" + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT" + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT" + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT" + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT" + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT" + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER" + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT" + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT" + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT" + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT" + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT" + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT" + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT" + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT" + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT" + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT" + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT" + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT" + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT" + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT" + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT" + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT" + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT" + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + } + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + } + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, `withdrawal_memo_possibility` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT" + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT" + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT" + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + } + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + } + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `hidden` INTEGER, `balance` TEXT, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER" + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT" + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_extra_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_extra_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT" + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT" + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT" + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT" + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT" + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT" + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER" + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT" + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT" + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + } + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + } + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + } + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT" + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + } + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT" + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + } + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT" + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT" + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT" + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + } + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT" + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + } + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + } + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [ + { + "name": "index_addresses_chain_id_updated_at", + "unique": false, + "columnNames": [ + "chain_id", + "updated_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_addresses_chain_id_updated_at` ON `${TABLE_NAME}` (`chain_id`, `updated_at`)" + } + ] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + } + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + } + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + } + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + } + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + } + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER" + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT" + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT" + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT" + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ] + }, + { + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + } + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + } + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT" + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT" + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + } + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT" + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB" + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT" + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT" + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT" + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT" + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT" + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT" + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + } + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + } + ] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + } + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + } + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + } + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `withdrawal_memo_possibility` TEXT NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + } + }, + { + "tableName": "outputs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`output_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `asset` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `amount` TEXT NOT NULL, `mask` TEXT NOT NULL, `keys` TEXT NOT NULL, `receivers` TEXT NOT NULL, `receivers_hash` TEXT NOT NULL, `receivers_threshold` INTEGER NOT NULL, `extra` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `signed_by` TEXT NOT NULL, `signed_at` TEXT NOT NULL, `spent_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`output_id`))", + "fields": [ + { + "fieldPath": "outputId", + "columnName": "output_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputIndex", + "columnName": "output_index", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "asset", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mask", + "columnName": "mask", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "keys", + "columnName": "keys", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversHash", + "columnName": "receivers_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversThreshold", + "columnName": "receivers_threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "extra", + "columnName": "extra", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedBy", + "columnName": "signed_by", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedAt", + "columnName": "signed_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "spentAt", + "columnName": "spent_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "output_id" + ] + }, + "indices": [ + { + "name": "index_outputs_asset_state_sequence", + "unique": false, + "columnNames": [ + "asset", + "state", + "sequence" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_asset_state_sequence` ON `${TABLE_NAME}` (`asset`, `state`, `sequence`)" + }, + { + "name": "index_outputs_transaction_hash_output_index", + "unique": true, + "columnNames": [ + "transaction_hash", + "output_index" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_outputs_transaction_hash_output_index` ON `${TABLE_NAME}` (`transaction_hash`, `output_index`)" + }, + { + "name": "index_outputs_inscription_hash", + "unique": false, + "columnNames": [ + "inscription_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_inscription_hash` ON `${TABLE_NAME}` (`inscription_hash`)" + } + ] + }, + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT NOT NULL, `dust` TEXT NOT NULL, `collection_hash` TEXT, `precision` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT" + }, + { + "fieldPath": "precision", + "columnName": "precision", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + }, + { + "name": "index_tokens_collection_hash", + "unique": false, + "columnNames": [ + "collection_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_collection_hash` ON `${TABLE_NAME}` (`collection_hash`)" + } + ] + }, + { + "tableName": "deposit_entries", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`entry_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `members` TEXT NOT NULL, `tag` TEXT, `signature` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `is_primary` INTEGER NOT NULL, `minimum` TEXT NOT NULL, `maximum` TEXT NOT NULL, PRIMARY KEY(`entry_id`))", + "fields": [ + { + "fieldPath": "entryId", + "columnName": "entry_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "members", + "columnName": "members", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "signature", + "columnName": "signature", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isPrimary", + "columnName": "is_primary", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "minimum", + "columnName": "minimum", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "maximum", + "columnName": "maximum", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "entry_id" + ] + } + }, + { + "tableName": "safe_snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `user_id` TEXT NOT NULL, `opponent_id` TEXT NOT NULL, `memo` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `created_at` TEXT NOT NULL, `trace_id` TEXT, `confirmations` INTEGER, `opening_balance` TEXT, `closing_balance` TEXT, `deposit` TEXT, `withdrawal` TEXT, `inscription_hash` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT" + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER" + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT" + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT" + }, + { + "fieldPath": "deposit", + "columnName": "deposit", + "affinity": "TEXT" + }, + { + "fieldPath": "withdrawal", + "columnName": "withdrawal", + "affinity": "TEXT" + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [ + { + "name": "index_safe_snapshots_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_safe_snapshots_created_at` ON `${TABLE_NAME}` (`created_at`)" + }, + { + "name": "index_safe_snapshots_type_asset_id", + "unique": false, + "columnNames": [ + "type", + "asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_safe_snapshots_type_asset_id` ON `${TABLE_NAME}` (`type`, `asset_id`)" + } + ] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`request_id` TEXT NOT NULL, `raw_transaction` TEXT NOT NULL, `receiver_id` TEXT NOT NULL, `type` INTEGER NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`request_id`))", + "fields": [ + { + "fieldPath": "requestId", + "columnName": "request_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "rawTransaction", + "columnName": "raw_transaction", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiverId", + "columnName": "receiver_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "request_id" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_state_type", + "unique": false, + "columnNames": [ + "state", + "type" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_state_type` ON `${TABLE_NAME}` (`state`, `type`)" + } + ] + }, + { + "tableName": "inscription_collections", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`collection_hash` TEXT NOT NULL, `supply` TEXT NOT NULL, `unit` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `description` TEXT, `kernel_asset_id` TEXT, `treasury` TEXT, PRIMARY KEY(`collection_hash`))", + "fields": [ + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "supply", + "columnName": "supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unit", + "columnName": "unit", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconURL", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT" + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT" + }, + { + "fieldPath": "treasury", + "columnName": "treasury", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "collection_hash" + ] + } + }, + { + "tableName": "inscription_items", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`inscription_hash` TEXT NOT NULL, `collection_hash` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `content_type` TEXT NOT NULL, `content_url` TEXT NOT NULL, `occupied_by` TEXT, `occupied_at` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `owner` TEXT, `traits` TEXT, PRIMARY KEY(`inscription_hash`))", + "fields": [ + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "contentType", + "columnName": "content_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "contentURL", + "columnName": "content_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "occupiedBy", + "columnName": "occupied_by", + "affinity": "TEXT" + }, + { + "fieldPath": "occupiedAt", + "columnName": "occupied_at", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "owner", + "columnName": "owner", + "affinity": "TEXT" + }, + { + "fieldPath": "traits", + "columnName": "traits", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "inscription_hash" + ] + } + }, + { + "tableName": "markets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `current_price` TEXT NOT NULL, `market_cap` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `total_volume` TEXT NOT NULL, `high_24h` TEXT NOT NULL, `low_24h` TEXT NOT NULL, `price_change_24h` TEXT NOT NULL, `price_change_percentage_1h` TEXT NOT NULL, `price_change_percentage_24h` TEXT NOT NULL, `price_change_percentage_7d` TEXT NOT NULL, `price_change_percentage_30d` TEXT NOT NULL, `market_cap_change_24h` TEXT NOT NULL, `market_cap_change_percentage_24h` TEXT NOT NULL, `circulating_supply` TEXT NOT NULL, `total_supply` TEXT NOT NULL, `max_supply` TEXT NOT NULL, `ath` TEXT NOT NULL, `ath_change_percentage` TEXT NOT NULL, `ath_date` TEXT NOT NULL, `atl` TEXT NOT NULL, `atl_change_percentage` TEXT NOT NULL, `atl_date` TEXT NOT NULL, `asset_ids` TEXT, `sparkline_in_7d` TEXT NOT NULL, `sparkline_in_24h` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "currentPrice", + "columnName": "current_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCap", + "columnName": "market_cap", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalVolume", + "columnName": "total_volume", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "high24h", + "columnName": "high_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "low24h", + "columnName": "low_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChange24h", + "columnName": "price_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage1H", + "columnName": "price_change_percentage_1h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage24H", + "columnName": "price_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage7D", + "columnName": "price_change_percentage_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage30D", + "columnName": "price_change_percentage_30d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChange24h", + "columnName": "market_cap_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChangePercentage24h", + "columnName": "market_cap_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circulatingSupply", + "columnName": "circulating_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalSupply", + "columnName": "total_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "maxSupply", + "columnName": "max_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ath", + "columnName": "ath", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athChangePercentage", + "columnName": "ath_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athDate", + "columnName": "ath_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atl", + "columnName": "atl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlChangePercentage", + "columnName": "atl_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlDate", + "columnName": "atl_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetIds", + "columnName": "asset_ids", + "affinity": "TEXT" + }, + { + "fieldPath": "sparklineIn7d", + "columnName": "sparkline_in_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sparklineIn24h", + "columnName": "sparkline_in_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + } + }, + { + "tableName": "history_prices", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `data` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`, `type`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id", + "type" + ] + } + }, + { + "tableName": "market_coins", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + } + }, + { + "tableName": "market_favored", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `is_favored` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "isFavored", + "columnName": "is_favored", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + } + }, + { + "tableName": "market_alerts", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`alert_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `frequency` TEXT NOT NULL, `status` TEXT NOT NULL, `value` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`alert_id`))", + "fields": [ + { + "fieldPath": "alertId", + "columnName": "alert_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "frequency", + "columnName": "frequency", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "alert_id" + ] + } + }, + { + "tableName": "market_cap_ranks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + } + }, + { + "tableName": "membership_orders", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`order_id` TEXT NOT NULL, `category` TEXT NOT NULL, `amount` TEXT NOT NULL, `amount_actual` TEXT NOT NULL, `amount_original` TEXT NOT NULL, `after` TEXT NOT NULL, `before` TEXT NOT NULL, `created_at` TEXT NOT NULL, `fiat_order` TEXT, `stars` INTEGER NOT NULL, `payment_url` TEXT, `status` TEXT NOT NULL, PRIMARY KEY(`order_id`))", + "fields": [ + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amountActual", + "columnName": "amount_actual", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amountOriginal", + "columnName": "amount_original", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "after", + "columnName": "after", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "before", + "columnName": "before", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fiatOrder", + "columnName": "fiat_order", + "affinity": "TEXT" + }, + { + "fieldPath": "stars", + "columnName": "stars", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "paymentUrl", + "columnName": "payment_url", + "affinity": "TEXT" + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "order_id" + ] + }, + "indices": [ + { + "name": "index_membership_orders_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_membership_orders_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ] + } + ], + "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, 'a49373f3e5e79b69c09e11d526d973d6')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/70.json b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/70.json new file mode 100644 index 0000000000..386929b4de --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.MixinDatabase/70.json @@ -0,0 +1,3351 @@ +{ + "formatVersion": 1, + "database": { + "version": 70, + "identityHash": "61cb9345a060036bd9618e3986544805", + "entities": [ + { + "tableName": "users", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `identity_number` TEXT NOT NULL, `relationship` TEXT NOT NULL, `biography` TEXT NOT NULL, `full_name` TEXT, `avatar_url` TEXT, `phone` TEXT, `is_verified` INTEGER, `created_at` TEXT, `mute_until` TEXT, `has_pin` INTEGER, `app_id` TEXT, `is_scam` INTEGER, `is_deactivated` INTEGER, `membership` TEXT, PRIMARY KEY(`user_id`))", + "fields": [ + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "identityNumber", + "columnName": "identity_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "relationship", + "columnName": "relationship", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "biography", + "columnName": "biography", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullName", + "columnName": "full_name", + "affinity": "TEXT" + }, + { + "fieldPath": "avatarUrl", + "columnName": "avatar_url", + "affinity": "TEXT" + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT" + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT" + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT" + }, + { + "fieldPath": "hasPin", + "columnName": "has_pin", + "affinity": "INTEGER" + }, + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT" + }, + { + "fieldPath": "isScam", + "columnName": "is_scam", + "affinity": "INTEGER" + }, + { + "fieldPath": "isDeactivated", + "columnName": "is_deactivated", + "affinity": "INTEGER" + }, + { + "fieldPath": "membership", + "columnName": "membership", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "user_id" + ] + }, + "indices": [ + { + "name": "index_users_relationship_full_name", + "unique": false, + "columnNames": [ + "relationship", + "full_name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_users_relationship_full_name` ON `${TABLE_NAME}` (`relationship`, `full_name`)" + } + ] + }, + { + "tableName": "conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `owner_id` TEXT, `category` TEXT, `name` TEXT, `icon_url` TEXT, `announcement` TEXT, `code_url` TEXT, `pay_type` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, `last_message_id` TEXT, `last_read_message_id` TEXT, `unseen_message_count` INTEGER, `status` INTEGER NOT NULL, `draft` TEXT, `mute_until` TEXT, `last_message_created_at` TEXT, `expire_in` INTEGER, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ownerId", + "columnName": "owner_id", + "affinity": "TEXT" + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT" + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT" + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT" + }, + { + "fieldPath": "announcement", + "columnName": "announcement", + "affinity": "TEXT" + }, + { + "fieldPath": "codeUrl", + "columnName": "code_url", + "affinity": "TEXT" + }, + { + "fieldPath": "payType", + "columnName": "pay_type", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT" + }, + { + "fieldPath": "lastMessageId", + "columnName": "last_message_id", + "affinity": "TEXT" + }, + { + "fieldPath": "lastReadMessageId", + "columnName": "last_read_message_id", + "affinity": "TEXT" + }, + { + "fieldPath": "unseenMessageCount", + "columnName": "unseen_message_count", + "affinity": "INTEGER" + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "draft", + "columnName": "draft", + "affinity": "TEXT" + }, + { + "fieldPath": "muteUntil", + "columnName": "mute_until", + "affinity": "TEXT" + }, + { + "fieldPath": "lastMessageCreatedAt", + "columnName": "last_message_created_at", + "affinity": "TEXT" + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + }, + "indices": [ + { + "name": "index_conversations_pin_time_last_message_created_at", + "unique": false, + "columnNames": [ + "pin_time", + "last_message_created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `${TABLE_NAME}` (`pin_time`, `last_message_created_at`)" + } + ] + }, + { + "tableName": "messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT" + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT" + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT" + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT" + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT" + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT" + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT" + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT" + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT" + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT" + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT" + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT" + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT" + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + }, + { + "name": "index_messages_conversation_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_category` ON `${TABLE_NAME}` (`conversation_id`, `category`)" + }, + { + "name": "index_messages_conversation_id_quote_message_id", + "unique": false, + "columnNames": [ + "conversation_id", + "quote_message_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_quote_message_id` ON `${TABLE_NAME}` (`conversation_id`, `quote_message_id`)" + }, + { + "name": "index_messages_conversation_id_status_user_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "status", + "user_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `status`, `user_id`, `created_at`)" + } + ], + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participants", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `role` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`, `user_id`), FOREIGN KEY(`conversation_id`) REFERENCES `conversations`(`conversation_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "role", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + }, + "foreignKeys": [ + { + "table": "conversations", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "conversation_id" + ], + "referencedColumns": [ + "conversation_id" + ] + } + ] + }, + { + "tableName": "participant_session", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, `public_key` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT" + }, + { + "fieldPath": "publicKey", + "columnName": "public_key", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id", + "session_id" + ] + } + }, + { + "tableName": "offsets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `timestamp` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + } + }, + { + "tableName": "assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT, `reserve` TEXT, `deposit_entries` TEXT, `withdrawal_memo_possibility` TEXT, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT" + }, + { + "fieldPath": "reserve", + "columnName": "reserve", + "affinity": "TEXT" + }, + { + "fieldPath": "depositEntries", + "columnName": "deposit_entries", + "affinity": "TEXT" + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + } + }, + { + "tableName": "assets_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + } + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `hidden` INTEGER, `balance` TEXT, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER" + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT" + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_extra_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_extra_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + } + ] + }, + { + "tableName": "snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, `snapshot_hash` TEXT, `opening_balance` TEXT, `closing_balance` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT" + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT" + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT" + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT" + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT" + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT" + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER" + }, + { + "fieldPath": "snapshotHash", + "columnName": "snapshot_hash", + "affinity": "TEXT" + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT" + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + } + }, + { + "tableName": "messages_history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + } + }, + { + "tableName": "sent_sender_keys", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `sent_to_server` INTEGER NOT NULL, `sender_key_id` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sentToServer", + "columnName": "sent_to_server", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "senderKeyId", + "columnName": "sender_key_id", + "affinity": "INTEGER" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "user_id" + ] + } + }, + { + "tableName": "stickers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`sticker_id` TEXT NOT NULL, `album_id` TEXT, `name` TEXT NOT NULL, `asset_url` TEXT NOT NULL, `asset_type` TEXT NOT NULL, `asset_width` INTEGER NOT NULL, `asset_height` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `last_use_at` TEXT, PRIMARY KEY(`sticker_id`))", + "fields": [ + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT" + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetUrl", + "columnName": "asset_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetType", + "columnName": "asset_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetWidth", + "columnName": "asset_width", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetHeight", + "columnName": "asset_height", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastUseAt", + "columnName": "last_use_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "sticker_id" + ] + } + }, + { + "tableName": "sticker_albums", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `update_at` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `description` TEXT NOT NULL, `banner` TEXT, `is_verified` INTEGER NOT NULL, `ordered_at` INTEGER NOT NULL DEFAULT 0, `added` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`album_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "update_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "banner", + "columnName": "banner", + "affinity": "TEXT" + }, + { + "fieldPath": "isVerified", + "columnName": "is_verified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id" + ] + } + }, + { + "tableName": "apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `app_number` TEXT NOT NULL, `home_uri` TEXT NOT NULL, `redirect_uri` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT, `description` TEXT NOT NULL, `app_secret` TEXT NOT NULL, `capabilities` TEXT, `creator_id` TEXT NOT NULL, `resource_patterns` TEXT, `updated_at` TEXT, PRIMARY KEY(`app_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appNumber", + "columnName": "app_number", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "homeUri", + "columnName": "home_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "redirectUri", + "columnName": "redirect_uri", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT" + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "appSecret", + "columnName": "app_secret", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "capabilities", + "columnName": "capabilities", + "affinity": "TEXT" + }, + { + "fieldPath": "creatorId", + "columnName": "creator_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "resourcePatterns", + "columnName": "resource_patterns", + "affinity": "TEXT" + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id" + ] + } + }, + { + "tableName": "hyperlinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hyperlink` TEXT NOT NULL, `site_name` TEXT NOT NULL, `site_title` TEXT NOT NULL, `site_description` TEXT, `site_image` TEXT, PRIMARY KEY(`hyperlink`))", + "fields": [ + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteName", + "columnName": "site_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteTitle", + "columnName": "site_title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "siteDescription", + "columnName": "site_description", + "affinity": "TEXT" + }, + { + "fieldPath": "siteImage", + "columnName": "site_image", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hyperlink" + ] + } + }, + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + } + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "label", + "columnName": "label", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [ + { + "name": "index_addresses_chain_id_updated_at", + "unique": false, + "columnNames": [ + "chain_id", + "updated_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_addresses_chain_id_updated_at` ON `${TABLE_NAME}` (`chain_id`, `updated_at`)" + } + ] + }, + { + "tableName": "resend_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id" + ] + } + }, + { + "tableName": "resend_session_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`, `user_id`, `session_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sessionId", + "columnName": "session_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id", + "user_id", + "session_id" + ] + } + }, + { + "tableName": "sticker_relationships", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`album_id` TEXT NOT NULL, `sticker_id` TEXT NOT NULL, PRIMARY KEY(`album_id`, `sticker_id`))", + "fields": [ + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "album_id", + "sticker_id" + ] + } + }, + { + "tableName": "top_assets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `balance` TEXT NOT NULL, `destination` TEXT NOT NULL, `tag` TEXT, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "balance", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + } + }, + { + "tableName": "favorite_apps", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", + "fields": [ + { + "fieldPath": "appId", + "columnName": "app_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "app_id", + "user_id" + ] + } + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER" + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT" + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT" + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT" + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "job_id" + ] + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ] + }, + { + "tableName": "message_mentions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hasRead", + "columnName": "has_read", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_message_mentions_conversation_id", + "unique": false, + "columnNames": [ + "conversation_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_message_mentions_conversation_id` ON `${TABLE_NAME}` (`conversation_id`)" + } + ] + }, + { + "tableName": "messages_fts4", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`message_id` TEXT NOT NULL, `content` TEXT, tokenize=unicode61, notindexed=`message_id`)", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [ + "message_id" + ], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [] + }, + { + "tableName": "circles", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", + "fields": [ + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderedAt", + "columnName": "ordered_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "circle_id" + ] + } + }, + { + "tableName": "circle_conversations", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `circle_id` TEXT NOT NULL, `user_id` TEXT, `created_at` TEXT NOT NULL, `pin_time` TEXT, PRIMARY KEY(`conversation_id`, `circle_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circleId", + "columnName": "circle_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pinTime", + "columnName": "pin_time", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id", + "circle_id" + ] + } + }, + { + "tableName": "traces", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `opponent_id` TEXT, `destination` TEXT, `tag` TEXT, `snapshot_id` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`trace_id`))", + "fields": [ + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT" + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT" + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "trace_id" + ] + } + }, + { + "tableName": "transcript_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))", + "fields": [ + { + "fieldPath": "transcriptId", + "columnName": "transcript_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "userFullName", + "columnName": "user_full_name", + "affinity": "TEXT" + }, + { + "fieldPath": "type", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaName", + "columnName": "media_name", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "INTEGER" + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB" + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT" + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT" + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB" + }, + { + "fieldPath": "mediaCreatedAt", + "columnName": "media_created_at", + "affinity": "TEXT" + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT" + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT" + }, + { + "fieldPath": "mentions", + "columnName": "mentions", + "affinity": "TEXT" + }, + { + "fieldPath": "quoteId", + "columnName": "quote_id", + "affinity": "TEXT" + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT" + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transcript_id", + "message_id" + ] + } + }, + { + "tableName": "pin_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_pin_messages_conversation_id_created_at", + "unique": false, + "columnNames": [ + "conversation_id", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id_created_at` ON `${TABLE_NAME}` (`conversation_id`, `created_at`)" + } + ] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + } + }, + { + "tableName": "remote_messages_status", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_remote_messages_status_conversation_id_status", + "unique": false, + "columnNames": [ + "conversation_id", + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `${TABLE_NAME}` (`conversation_id`, `status`)" + } + ] + }, + { + "tableName": "expired_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expireIn", + "columnName": "expire_in", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expireAt", + "columnName": "expire_at", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + } + }, + { + "tableName": "conversation_ext", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))", + "fields": [ + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "count", + "columnName": "count", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "conversation_id" + ] + } + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `withdrawal_memo_possibility` TEXT NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "withdrawalMemoPossibility", + "columnName": "withdrawal_memo_possibility", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + } + }, + { + "tableName": "outputs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`output_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `asset` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `amount` TEXT NOT NULL, `mask` TEXT NOT NULL, `keys` TEXT NOT NULL, `receivers` TEXT NOT NULL, `receivers_hash` TEXT NOT NULL, `receivers_threshold` INTEGER NOT NULL, `extra` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `signed_by` TEXT NOT NULL, `signed_at` TEXT NOT NULL, `spent_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`output_id`))", + "fields": [ + { + "fieldPath": "outputId", + "columnName": "output_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputIndex", + "columnName": "output_index", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "asset", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "mask", + "columnName": "mask", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "keys", + "columnName": "keys", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversHash", + "columnName": "receivers_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiversThreshold", + "columnName": "receivers_threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "extra", + "columnName": "extra", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedBy", + "columnName": "signed_by", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "signedAt", + "columnName": "signed_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "spentAt", + "columnName": "spent_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "output_id" + ] + }, + "indices": [ + { + "name": "index_outputs_asset_state_sequence", + "unique": false, + "columnNames": [ + "asset", + "state", + "sequence" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_asset_state_sequence` ON `${TABLE_NAME}` (`asset`, `state`, `sequence`)" + }, + { + "name": "index_outputs_transaction_hash_output_index", + "unique": true, + "columnNames": [ + "transaction_hash", + "output_index" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_outputs_transaction_hash_output_index` ON `${TABLE_NAME}` (`transaction_hash`, `output_index`)" + }, + { + "name": "index_outputs_inscription_hash", + "unique": false, + "columnNames": [ + "inscription_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_outputs_inscription_hash` ON `${TABLE_NAME}` (`inscription_hash`)" + } + ] + }, + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT NOT NULL, `dust` TEXT NOT NULL, `collection_hash` TEXT, `precision` INTEGER NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "asset", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceBtc", + "columnName": "price_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeBtc", + "columnName": "change_btc", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dust", + "columnName": "dust", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT" + }, + { + "fieldPath": "precision", + "columnName": "precision", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + }, + "indices": [ + { + "name": "index_tokens_kernel_asset_id", + "unique": false, + "columnNames": [ + "kernel_asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_kernel_asset_id` ON `${TABLE_NAME}` (`kernel_asset_id`)" + }, + { + "name": "index_tokens_collection_hash", + "unique": false, + "columnNames": [ + "collection_hash" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tokens_collection_hash` ON `${TABLE_NAME}` (`collection_hash`)" + } + ] + }, + { + "tableName": "deposit_entries", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`entry_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `members` TEXT NOT NULL, `tag` TEXT, `signature` TEXT NOT NULL, `threshold` INTEGER NOT NULL, `is_primary` INTEGER NOT NULL, `minimum` TEXT NOT NULL, `maximum` TEXT NOT NULL, PRIMARY KEY(`entry_id`))", + "fields": [ + { + "fieldPath": "entryId", + "columnName": "entry_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "members", + "columnName": "members", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tag", + "columnName": "tag", + "affinity": "TEXT" + }, + { + "fieldPath": "signature", + "columnName": "signature", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isPrimary", + "columnName": "is_primary", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "minimum", + "columnName": "minimum", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "maximum", + "columnName": "maximum", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "entry_id" + ] + } + }, + { + "tableName": "safe_snapshots", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `user_id` TEXT NOT NULL, `opponent_id` TEXT NOT NULL, `memo` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `created_at` TEXT NOT NULL, `trace_id` TEXT, `confirmations` INTEGER, `opening_balance` TEXT, `closing_balance` TEXT, `deposit` TEXT, `withdrawal` TEXT, `inscription_hash` TEXT, PRIMARY KEY(`snapshot_id`))", + "fields": [ + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "opponentId", + "columnName": "opponent_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "memo", + "columnName": "memo", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "traceId", + "columnName": "trace_id", + "affinity": "TEXT" + }, + { + "fieldPath": "confirmations", + "columnName": "confirmations", + "affinity": "INTEGER" + }, + { + "fieldPath": "openingBalance", + "columnName": "opening_balance", + "affinity": "TEXT" + }, + { + "fieldPath": "closingBalance", + "columnName": "closing_balance", + "affinity": "TEXT" + }, + { + "fieldPath": "deposit", + "columnName": "deposit", + "affinity": "TEXT" + }, + { + "fieldPath": "withdrawal", + "columnName": "withdrawal", + "affinity": "TEXT" + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "snapshot_id" + ] + }, + "indices": [ + { + "name": "index_safe_snapshots_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_safe_snapshots_created_at` ON `${TABLE_NAME}` (`created_at`)" + }, + { + "name": "index_safe_snapshots_type_asset_id", + "unique": false, + "columnNames": [ + "type", + "asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_safe_snapshots_type_asset_id` ON `${TABLE_NAME}` (`type`, `asset_id`)" + } + ] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`request_id` TEXT NOT NULL, `raw_transaction` TEXT NOT NULL, `receiver_id` TEXT NOT NULL, `type` INTEGER NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `inscription_hash` TEXT, PRIMARY KEY(`request_id`))", + "fields": [ + { + "fieldPath": "requestId", + "columnName": "request_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "rawTransaction", + "columnName": "raw_transaction", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiverId", + "columnName": "receiver_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "request_id" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_state_type", + "unique": false, + "columnNames": [ + "state", + "type" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_state_type` ON `${TABLE_NAME}` (`state`, `type`)" + } + ] + }, + { + "tableName": "inscription_collections", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`collection_hash` TEXT NOT NULL, `supply` TEXT NOT NULL, `unit` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `description` TEXT, `kernel_asset_id` TEXT, `treasury` TEXT, PRIMARY KEY(`collection_hash`))", + "fields": [ + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "supply", + "columnName": "supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unit", + "columnName": "unit", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconURL", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT" + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT" + }, + { + "fieldPath": "treasury", + "columnName": "treasury", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "collection_hash" + ] + } + }, + { + "tableName": "inscription_items", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`inscription_hash` TEXT NOT NULL, `collection_hash` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `content_type` TEXT NOT NULL, `content_url` TEXT NOT NULL, `occupied_by` TEXT, `occupied_at` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `owner` TEXT, `traits` TEXT, PRIMARY KEY(`inscription_hash`))", + "fields": [ + { + "fieldPath": "inscriptionHash", + "columnName": "inscription_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "collectionHash", + "columnName": "collection_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sequence", + "columnName": "sequence", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "contentType", + "columnName": "content_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "contentURL", + "columnName": "content_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "occupiedBy", + "columnName": "occupied_by", + "affinity": "TEXT" + }, + { + "fieldPath": "occupiedAt", + "columnName": "occupied_at", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "owner", + "columnName": "owner", + "affinity": "TEXT" + }, + { + "fieldPath": "traits", + "columnName": "traits", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "inscription_hash" + ] + } + }, + { + "tableName": "markets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `current_price` TEXT NOT NULL, `market_cap` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `total_volume` TEXT NOT NULL, `high_24h` TEXT NOT NULL, `low_24h` TEXT NOT NULL, `price_change_24h` TEXT NOT NULL, `price_change_percentage_1h` TEXT NOT NULL, `price_change_percentage_24h` TEXT NOT NULL, `price_change_percentage_7d` TEXT NOT NULL, `price_change_percentage_30d` TEXT NOT NULL, `market_cap_change_24h` TEXT NOT NULL, `market_cap_change_percentage_24h` TEXT NOT NULL, `circulating_supply` TEXT NOT NULL, `total_supply` TEXT NOT NULL, `max_supply` TEXT NOT NULL, `ath` TEXT NOT NULL, `ath_change_percentage` TEXT NOT NULL, `ath_date` TEXT NOT NULL, `atl` TEXT NOT NULL, `atl_change_percentage` TEXT NOT NULL, `atl_date` TEXT NOT NULL, `asset_ids` TEXT, `sparkline_in_7d` TEXT NOT NULL, `sparkline_in_24h` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `descriptions` TEXT, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "currentPrice", + "columnName": "current_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCap", + "columnName": "market_cap", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalVolume", + "columnName": "total_volume", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "high24h", + "columnName": "high_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "low24h", + "columnName": "low_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChange24h", + "columnName": "price_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage1H", + "columnName": "price_change_percentage_1h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage24H", + "columnName": "price_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage7D", + "columnName": "price_change_percentage_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceChangePercentage30D", + "columnName": "price_change_percentage_30d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChange24h", + "columnName": "market_cap_change_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapChangePercentage24h", + "columnName": "market_cap_change_percentage_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "circulatingSupply", + "columnName": "circulating_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "totalSupply", + "columnName": "total_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "maxSupply", + "columnName": "max_supply", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "ath", + "columnName": "ath", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athChangePercentage", + "columnName": "ath_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "athDate", + "columnName": "ath_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atl", + "columnName": "atl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlChangePercentage", + "columnName": "atl_change_percentage", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "atlDate", + "columnName": "atl_date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetIds", + "columnName": "asset_ids", + "affinity": "TEXT" + }, + { + "fieldPath": "sparklineIn7d", + "columnName": "sparkline_in_7d", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sparklineIn24h", + "columnName": "sparkline_in_24h", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "descriptions", + "columnName": "descriptions", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + } + }, + { + "tableName": "history_prices", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `data` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`, `type`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id", + "type" + ] + } + }, + { + "tableName": "market_coins", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`asset_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))", + "fields": [ + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "asset_id" + ] + } + }, + { + "tableName": "market_favored", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `is_favored` INTEGER NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "isFavored", + "columnName": "is_favored", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + } + }, + { + "tableName": "market_alerts", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`alert_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `frequency` TEXT NOT NULL, `status` TEXT NOT NULL, `value` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`alert_id`))", + "fields": [ + { + "fieldPath": "alertId", + "columnName": "alert_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "frequency", + "columnName": "frequency", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "alert_id" + ] + } + }, + { + "tableName": "market_cap_ranks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`coin_id` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))", + "fields": [ + { + "fieldPath": "coinId", + "columnName": "coin_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketCapRank", + "columnName": "market_cap_rank", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "coin_id" + ] + } + }, + { + "tableName": "membership_orders", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`order_id` TEXT NOT NULL, `category` TEXT NOT NULL, `amount` TEXT NOT NULL, `amount_actual` TEXT NOT NULL, `amount_original` TEXT NOT NULL, `after` TEXT NOT NULL, `before` TEXT NOT NULL, `created_at` TEXT NOT NULL, `fiat_order` TEXT, `stars` INTEGER NOT NULL, `payment_url` TEXT, `status` TEXT NOT NULL, PRIMARY KEY(`order_id`))", + "fields": [ + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amountActual", + "columnName": "amount_actual", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amountOriginal", + "columnName": "amount_original", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "after", + "columnName": "after", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "before", + "columnName": "before", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fiatOrder", + "columnName": "fiat_order", + "affinity": "TEXT" + }, + { + "fieldPath": "stars", + "columnName": "stars", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "paymentUrl", + "columnName": "payment_url", + "affinity": "TEXT" + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "order_id" + ] + }, + "indices": [ + { + "name": "index_membership_orders_created_at", + "unique": false, + "columnNames": [ + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_membership_orders_created_at` ON `${TABLE_NAME}` (`created_at`)" + } + ] + } + ], + "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, '61cb9345a060036bd9618e3986544805')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.PerpsDatabase/1.json b/app/schemas/otherChannel/one.mixin.android.db.PerpsDatabase/1.json new file mode 100644 index 0000000000..4b7954fffa --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.PerpsDatabase/1.json @@ -0,0 +1,349 @@ +{ + "formatVersion": 1, + "database": { + "version": 1, + "identityHash": "5fad6bcd4df78e3928b3aa50627c3d8c", + "entities": [ + { + "tableName": "positions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`position_id` TEXT NOT NULL, `market_id` TEXT NOT NULL, `side` TEXT NOT NULL, `quantity` TEXT NOT NULL, `entry_price` TEXT NOT NULL, `margin` TEXT NOT NULL, `leverage` INTEGER NOT NULL, `state` TEXT NOT NULL, `mark_price` TEXT NOT NULL, `unrealized_pnl` TEXT NOT NULL, `roe` TEXT NOT NULL, `settle_asset_id` TEXT NOT NULL, `open_pay_amount` TEXT NOT NULL, `open_pay_asset_id` TEXT NOT NULL, `bot_id` TEXT NOT NULL, `wallet_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`position_id`))", + "fields": [ + { + "fieldPath": "positionId", + "columnName": "position_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketId", + "columnName": "market_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "side", + "columnName": "side", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "quantity", + "columnName": "quantity", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "entryPrice", + "columnName": "entry_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "margin", + "columnName": "margin", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "leverage", + "columnName": "leverage", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "markPrice", + "columnName": "mark_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unrealizedPnl", + "columnName": "unrealized_pnl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "roe", + "columnName": "roe", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "settleAssetId", + "columnName": "settle_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "openPayAmount", + "columnName": "open_pay_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "openPayAssetId", + "columnName": "open_pay_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "botId", + "columnName": "bot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "position_id" + ] + } + }, + { + "tableName": "position_histories", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`history_id` TEXT NOT NULL, `position_id` TEXT NOT NULL, `market_id` TEXT NOT NULL, `side` TEXT NOT NULL, `quantity` TEXT NOT NULL, `entry_price` TEXT NOT NULL, `close_price` TEXT NOT NULL, `realized_pnl` TEXT NOT NULL, `leverage` INTEGER NOT NULL, `margin_method` TEXT NOT NULL, `open_at` TEXT NOT NULL, `closed_at` TEXT NOT NULL, PRIMARY KEY(`history_id`))", + "fields": [ + { + "fieldPath": "historyId", + "columnName": "history_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "positionId", + "columnName": "position_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketId", + "columnName": "market_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "side", + "columnName": "side", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "quantity", + "columnName": "quantity", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "entryPrice", + "columnName": "entry_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "closePrice", + "columnName": "close_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "realizedPnl", + "columnName": "realized_pnl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "leverage", + "columnName": "leverage", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "marginMethod", + "columnName": "margin_method", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "openAt", + "columnName": "open_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "closedAt", + "columnName": "closed_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "history_id" + ] + } + }, + { + "tableName": "markets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`market_id` TEXT NOT NULL, `display_symbol` TEXT NOT NULL, `token_symbol` TEXT NOT NULL, `quote_symbol` TEXT NOT NULL, `mark_price` TEXT NOT NULL, `leverage` INTEGER NOT NULL, `icon_url` TEXT NOT NULL, `funding_rate` TEXT NOT NULL, `min_amount` TEXT NOT NULL, `max_amount` TEXT NOT NULL, `last` TEXT NOT NULL, `volume` TEXT NOT NULL, `high` TEXT NOT NULL, `low` TEXT NOT NULL, `open` TEXT NOT NULL, `change` TEXT NOT NULL, `bid_price` TEXT NOT NULL, `ask_price` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`market_id`))", + "fields": [ + { + "fieldPath": "marketId", + "columnName": "market_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "displaySymbol", + "columnName": "display_symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tokenSymbol", + "columnName": "token_symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "quoteSymbol", + "columnName": "quote_symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "markPrice", + "columnName": "mark_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "leverage", + "columnName": "leverage", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fundingRate", + "columnName": "funding_rate", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "minAmount", + "columnName": "min_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "maxAmount", + "columnName": "max_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "last", + "columnName": "last", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "volume", + "columnName": "volume", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "high", + "columnName": "high", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "low", + "columnName": "low", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "open", + "columnName": "open", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "change", + "columnName": "change", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "bidPrice", + "columnName": "bid_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "askPrice", + "columnName": "ask_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "market_id" + ] + } + } + ], + "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, '5fad6bcd4df78e3928b3aa50627c3d8c')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.PerpsDatabase/2.json b/app/schemas/otherChannel/one.mixin.android.db.PerpsDatabase/2.json new file mode 100644 index 0000000000..344fd16f38 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.PerpsDatabase/2.json @@ -0,0 +1,361 @@ +{ + "formatVersion": 1, + "database": { + "version": 2, + "identityHash": "4423b2cbe0ba53b8f8a4190b84e04883", + "entities": [ + { + "tableName": "positions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`position_id` TEXT NOT NULL, `market_id` TEXT NOT NULL, `side` TEXT NOT NULL, `quantity` TEXT NOT NULL, `entry_price` TEXT NOT NULL, `margin` TEXT NOT NULL, `leverage` INTEGER NOT NULL, `state` TEXT NOT NULL, `mark_price` TEXT NOT NULL, `unrealized_pnl` TEXT NOT NULL, `roe` TEXT NOT NULL, `settle_asset_id` TEXT NOT NULL, `open_pay_amount` TEXT NOT NULL, `open_pay_asset_id` TEXT NOT NULL, `bot_id` TEXT NOT NULL, `wallet_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`position_id`))", + "fields": [ + { + "fieldPath": "positionId", + "columnName": "position_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketId", + "columnName": "market_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "side", + "columnName": "side", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "quantity", + "columnName": "quantity", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "entryPrice", + "columnName": "entry_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "margin", + "columnName": "margin", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "leverage", + "columnName": "leverage", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "markPrice", + "columnName": "mark_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unrealizedPnl", + "columnName": "unrealized_pnl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "roe", + "columnName": "roe", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "settleAssetId", + "columnName": "settle_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "openPayAmount", + "columnName": "open_pay_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "openPayAssetId", + "columnName": "open_pay_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "botId", + "columnName": "bot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "position_id" + ] + } + }, + { + "tableName": "position_histories", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`history_id` TEXT NOT NULL, `position_id` TEXT NOT NULL, `market_id` TEXT NOT NULL, `side` TEXT NOT NULL, `quantity` TEXT NOT NULL, `entry_price` TEXT NOT NULL, `close_price` TEXT NOT NULL, `realized_pnl` TEXT NOT NULL, `leverage` INTEGER NOT NULL, `margin_method` TEXT NOT NULL, `open_at` TEXT NOT NULL, `closed_at` TEXT NOT NULL, PRIMARY KEY(`history_id`))", + "fields": [ + { + "fieldPath": "historyId", + "columnName": "history_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "positionId", + "columnName": "position_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketId", + "columnName": "market_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "side", + "columnName": "side", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "quantity", + "columnName": "quantity", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "entryPrice", + "columnName": "entry_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "closePrice", + "columnName": "close_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "realizedPnl", + "columnName": "realized_pnl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "leverage", + "columnName": "leverage", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "marginMethod", + "columnName": "margin_method", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "openAt", + "columnName": "open_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "closedAt", + "columnName": "closed_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "history_id" + ] + } + }, + { + "tableName": "markets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`market_id` TEXT NOT NULL, `display_symbol` TEXT NOT NULL, `token_symbol` TEXT NOT NULL, `quote_symbol` TEXT NOT NULL, `mark_price` TEXT NOT NULL, `leverage` INTEGER NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT NOT NULL, `tags` TEXT NOT NULL, `funding_rate` TEXT NOT NULL, `min_amount` TEXT NOT NULL, `max_amount` TEXT NOT NULL, `last` TEXT NOT NULL, `volume` TEXT NOT NULL, `high` TEXT NOT NULL, `low` TEXT NOT NULL, `open` TEXT NOT NULL, `change` TEXT NOT NULL, `bid_price` TEXT NOT NULL, `ask_price` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`market_id`))", + "fields": [ + { + "fieldPath": "marketId", + "columnName": "market_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "displaySymbol", + "columnName": "display_symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tokenSymbol", + "columnName": "token_symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "quoteSymbol", + "columnName": "quote_symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "markPrice", + "columnName": "mark_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "leverage", + "columnName": "leverage", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tags", + "columnName": "tags", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fundingRate", + "columnName": "funding_rate", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "minAmount", + "columnName": "min_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "maxAmount", + "columnName": "max_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "last", + "columnName": "last", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "volume", + "columnName": "volume", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "high", + "columnName": "high", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "low", + "columnName": "low", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "open", + "columnName": "open", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "change", + "columnName": "change", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "bidPrice", + "columnName": "bid_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "askPrice", + "columnName": "ask_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "market_id" + ] + } + } + ], + "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, '4423b2cbe0ba53b8f8a4190b84e04883')" + ] + } +} diff --git a/app/schemas/otherChannel/one.mixin.android.db.PerpsDatabase/3.json b/app/schemas/otherChannel/one.mixin.android.db.PerpsDatabase/3.json new file mode 100644 index 0000000000..d4e01d72fe --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.PerpsDatabase/3.json @@ -0,0 +1,383 @@ +{ + "formatVersion": 1, + "database": { + "version": 3, + "identityHash": "9e8cb86e29aea40ac477a894bfbca617", + "entities": [ + { + "tableName": "positions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`position_id` TEXT NOT NULL, `market_id` TEXT NOT NULL, `side` TEXT NOT NULL, `quantity` TEXT NOT NULL, `entry_price` TEXT NOT NULL, `margin` TEXT NOT NULL, `leverage` INTEGER NOT NULL, `state` TEXT NOT NULL, `mark_price` TEXT NOT NULL, `unrealized_pnl` TEXT NOT NULL, `roe` TEXT NOT NULL, `settle_asset_id` TEXT NOT NULL, `open_pay_amount` TEXT NOT NULL, `open_pay_asset_id` TEXT NOT NULL, `take_profit_price` TEXT, `stop_loss_price` TEXT, `liquidation_price` TEXT, `bot_id` TEXT NOT NULL, `wallet_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`position_id`))", + "fields": [ + { + "fieldPath": "positionId", + "columnName": "position_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketId", + "columnName": "market_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "side", + "columnName": "side", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "quantity", + "columnName": "quantity", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "entryPrice", + "columnName": "entry_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "margin", + "columnName": "margin", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "leverage", + "columnName": "leverage", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "markPrice", + "columnName": "mark_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unrealizedPnl", + "columnName": "unrealized_pnl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "roe", + "columnName": "roe", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "settleAssetId", + "columnName": "settle_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "openPayAmount", + "columnName": "open_pay_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "openPayAssetId", + "columnName": "open_pay_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "takeProfitPrice", + "columnName": "take_profit_price", + "affinity": "TEXT" + }, + { + "fieldPath": "stopLossPrice", + "columnName": "stop_loss_price", + "affinity": "TEXT" + }, + { + "fieldPath": "liquidationPrice", + "columnName": "liquidation_price", + "affinity": "TEXT" + }, + { + "fieldPath": "botId", + "columnName": "bot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "position_id" + ] + } + }, + { + "tableName": "position_histories", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`history_id` TEXT NOT NULL, `position_id` TEXT NOT NULL, `market_id` TEXT NOT NULL, `side` TEXT NOT NULL, `quantity` TEXT NOT NULL, `entry_price` TEXT NOT NULL, `close_price` TEXT NOT NULL, `realized_pnl` TEXT NOT NULL, `leverage` INTEGER NOT NULL, `margin_method` TEXT NOT NULL, `open_at` TEXT NOT NULL, `closed_at` TEXT NOT NULL, PRIMARY KEY(`history_id`))", + "fields": [ + { + "fieldPath": "historyId", + "columnName": "history_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "positionId", + "columnName": "position_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketId", + "columnName": "market_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "side", + "columnName": "side", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "quantity", + "columnName": "quantity", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "entryPrice", + "columnName": "entry_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "closePrice", + "columnName": "close_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "realizedPnl", + "columnName": "realized_pnl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "leverage", + "columnName": "leverage", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "marginMethod", + "columnName": "margin_method", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "openAt", + "columnName": "open_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "closedAt", + "columnName": "closed_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "history_id" + ] + } + }, + { + "tableName": "markets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`market_id` TEXT NOT NULL, `display_symbol` TEXT NOT NULL, `token_symbol` TEXT NOT NULL, `quote_symbol` TEXT NOT NULL, `mark_price` TEXT NOT NULL, `price_scale` INTEGER NOT NULL DEFAULT 2, `leverage` INTEGER NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT NOT NULL, `tags` TEXT NOT NULL, `funding_rate` TEXT NOT NULL, `min_amount` TEXT NOT NULL, `max_amount` TEXT NOT NULL, `last` TEXT NOT NULL, `volume` TEXT NOT NULL, `high` TEXT NOT NULL, `low` TEXT NOT NULL, `open` TEXT NOT NULL, `change` TEXT NOT NULL, `bid_price` TEXT NOT NULL, `ask_price` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`market_id`))", + "fields": [ + { + "fieldPath": "marketId", + "columnName": "market_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "displaySymbol", + "columnName": "display_symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tokenSymbol", + "columnName": "token_symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "quoteSymbol", + "columnName": "quote_symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "markPrice", + "columnName": "mark_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceScale", + "columnName": "price_scale", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "2" + }, + { + "fieldPath": "leverage", + "columnName": "leverage", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tags", + "columnName": "tags", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fundingRate", + "columnName": "funding_rate", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "minAmount", + "columnName": "min_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "maxAmount", + "columnName": "max_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "last", + "columnName": "last", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "volume", + "columnName": "volume", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "high", + "columnName": "high", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "low", + "columnName": "low", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "open", + "columnName": "open", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "change", + "columnName": "change", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "bidPrice", + "columnName": "bid_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "askPrice", + "columnName": "ask_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "market_id" + ] + } + } + ], + "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, '9e8cb86e29aea40ac477a894bfbca617')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.PerpsDatabase/4.json b/app/schemas/otherChannel/one.mixin.android.db.PerpsDatabase/4.json new file mode 100644 index 0000000000..878eb548d6 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.PerpsDatabase/4.json @@ -0,0 +1,405 @@ +{ + "formatVersion": 1, + "database": { + "version": 4, + "identityHash": "352578bf8f01c460557895ed10f09dc1", + "entities": [ + { + "tableName": "positions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`position_id` TEXT NOT NULL, `market_id` TEXT NOT NULL, `side` TEXT NOT NULL, `quantity` TEXT NOT NULL, `entry_price` TEXT NOT NULL, `margin` TEXT NOT NULL, `leverage` INTEGER NOT NULL, `state` TEXT NOT NULL, `mark_price` TEXT NOT NULL, `unrealized_pnl` TEXT NOT NULL, `roe` TEXT NOT NULL, `settle_asset_id` TEXT NOT NULL, `open_pay_amount` TEXT NOT NULL, `open_pay_asset_id` TEXT NOT NULL, `take_profit_price` TEXT, `stop_loss_price` TEXT, `liquidation_price` TEXT, `bot_id` TEXT NOT NULL, `wallet_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`position_id`))", + "fields": [ + { + "fieldPath": "positionId", + "columnName": "position_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketId", + "columnName": "market_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "side", + "columnName": "side", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "quantity", + "columnName": "quantity", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "entryPrice", + "columnName": "entry_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "margin", + "columnName": "margin", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "leverage", + "columnName": "leverage", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "markPrice", + "columnName": "mark_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unrealizedPnl", + "columnName": "unrealized_pnl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "roe", + "columnName": "roe", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "settleAssetId", + "columnName": "settle_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "openPayAmount", + "columnName": "open_pay_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "openPayAssetId", + "columnName": "open_pay_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "takeProfitPrice", + "columnName": "take_profit_price", + "affinity": "TEXT" + }, + { + "fieldPath": "stopLossPrice", + "columnName": "stop_loss_price", + "affinity": "TEXT" + }, + { + "fieldPath": "liquidationPrice", + "columnName": "liquidation_price", + "affinity": "TEXT" + }, + { + "fieldPath": "botId", + "columnName": "bot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "position_id" + ] + } + }, + { + "tableName": "perps_orders", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`order_id` TEXT NOT NULL, `position_id` TEXT NOT NULL, `market_id` TEXT NOT NULL, `side` TEXT NOT NULL, `order_type` TEXT NOT NULL, `status` TEXT NOT NULL, `leverage` INTEGER NOT NULL, `quantity` TEXT NOT NULL, `entry_price` TEXT NOT NULL, `close_price` TEXT NOT NULL, `realized_pnl` TEXT NOT NULL, `roe` TEXT NOT NULL, `close_reason` TEXT, `trigger_price` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`order_id`))", + "fields": [ + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "positionId", + "columnName": "position_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketId", + "columnName": "market_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "side", + "columnName": "side", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderType", + "columnName": "order_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "leverage", + "columnName": "leverage", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "quantity", + "columnName": "quantity", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "entryPrice", + "columnName": "entry_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "closePrice", + "columnName": "close_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "realizedPnl", + "columnName": "realized_pnl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "roe", + "columnName": "roe", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "closeReason", + "columnName": "close_reason", + "affinity": "TEXT" + }, + { + "fieldPath": "triggerPrice", + "columnName": "trigger_price", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "order_id" + ] + } + }, + { + "tableName": "markets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`market_id` TEXT NOT NULL, `display_symbol` TEXT NOT NULL, `token_symbol` TEXT NOT NULL, `quote_symbol` TEXT NOT NULL, `mark_price` TEXT NOT NULL, `price_scale` INTEGER NOT NULL DEFAULT 2, `leverage` INTEGER NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT NOT NULL, `tags` TEXT NOT NULL, `funding_rate` TEXT NOT NULL, `min_amount` TEXT NOT NULL, `max_amount` TEXT NOT NULL, `last` TEXT NOT NULL, `volume` TEXT NOT NULL, `high` TEXT NOT NULL, `low` TEXT NOT NULL, `open` TEXT NOT NULL, `change` TEXT NOT NULL, `bid_price` TEXT NOT NULL, `ask_price` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`market_id`))", + "fields": [ + { + "fieldPath": "marketId", + "columnName": "market_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "displaySymbol", + "columnName": "display_symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tokenSymbol", + "columnName": "token_symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "quoteSymbol", + "columnName": "quote_symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "markPrice", + "columnName": "mark_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceScale", + "columnName": "price_scale", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "2" + }, + { + "fieldPath": "leverage", + "columnName": "leverage", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tags", + "columnName": "tags", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fundingRate", + "columnName": "funding_rate", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "minAmount", + "columnName": "min_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "maxAmount", + "columnName": "max_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "last", + "columnName": "last", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "volume", + "columnName": "volume", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "high", + "columnName": "high", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "low", + "columnName": "low", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "open", + "columnName": "open", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "change", + "columnName": "change", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "bidPrice", + "columnName": "bid_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "askPrice", + "columnName": "ask_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "market_id" + ] + } + } + ], + "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, '352578bf8f01c460557895ed10f09dc1')" + ] + } +} diff --git a/app/schemas/otherChannel/one.mixin.android.db.PerpsDatabase/5.json b/app/schemas/otherChannel/one.mixin.android.db.PerpsDatabase/5.json new file mode 100644 index 0000000000..bd6f971759 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.PerpsDatabase/5.json @@ -0,0 +1,411 @@ +{ + "formatVersion": 1, + "database": { + "version": 5, + "identityHash": "caa79a2cd9e2735f87b8b2af9c6eae2c", + "entities": [ + { + "tableName": "positions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`position_id` TEXT NOT NULL, `market_id` TEXT NOT NULL, `side` TEXT NOT NULL, `quantity` TEXT NOT NULL, `entry_price` TEXT NOT NULL, `margin` TEXT NOT NULL, `leverage` INTEGER NOT NULL, `state` TEXT NOT NULL, `mark_price` TEXT NOT NULL, `unrealized_pnl` TEXT NOT NULL, `roe` TEXT NOT NULL, `settle_asset_id` TEXT NOT NULL, `open_pay_amount` TEXT NOT NULL, `open_pay_asset_id` TEXT NOT NULL, `take_profit_price` TEXT, `stop_loss_price` TEXT, `liquidation_price` TEXT, `bot_id` TEXT NOT NULL, `wallet_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`position_id`))", + "fields": [ + { + "fieldPath": "positionId", + "columnName": "position_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketId", + "columnName": "market_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "side", + "columnName": "side", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "quantity", + "columnName": "quantity", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "entryPrice", + "columnName": "entry_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "margin", + "columnName": "margin", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "leverage", + "columnName": "leverage", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "markPrice", + "columnName": "mark_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unrealizedPnl", + "columnName": "unrealized_pnl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "roe", + "columnName": "roe", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "settleAssetId", + "columnName": "settle_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "openPayAmount", + "columnName": "open_pay_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "openPayAssetId", + "columnName": "open_pay_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "takeProfitPrice", + "columnName": "take_profit_price", + "affinity": "TEXT" + }, + { + "fieldPath": "stopLossPrice", + "columnName": "stop_loss_price", + "affinity": "TEXT" + }, + { + "fieldPath": "liquidationPrice", + "columnName": "liquidation_price", + "affinity": "TEXT" + }, + { + "fieldPath": "botId", + "columnName": "bot_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "position_id" + ] + } + }, + { + "tableName": "perps_orders", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`order_id` TEXT NOT NULL, `position_id` TEXT NOT NULL, `market_id` TEXT NOT NULL, `side` TEXT NOT NULL, `order_type` TEXT NOT NULL, `status` TEXT NOT NULL, `leverage` INTEGER NOT NULL, `quantity` TEXT NOT NULL, `pay_amount` TEXT NOT NULL, `entry_price` TEXT NOT NULL, `close_price` TEXT NOT NULL, `realized_pnl` TEXT NOT NULL, `roe` TEXT NOT NULL, `close_reason` TEXT, `trigger_price` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`order_id`))", + "fields": [ + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "positionId", + "columnName": "position_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "marketId", + "columnName": "market_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "side", + "columnName": "side", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderType", + "columnName": "order_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "leverage", + "columnName": "leverage", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "quantity", + "columnName": "quantity", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payAmount", + "columnName": "pay_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "entryPrice", + "columnName": "entry_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "closePrice", + "columnName": "close_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "realizedPnl", + "columnName": "realized_pnl", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "roe", + "columnName": "roe", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "closeReason", + "columnName": "close_reason", + "affinity": "TEXT" + }, + { + "fieldPath": "triggerPrice", + "columnName": "trigger_price", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "order_id" + ] + } + }, + { + "tableName": "markets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`market_id` TEXT NOT NULL, `display_symbol` TEXT NOT NULL, `token_symbol` TEXT NOT NULL, `quote_symbol` TEXT NOT NULL, `mark_price` TEXT NOT NULL, `price_scale` INTEGER NOT NULL DEFAULT 2, `leverage` INTEGER NOT NULL, `icon_url` TEXT NOT NULL, `category` TEXT NOT NULL, `tags` TEXT NOT NULL, `funding_rate` TEXT NOT NULL, `min_amount` TEXT NOT NULL, `max_amount` TEXT NOT NULL, `last` TEXT NOT NULL, `volume` TEXT NOT NULL, `high` TEXT NOT NULL, `low` TEXT NOT NULL, `open` TEXT NOT NULL, `change` TEXT NOT NULL, `bid_price` TEXT NOT NULL, `ask_price` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`market_id`))", + "fields": [ + { + "fieldPath": "marketId", + "columnName": "market_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "displaySymbol", + "columnName": "display_symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tokenSymbol", + "columnName": "token_symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "quoteSymbol", + "columnName": "quote_symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "markPrice", + "columnName": "mark_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceScale", + "columnName": "price_scale", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "2" + }, + { + "fieldPath": "leverage", + "columnName": "leverage", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "tags", + "columnName": "tags", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fundingRate", + "columnName": "funding_rate", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "minAmount", + "columnName": "min_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "maxAmount", + "columnName": "max_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "last", + "columnName": "last", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "volume", + "columnName": "volume", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "high", + "columnName": "high", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "low", + "columnName": "low", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "open", + "columnName": "open", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "change", + "columnName": "change", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "bidPrice", + "columnName": "bid_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "askPrice", + "columnName": "ask_price", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "market_id" + ] + } + } + ], + "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, 'caa79a2cd9e2735f87b8b2af9c6eae2c')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/1.json b/app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/1.json new file mode 100644 index 0000000000..3bce55e8df --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/1.json @@ -0,0 +1,488 @@ +{ + "formatVersion": 1, + "database": { + "version": 1, + "identityHash": "493f3ae1a6dbe7ef005eb2662fe82a88", + "entities": [ + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `asset_key` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `precision` INTEGER NOT NULL, `kernel_asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `change_usd` TEXT NOT NULL, PRIMARY KEY(`wallet_id`, `asset_id`))", + "fields": [ + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "precision", + "columnName": "precision", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id", + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transaction_id` TEXT NOT NULL, `transaction_type` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `block_number` INTEGER NOT NULL, `sender` TEXT NOT NULL, `receiver` TEXT NOT NULL, `output_hash` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `transaction_at` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`transaction_id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "transaction_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionType", + "columnName": "transaction_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "blockNumber", + "columnName": "block_number", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "sender", + "columnName": "sender", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiver", + "columnName": "receiver", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputHash", + "columnName": "output_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionAt", + "columnName": "transaction_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transaction_id" + ] + }, + "indices": [ + { + "name": "index_transactions_transaction_at", + "unique": false, + "columnNames": [ + "transaction_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_transactions_transaction_at` ON `${TABLE_NAME}` (`transaction_at`)" + }, + { + "name": "index_transactions_transaction_type_asset_id", + "unique": false, + "columnNames": [ + "transaction_type", + "asset_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_transactions_transaction_type_asset_id` ON `${TABLE_NAME}` (`transaction_type`, `asset_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "wallets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `category` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`wallet_id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `wallet_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`wallet_id`, `asset_id`))", + "fields": [ + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id", + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hash` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `account` TEXT NOT NULL, `nonce` TEXT NOT NULL, `raw` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`hash`))", + "fields": [ + { + "fieldPath": "hash", + "columnName": "hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "account", + "columnName": "account", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "nonce", + "columnName": "nonce", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "raw", + "columnName": "raw", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hash" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_chain_id", + "unique": false, + "columnNames": [ + "chain_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_chain_id` ON `${TABLE_NAME}` (`chain_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "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, '493f3ae1a6dbe7ef005eb2662fe82a88')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/2.json b/app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/2.json new file mode 100644 index 0000000000..a286d68629 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/2.json @@ -0,0 +1,499 @@ +{ + "formatVersion": 1, + "database": { + "version": 2, + "identityHash": "4d306dc27e3a8b63814195f8814ef102", + "entities": [ + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `asset_key` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `precision` INTEGER NOT NULL, `kernel_asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `change_usd` TEXT NOT NULL, PRIMARY KEY(`wallet_id`, `asset_id`))", + "fields": [ + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "precision", + "columnName": "precision", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id", + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transaction_hash` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `address` TEXT NOT NULL, `transaction_type` TEXT NOT NULL, `status` TEXT NOT NULL, `block_number` INTEGER NOT NULL, `fee` TEXT NOT NULL, `senders` TEXT, `receivers` TEXT, `approvals` TEXT, `send_asset_id` TEXT, `receive_asset_id` TEXT, `transaction_at` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`transaction_hash`, `chain_id`, `address`))", + "fields": [ + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "address", + "columnName": "address", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionType", + "columnName": "transaction_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "blockNumber", + "columnName": "block_number", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "senders", + "columnName": "senders", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "approvals", + "columnName": "approvals", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sendAssetId", + "columnName": "send_asset_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "receiveAssetId", + "columnName": "receive_asset_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transactionAt", + "columnName": "transaction_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transaction_hash", + "chain_id", + "address" + ] + }, + "indices": [ + { + "name": "index_transactions_address_transaction_at", + "unique": false, + "columnNames": [ + "address", + "transaction_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_transactions_address_transaction_at` ON `${TABLE_NAME}` (`address`, `transaction_at`)" + }, + { + "name": "index_transactions_transaction_type_send_asset_id_receive_asset_id_transaction_at", + "unique": false, + "columnNames": [ + "transaction_type", + "send_asset_id", + "receive_asset_id", + "transaction_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_transactions_transaction_type_send_asset_id_receive_asset_id_transaction_at` ON `${TABLE_NAME}` (`transaction_type`, `send_asset_id`, `receive_asset_id`, `transaction_at`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "wallets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `category` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`wallet_id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `wallet_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`wallet_id`, `asset_id`))", + "fields": [ + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id", + "asset_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hash` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `account` TEXT NOT NULL, `nonce` TEXT NOT NULL, `raw` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`hash`))", + "fields": [ + { + "fieldPath": "hash", + "columnName": "hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "account", + "columnName": "account", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "nonce", + "columnName": "nonce", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "raw", + "columnName": "raw", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hash" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_chain_id", + "unique": false, + "columnNames": [ + "chain_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_chain_id` ON `${TABLE_NAME}` (`chain_id`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + }, + "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, '4d306dc27e3a8b63814195f8814ef102')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/3.json b/app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/3.json new file mode 100644 index 0000000000..f419cbcc8b --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/3.json @@ -0,0 +1,491 @@ +{ + "formatVersion": 1, + "database": { + "version": 3, + "identityHash": "41800bc47929c1bc813dc533df3216ad", + "entities": [ + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `asset_key` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `precision` INTEGER NOT NULL, `kernel_asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `level` INTEGER NOT NULL, PRIMARY KEY(`wallet_id`, `asset_id`))", + "fields": [ + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "precision", + "columnName": "precision", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "level", + "columnName": "level", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id", + "asset_id" + ] + } + }, + { + "tableName": "transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transaction_hash` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `address` TEXT NOT NULL, `transaction_type` TEXT NOT NULL, `status` TEXT NOT NULL, `block_number` INTEGER NOT NULL, `fee` TEXT NOT NULL, `senders` TEXT, `receivers` TEXT, `approvals` TEXT, `send_asset_id` TEXT, `receive_asset_id` TEXT, `transaction_at` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `level` INTEGER NOT NULL, PRIMARY KEY(`transaction_hash`, `chain_id`, `address`))", + "fields": [ + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "address", + "columnName": "address", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionType", + "columnName": "transaction_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "blockNumber", + "columnName": "block_number", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "senders", + "columnName": "senders", + "affinity": "TEXT" + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT" + }, + { + "fieldPath": "approvals", + "columnName": "approvals", + "affinity": "TEXT" + }, + { + "fieldPath": "sendAssetId", + "columnName": "send_asset_id", + "affinity": "TEXT" + }, + { + "fieldPath": "receiveAssetId", + "columnName": "receive_asset_id", + "affinity": "TEXT" + }, + { + "fieldPath": "transactionAt", + "columnName": "transaction_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "level", + "columnName": "level", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transaction_hash", + "chain_id", + "address" + ] + }, + "indices": [ + { + "name": "index_transactions_address_transaction_at", + "unique": false, + "columnNames": [ + "address", + "transaction_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_transactions_address_transaction_at` ON `${TABLE_NAME}` (`address`, `transaction_at`)" + }, + { + "name": "index_transactions_transaction_type_send_asset_id_receive_asset_id_transaction_at_level", + "unique": false, + "columnNames": [ + "transaction_type", + "send_asset_id", + "receive_asset_id", + "transaction_at", + "level" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_transactions_transaction_type_send_asset_id_receive_asset_id_transaction_at_level` ON `${TABLE_NAME}` (`transaction_type`, `send_asset_id`, `receive_asset_id`, `transaction_at`, `level`)" + } + ] + }, + { + "tableName": "wallets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `category` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`wallet_id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id" + ] + } + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `wallet_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + } + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`wallet_id`, `asset_id`))", + "fields": [ + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id", + "asset_id" + ] + } + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + } + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hash` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `account` TEXT NOT NULL, `nonce` TEXT NOT NULL, `raw` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`hash`))", + "fields": [ + { + "fieldPath": "hash", + "columnName": "hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "account", + "columnName": "account", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "nonce", + "columnName": "nonce", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "raw", + "columnName": "raw", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hash" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_chain_id", + "unique": false, + "columnNames": [ + "chain_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_chain_id` ON `${TABLE_NAME}` (`chain_id`)" + } + ] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + } + } + ], + "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, '41800bc47929c1bc813dc533df3216ad')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/4.json b/app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/4.json new file mode 100644 index 0000000000..7752e61cc3 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/4.json @@ -0,0 +1,496 @@ +{ + "formatVersion": 1, + "database": { + "version": 4, + "identityHash": "76d5ffded2efab680d437a8e47fd09ff", + "entities": [ + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `asset_key` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `precision` INTEGER NOT NULL, `kernel_asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `level` INTEGER NOT NULL, PRIMARY KEY(`wallet_id`, `asset_id`))", + "fields": [ + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "precision", + "columnName": "precision", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "level", + "columnName": "level", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id", + "asset_id" + ] + } + }, + { + "tableName": "transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transaction_hash` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `address` TEXT NOT NULL, `transaction_type` TEXT NOT NULL, `status` TEXT NOT NULL, `block_number` INTEGER NOT NULL, `fee` TEXT NOT NULL, `senders` TEXT, `receivers` TEXT, `approvals` TEXT, `send_asset_id` TEXT, `receive_asset_id` TEXT, `transaction_at` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `level` INTEGER NOT NULL, PRIMARY KEY(`transaction_hash`, `chain_id`, `address`))", + "fields": [ + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "address", + "columnName": "address", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionType", + "columnName": "transaction_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "blockNumber", + "columnName": "block_number", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "senders", + "columnName": "senders", + "affinity": "TEXT" + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT" + }, + { + "fieldPath": "approvals", + "columnName": "approvals", + "affinity": "TEXT" + }, + { + "fieldPath": "sendAssetId", + "columnName": "send_asset_id", + "affinity": "TEXT" + }, + { + "fieldPath": "receiveAssetId", + "columnName": "receive_asset_id", + "affinity": "TEXT" + }, + { + "fieldPath": "transactionAt", + "columnName": "transaction_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "level", + "columnName": "level", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transaction_hash", + "chain_id", + "address" + ] + }, + "indices": [ + { + "name": "index_transactions_address_transaction_at", + "unique": false, + "columnNames": [ + "address", + "transaction_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_transactions_address_transaction_at` ON `${TABLE_NAME}` (`address`, `transaction_at`)" + }, + { + "name": "index_transactions_transaction_type_send_asset_id_receive_asset_id_transaction_at_level", + "unique": false, + "columnNames": [ + "transaction_type", + "send_asset_id", + "receive_asset_id", + "transaction_at", + "level" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_transactions_transaction_type_send_asset_id_receive_asset_id_transaction_at_level` ON `${TABLE_NAME}` (`transaction_type`, `send_asset_id`, `receive_asset_id`, `transaction_at`, `level`)" + } + ] + }, + { + "tableName": "wallets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `category` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`wallet_id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id" + ] + } + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `wallet_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `path` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "path", + "columnName": "path", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + } + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`wallet_id`, `asset_id`))", + "fields": [ + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id", + "asset_id" + ] + } + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + } + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hash` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `account` TEXT NOT NULL, `nonce` TEXT NOT NULL, `raw` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`hash`))", + "fields": [ + { + "fieldPath": "hash", + "columnName": "hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "account", + "columnName": "account", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "nonce", + "columnName": "nonce", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "raw", + "columnName": "raw", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hash" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_chain_id", + "unique": false, + "columnNames": [ + "chain_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_chain_id` ON `${TABLE_NAME}` (`chain_id`)" + } + ] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + } + } + ], + "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, '76d5ffded2efab680d437a8e47fd09ff')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/5.json b/app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/5.json new file mode 100644 index 0000000000..29f4cb8700 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/5.json @@ -0,0 +1,629 @@ +{ + "formatVersion": 1, + "database": { + "version": 5, + "identityHash": "662b6a08f46965a96f42bb75c7a3567a", + "entities": [ + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `asset_key` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `precision` INTEGER NOT NULL, `kernel_asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `level` INTEGER NOT NULL, PRIMARY KEY(`wallet_id`, `asset_id`))", + "fields": [ + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "precision", + "columnName": "precision", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "level", + "columnName": "level", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id", + "asset_id" + ] + } + }, + { + "tableName": "transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transaction_hash` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `address` TEXT NOT NULL, `transaction_type` TEXT NOT NULL, `status` TEXT NOT NULL, `block_number` INTEGER NOT NULL, `fee` TEXT NOT NULL, `senders` TEXT, `receivers` TEXT, `approvals` TEXT, `send_asset_id` TEXT, `receive_asset_id` TEXT, `transaction_at` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `level` INTEGER NOT NULL, PRIMARY KEY(`transaction_hash`, `chain_id`, `address`))", + "fields": [ + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "address", + "columnName": "address", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionType", + "columnName": "transaction_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "blockNumber", + "columnName": "block_number", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "senders", + "columnName": "senders", + "affinity": "TEXT" + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT" + }, + { + "fieldPath": "approvals", + "columnName": "approvals", + "affinity": "TEXT" + }, + { + "fieldPath": "sendAssetId", + "columnName": "send_asset_id", + "affinity": "TEXT" + }, + { + "fieldPath": "receiveAssetId", + "columnName": "receive_asset_id", + "affinity": "TEXT" + }, + { + "fieldPath": "transactionAt", + "columnName": "transaction_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "level", + "columnName": "level", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transaction_hash", + "chain_id", + "address" + ] + }, + "indices": [ + { + "name": "index_transactions_address_transaction_at", + "unique": false, + "columnNames": [ + "address", + "transaction_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_transactions_address_transaction_at` ON `${TABLE_NAME}` (`address`, `transaction_at`)" + }, + { + "name": "index_transactions_transaction_type_send_asset_id_receive_asset_id_transaction_at_level", + "unique": false, + "columnNames": [ + "transaction_type", + "send_asset_id", + "receive_asset_id", + "transaction_at", + "level" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_transactions_transaction_type_send_asset_id_receive_asset_id_transaction_at_level` ON `${TABLE_NAME}` (`transaction_type`, `send_asset_id`, `receive_asset_id`, `transaction_at`, `level`)" + } + ] + }, + { + "tableName": "wallets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `category` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`wallet_id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id" + ] + } + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `wallet_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `path` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "path", + "columnName": "path", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + } + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`wallet_id`, `asset_id`))", + "fields": [ + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id", + "asset_id" + ] + } + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + } + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hash` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `account` TEXT NOT NULL, `nonce` TEXT NOT NULL, `raw` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`hash`))", + "fields": [ + { + "fieldPath": "hash", + "columnName": "hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "account", + "columnName": "account", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "nonce", + "columnName": "nonce", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "raw", + "columnName": "raw", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hash" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_chain_id", + "unique": false, + "columnNames": [ + "chain_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_chain_id` ON `${TABLE_NAME}` (`chain_id`)" + } + ] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + } + }, + { + "tableName": "orders", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`order_id` TEXT NOT NULL, `wallet_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `pay_asset_id` TEXT NOT NULL, `receive_asset_id` TEXT NOT NULL, `pay_amount` TEXT NOT NULL, `receive_amount` TEXT, `pay_trace_id` TEXT, `receive_trace_id` TEXT, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_type` TEXT NOT NULL, `fund_status` TEXT, `price` TEXT, `pending_amount` TEXT, `filled_receive_amount` TEXT, `expected_receive_amount` TEXT, `expired_at` TEXT, PRIMARY KEY(`order_id`))", + "fields": [ + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payAssetId", + "columnName": "pay_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiveAssetId", + "columnName": "receive_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payAmount", + "columnName": "pay_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiveAmount", + "columnName": "receive_amount", + "affinity": "TEXT" + }, + { + "fieldPath": "payTraceId", + "columnName": "pay_trace_id", + "affinity": "TEXT" + }, + { + "fieldPath": "receiveTraceId", + "columnName": "receive_trace_id", + "affinity": "TEXT" + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderType", + "columnName": "order_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fundStatus", + "columnName": "fund_status", + "affinity": "TEXT" + }, + { + "fieldPath": "price", + "columnName": "price", + "affinity": "TEXT" + }, + { + "fieldPath": "pendingAmount", + "columnName": "pending_amount", + "affinity": "TEXT" + }, + { + "fieldPath": "filledReceiveAmount", + "columnName": "filled_receive_amount", + "affinity": "TEXT" + }, + { + "fieldPath": "expectedReceiveAmount", + "columnName": "expected_receive_amount", + "affinity": "TEXT" + }, + { + "fieldPath": "expiredAt", + "columnName": "expired_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "order_id" + ] + }, + "indices": [ + { + "name": "index_orders_state_created_at", + "unique": false, + "columnNames": [ + "state", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_orders_state_created_at` ON `${TABLE_NAME}` (`state`, `created_at`)" + }, + { + "name": "index_orders_order_type_created_at", + "unique": false, + "columnNames": [ + "order_type", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_orders_order_type_created_at` ON `${TABLE_NAME}` (`order_type`, `created_at`)" + } + ] + } + ], + "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, '662b6a08f46965a96f42bb75c7a3567a')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/6.json b/app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/6.json new file mode 100644 index 0000000000..d20ae8ad7c --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/6.json @@ -0,0 +1,689 @@ +{ + "formatVersion": 1, + "database": { + "version": 6, + "identityHash": "8c24c0da25df8efc884656688c14115d", + "entities": [ + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `asset_key` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `precision` INTEGER NOT NULL, `kernel_asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `level` INTEGER NOT NULL, PRIMARY KEY(`wallet_id`, `asset_id`))", + "fields": [ + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "precision", + "columnName": "precision", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "level", + "columnName": "level", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id", + "asset_id" + ] + } + }, + { + "tableName": "transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transaction_hash` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `address` TEXT NOT NULL, `transaction_type` TEXT NOT NULL, `status` TEXT NOT NULL, `block_number` INTEGER NOT NULL, `fee` TEXT NOT NULL, `senders` TEXT, `receivers` TEXT, `approvals` TEXT, `send_asset_id` TEXT, `receive_asset_id` TEXT, `transaction_at` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `level` INTEGER NOT NULL, PRIMARY KEY(`transaction_hash`, `chain_id`, `address`))", + "fields": [ + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "address", + "columnName": "address", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionType", + "columnName": "transaction_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "blockNumber", + "columnName": "block_number", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "senders", + "columnName": "senders", + "affinity": "TEXT" + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT" + }, + { + "fieldPath": "approvals", + "columnName": "approvals", + "affinity": "TEXT" + }, + { + "fieldPath": "sendAssetId", + "columnName": "send_asset_id", + "affinity": "TEXT" + }, + { + "fieldPath": "receiveAssetId", + "columnName": "receive_asset_id", + "affinity": "TEXT" + }, + { + "fieldPath": "transactionAt", + "columnName": "transaction_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "level", + "columnName": "level", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transaction_hash", + "chain_id", + "address" + ] + }, + "indices": [ + { + "name": "index_transactions_address_transaction_at", + "unique": false, + "columnNames": [ + "address", + "transaction_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_transactions_address_transaction_at` ON `${TABLE_NAME}` (`address`, `transaction_at`)" + }, + { + "name": "index_transactions_transaction_type_send_asset_id_receive_asset_id_transaction_at_level", + "unique": false, + "columnNames": [ + "transaction_type", + "send_asset_id", + "receive_asset_id", + "transaction_at", + "level" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_transactions_transaction_type_send_asset_id_receive_asset_id_transaction_at_level` ON `${TABLE_NAME}` (`transaction_type`, `send_asset_id`, `receive_asset_id`, `transaction_at`, `level`)" + } + ] + }, + { + "tableName": "wallets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `category` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`wallet_id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id" + ] + } + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `wallet_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `path` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "path", + "columnName": "path", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + } + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`wallet_id`, `asset_id`))", + "fields": [ + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id", + "asset_id" + ] + } + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + } + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hash` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `account` TEXT NOT NULL, `nonce` TEXT NOT NULL, `raw` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`hash`))", + "fields": [ + { + "fieldPath": "hash", + "columnName": "hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "account", + "columnName": "account", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "nonce", + "columnName": "nonce", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "raw", + "columnName": "raw", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hash" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_chain_id", + "unique": false, + "columnNames": [ + "chain_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_chain_id` ON `${TABLE_NAME}` (`chain_id`)" + } + ] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + } + }, + { + "tableName": "orders", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`order_id` TEXT NOT NULL, `wallet_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `pay_asset_id` TEXT NOT NULL, `receive_asset_id` TEXT NOT NULL, `pay_amount` TEXT NOT NULL, `receive_amount` TEXT, `pay_trace_id` TEXT, `receive_trace_id` TEXT, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_type` TEXT NOT NULL, `fund_status` TEXT, `price` TEXT, `pending_amount` TEXT, `filled_receive_amount` TEXT, `expected_receive_amount` TEXT, `expired_at` TEXT, PRIMARY KEY(`order_id`))", + "fields": [ + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payAssetId", + "columnName": "pay_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiveAssetId", + "columnName": "receive_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payAmount", + "columnName": "pay_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiveAmount", + "columnName": "receive_amount", + "affinity": "TEXT" + }, + { + "fieldPath": "payTraceId", + "columnName": "pay_trace_id", + "affinity": "TEXT" + }, + { + "fieldPath": "receiveTraceId", + "columnName": "receive_trace_id", + "affinity": "TEXT" + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderType", + "columnName": "order_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fundStatus", + "columnName": "fund_status", + "affinity": "TEXT" + }, + { + "fieldPath": "price", + "columnName": "price", + "affinity": "TEXT" + }, + { + "fieldPath": "pendingAmount", + "columnName": "pending_amount", + "affinity": "TEXT" + }, + { + "fieldPath": "filledReceiveAmount", + "columnName": "filled_receive_amount", + "affinity": "TEXT" + }, + { + "fieldPath": "expectedReceiveAmount", + "columnName": "expected_receive_amount", + "affinity": "TEXT" + }, + { + "fieldPath": "expiredAt", + "columnName": "expired_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "order_id" + ] + }, + "indices": [ + { + "name": "index_orders_state_created_at", + "unique": false, + "columnNames": [ + "state", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_orders_state_created_at` ON `${TABLE_NAME}` (`state`, `created_at`)" + }, + { + "name": "index_orders_order_type_created_at", + "unique": false, + "columnNames": [ + "order_type", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_orders_order_type_created_at` ON `${TABLE_NAME}` (`order_type`, `created_at`)" + } + ] + }, + { + "tableName": "safe_wallets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `role` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `address` TEXT NOT NULL, `url` TEXT NOT NULL, PRIMARY KEY(`wallet_id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "safeRole", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "safeChainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "safeAddress", + "columnName": "address", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "safeUrl", + "columnName": "url", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id" + ] + } + } + ], + "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, '8c24c0da25df8efc884656688c14115d')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/7.json b/app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/7.json new file mode 100644 index 0000000000..80278de74b --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.WalletDatabase/7.json @@ -0,0 +1,767 @@ +{ + "formatVersion": 1, + "database": { + "version": 7, + "identityHash": "c511f5772cf18183bb2b6dbfd19a5508", + "entities": [ + { + "tableName": "tokens", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `asset_key` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `precision` INTEGER NOT NULL, `kernel_asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `level` INTEGER NOT NULL, PRIMARY KEY(`wallet_id`, `asset_id`))", + "fields": [ + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetKey", + "columnName": "asset_key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "precision", + "columnName": "precision", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "kernelAssetId", + "columnName": "kernel_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "balance", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "priceUsd", + "columnName": "price_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "changeUsd", + "columnName": "change_usd", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "level", + "columnName": "level", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id", + "asset_id" + ] + } + }, + { + "tableName": "transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`transaction_hash` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `address` TEXT NOT NULL, `transaction_type` TEXT NOT NULL, `status` TEXT NOT NULL, `block_number` INTEGER NOT NULL, `fee` TEXT NOT NULL, `senders` TEXT, `receivers` TEXT, `approvals` TEXT, `send_asset_id` TEXT, `receive_asset_id` TEXT, `transaction_at` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `level` INTEGER NOT NULL, PRIMARY KEY(`transaction_hash`, `chain_id`, `address`))", + "fields": [ + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "address", + "columnName": "address", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionType", + "columnName": "transaction_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "blockNumber", + "columnName": "block_number", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "fee", + "columnName": "fee", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "senders", + "columnName": "senders", + "affinity": "TEXT" + }, + { + "fieldPath": "receivers", + "columnName": "receivers", + "affinity": "TEXT" + }, + { + "fieldPath": "approvals", + "columnName": "approvals", + "affinity": "TEXT" + }, + { + "fieldPath": "sendAssetId", + "columnName": "send_asset_id", + "affinity": "TEXT" + }, + { + "fieldPath": "receiveAssetId", + "columnName": "receive_asset_id", + "affinity": "TEXT" + }, + { + "fieldPath": "transactionAt", + "columnName": "transaction_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "level", + "columnName": "level", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "transaction_hash", + "chain_id", + "address" + ] + }, + "indices": [ + { + "name": "index_transactions_address_transaction_at", + "unique": false, + "columnNames": [ + "address", + "transaction_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_transactions_address_transaction_at` ON `${TABLE_NAME}` (`address`, `transaction_at`)" + }, + { + "name": "index_transactions_transaction_type_send_asset_id_receive_asset_id_transaction_at_level", + "unique": false, + "columnNames": [ + "transaction_type", + "send_asset_id", + "receive_asset_id", + "transaction_at", + "level" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_transactions_transaction_type_send_asset_id_receive_asset_id_transaction_at_level` ON `${TABLE_NAME}` (`transaction_type`, `send_asset_id`, `receive_asset_id`, `transaction_at`, `level`)" + } + ] + }, + { + "tableName": "wallets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `category` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`wallet_id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id" + ] + } + }, + { + "tableName": "addresses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`address_id` TEXT NOT NULL, `wallet_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `path` TEXT, `created_at` TEXT NOT NULL, PRIMARY KEY(`address_id`))", + "fields": [ + { + "fieldPath": "addressId", + "columnName": "address_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "destination", + "columnName": "destination", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "path", + "columnName": "path", + "affinity": "TEXT" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "address_id" + ] + } + }, + { + "tableName": "tokens_extra", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `hidden` INTEGER, PRIMARY KEY(`wallet_id`, `asset_id`))", + "fields": [ + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "hidden", + "columnName": "hidden", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id", + "asset_id" + ] + } + }, + { + "tableName": "chains", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, PRIMARY KEY(`chain_id`))", + "fields": [ + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iconUrl", + "columnName": "icon_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "threshold", + "columnName": "threshold", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "chain_id" + ] + } + }, + { + "tableName": "raw_transactions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`hash` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `account` TEXT NOT NULL, `nonce` TEXT NOT NULL, `raw` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`hash`))", + "fields": [ + { + "fieldPath": "hash", + "columnName": "hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "chainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "account", + "columnName": "account", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "nonce", + "columnName": "nonce", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "raw", + "columnName": "raw", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "hash" + ] + }, + "indices": [ + { + "name": "index_raw_transactions_chain_id", + "unique": false, + "columnNames": [ + "chain_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_raw_transactions_chain_id` ON `${TABLE_NAME}` (`chain_id`)" + } + ] + }, + { + "tableName": "properties", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", + "fields": [ + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "key" + ] + } + }, + { + "tableName": "orders", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`order_id` TEXT NOT NULL, `wallet_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `pay_asset_id` TEXT NOT NULL, `receive_asset_id` TEXT NOT NULL, `pay_amount` TEXT NOT NULL, `receive_amount` TEXT, `pay_trace_id` TEXT, `receive_trace_id` TEXT, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_type` TEXT NOT NULL, `fund_status` TEXT, `price` TEXT, `pending_amount` TEXT, `filled_receive_amount` TEXT, `expected_receive_amount` TEXT, `expired_at` TEXT, PRIMARY KEY(`order_id`))", + "fields": [ + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "walletId", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payAssetId", + "columnName": "pay_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiveAssetId", + "columnName": "receive_asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "payAmount", + "columnName": "pay_amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "receiveAmount", + "columnName": "receive_amount", + "affinity": "TEXT" + }, + { + "fieldPath": "payTraceId", + "columnName": "pay_trace_id", + "affinity": "TEXT" + }, + { + "fieldPath": "receiveTraceId", + "columnName": "receive_trace_id", + "affinity": "TEXT" + }, + { + "fieldPath": "state", + "columnName": "state", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderType", + "columnName": "order_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fundStatus", + "columnName": "fund_status", + "affinity": "TEXT" + }, + { + "fieldPath": "price", + "columnName": "price", + "affinity": "TEXT" + }, + { + "fieldPath": "pendingAmount", + "columnName": "pending_amount", + "affinity": "TEXT" + }, + { + "fieldPath": "filledReceiveAmount", + "columnName": "filled_receive_amount", + "affinity": "TEXT" + }, + { + "fieldPath": "expectedReceiveAmount", + "columnName": "expected_receive_amount", + "affinity": "TEXT" + }, + { + "fieldPath": "expiredAt", + "columnName": "expired_at", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "order_id" + ] + }, + "indices": [ + { + "name": "index_orders_state_created_at", + "unique": false, + "columnNames": [ + "state", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_orders_state_created_at` ON `${TABLE_NAME}` (`state`, `created_at`)" + }, + { + "name": "index_orders_order_type_created_at", + "unique": false, + "columnNames": [ + "order_type", + "created_at" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_orders_order_type_created_at` ON `${TABLE_NAME}` (`order_type`, `created_at`)" + } + ] + }, + { + "tableName": "safe_wallets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`wallet_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `role` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `address` TEXT NOT NULL, `url` TEXT NOT NULL, PRIMARY KEY(`wallet_id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "wallet_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "safeRole", + "columnName": "role", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "safeChainId", + "columnName": "chain_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "safeAddress", + "columnName": "address", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "safeUrl", + "columnName": "url", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "wallet_id" + ] + } + }, + { + "tableName": "outputs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`output_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `amount` TEXT NOT NULL, `address` TEXT NOT NULL, `pubkey_hex` TEXT NOT NULL, `pubkey_type` TEXT NOT NULL, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`output_id`))", + "fields": [ + { + "fieldPath": "outputId", + "columnName": "output_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "assetId", + "columnName": "asset_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "transactionHash", + "columnName": "transaction_hash", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "outputIndex", + "columnName": "output_index", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "address", + "columnName": "address", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pubkeyHex", + "columnName": "pubkey_hex", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "pubkeyType", + "columnName": "pubkey_type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "output_id" + ] + } + } + ], + "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, 'c511f5772cf18183bb2b6dbfd19a5508')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.db.pending.PendingDataBaseImp/1.json b/app/schemas/otherChannel/one.mixin.android.db.pending.PendingDataBaseImp/1.json new file mode 100644 index 0000000000..a352913bf6 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.db.pending.PendingDataBaseImp/1.json @@ -0,0 +1,336 @@ +{ + "formatVersion": 1, + "database": { + "version": 1, + "identityHash": "16bac394d67f08c706d789aba47251b3", + "entities": [ + { + "tableName": "flood_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`message_id` TEXT NOT NULL, `data` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "message_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "pending_messages", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `category` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_mime_type` TEXT, `media_size` INTEGER, `media_duration` TEXT, `media_width` INTEGER, `media_height` INTEGER, `media_hash` TEXT, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_status` TEXT, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `action` TEXT, `participant_id` TEXT, `snapshot_id` TEXT, `hyperlink` TEXT, `name` TEXT, `album_id` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `media_waveform` BLOB, `media_mine_type` TEXT, `quote_message_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "messageId", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaUrl", + "columnName": "media_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaMimeType", + "columnName": "media_mime_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaSize", + "columnName": "media_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaDuration", + "columnName": "media_duration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWidth", + "columnName": "media_width", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHeight", + "columnName": "media_height", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "mediaHash", + "columnName": "media_hash", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbImage", + "columnName": "thumb_image", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "thumbUrl", + "columnName": "thumb_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaKey", + "columnName": "media_key", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaDigest", + "columnName": "media_digest", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaStatus", + "columnName": "media_status", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "participantId", + "columnName": "participant_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "snapshotId", + "columnName": "snapshot_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "hyperlink", + "columnName": "hyperlink", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "stickerId", + "columnName": "sticker_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "sharedUserId", + "columnName": "shared_user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mediaWaveform", + "columnName": "media_waveform", + "affinity": "BLOB", + "notNull": false + }, + { + "fieldPath": "mediaMineType", + "columnName": "media_mine_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteMessageId", + "columnName": "quote_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "quoteContent", + "columnName": "quote_content", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "caption", + "columnName": "caption", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "jobs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`job_id` TEXT NOT NULL, `action` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_id` INTEGER, `priority` INTEGER NOT NULL, `user_id` TEXT, `blaze_message` TEXT, `conversation_id` TEXT, `resend_message_id` TEXT, `run_count` INTEGER NOT NULL, PRIMARY KEY(`job_id`))", + "fields": [ + { + "fieldPath": "jobId", + "columnName": "job_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "orderId", + "columnName": "order_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "priority", + "columnName": "priority", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "blazeMessage", + "columnName": "blaze_message", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "resendMessageId", + "columnName": "resend_message_id", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "runCount", + "columnName": "run_count", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "job_id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_jobs_action", + "unique": false, + "columnNames": [ + "action" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `${TABLE_NAME}` (`action`)" + } + ], + "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, '16bac394d67f08c706d789aba47251b3')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/otherChannel/one.mixin.android.fts.FtsDatabase/1.json b/app/schemas/otherChannel/one.mixin.android.fts.FtsDatabase/1.json new file mode 100644 index 0000000000..c04d25e248 --- /dev/null +++ b/app/schemas/otherChannel/one.mixin.android.fts.FtsDatabase/1.json @@ -0,0 +1,119 @@ +{ + "formatVersion": 1, + "database": { + "version": 1, + "identityHash": "8692359c65483e203c3575842524bab4", + "entities": [ + { + "ftsVersion": "FTS4", + "ftsOptions": { + "tokenizer": "unicode61", + "tokenizerArgs": [], + "contentTable": "", + "languageIdColumnName": "", + "matchInfo": "FTS4", + "notIndexedColumns": [], + "prefixSizes": [], + "preferredOrder": "ASC" + }, + "contentSyncTriggers": [], + "tableName": "messages_fts", + "createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`content` TEXT NOT NULL, tokenize=unicode61)", + "fields": [ + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "messages_metas", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`doc_id` INTEGER NOT NULL, `message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `category` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", + "fields": [ + { + "fieldPath": "docId", + "columnName": "doc_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "messageId", + "columnName": "message_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "conversationId", + "columnName": "conversation_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "user_id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "message_id" + ] + }, + "indices": [ + { + "name": "index_messages_metas_doc_id_created_at", + "unique": false, + "columnNames": [ + "doc_id", + "created_at" + ], + "orders": [ + "DESC", + "DESC" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_metas_doc_id_created_at` ON `${TABLE_NAME}` (`doc_id` DESC, `created_at` DESC)" + }, + { + "name": "index_messages_metas_conversation_id_user_id_category", + "unique": false, + "columnNames": [ + "conversation_id", + "user_id", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_metas_conversation_id_user_id_category` ON `${TABLE_NAME}` (`conversation_id`, `user_id`, `category`)" + } + ], + "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, '8692359c65483e203c3575842524bab4')" + ] + } +} \ No newline at end of file diff --git a/app/src/androidTest/java/one/mixin/android/db/BaseMigrationTest.kt b/app/src/androidTest/java/one/mixin/android/db/BaseMigrationTest.kt index 368c19a166..d7ad6a9cbd 100644 --- a/app/src/androidTest/java/one/mixin/android/db/BaseMigrationTest.kt +++ b/app/src/androidTest/java/one/mixin/android/db/BaseMigrationTest.kt @@ -1,7 +1,7 @@ package one.mixin.android.db -import androidx.room.testing.MigrationTestHelper -import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory +import androidx.room3.testing.MigrationTestHelper +import androidx.sqlite.driver.AndroidSQLiteDriver import androidx.test.platform.app.InstrumentationRegistry import one.mixin.android.Constants import org.junit.After @@ -14,8 +14,9 @@ open class BaseMigrationTest { val migrationTestHelper = MigrationTestHelper( InstrumentationRegistry.getInstrumentation(), - MixinDatabase::class.java.canonicalName, - FrameworkSQLiteOpenHelperFactory(), + InstrumentationRegistry.getInstrumentation().targetContext.getDatabasePath(Constants.DataBase.DB_NAME), + AndroidSQLiteDriver(), + MixinDatabase::class, ) @Before diff --git a/app/src/androidTest/java/one/mixin/android/db/MigrationTestHelperCompat.kt b/app/src/androidTest/java/one/mixin/android/db/MigrationTestHelperCompat.kt new file mode 100644 index 0000000000..c08f2d6a99 --- /dev/null +++ b/app/src/androidTest/java/one/mixin/android/db/MigrationTestHelperCompat.kt @@ -0,0 +1,18 @@ +package one.mixin.android.db + +import androidx.room3.migration.Migration +import androidx.room3.testing.MigrationTestHelper +import androidx.sqlite.SQLiteConnection +import kotlinx.coroutines.runBlocking + +fun MigrationTestHelper.createDatabase( + name: String, + version: Int, +): SQLiteConnection = runBlocking { createDatabase(version) } + +fun MigrationTestHelper.runMigrationsAndValidate( + name: String, + version: Int, + validateDroppedTables: Boolean, + vararg migrations: Migration, +): SQLiteConnection = runBlocking { runMigrationsAndValidate(version, migrations.toList()) } diff --git a/app/src/androidTest/java/one/mixin/android/db/PerpsMigrationTest.kt b/app/src/androidTest/java/one/mixin/android/db/PerpsMigrationTest.kt index 3c75539c1d..27e14e2f49 100644 --- a/app/src/androidTest/java/one/mixin/android/db/PerpsMigrationTest.kt +++ b/app/src/androidTest/java/one/mixin/android/db/PerpsMigrationTest.kt @@ -1,10 +1,12 @@ package one.mixin.android.db -import androidx.room.testing.MigrationTestHelper -import androidx.sqlite.db.SupportSQLiteDatabase -import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory +import androidx.room3.testing.MigrationTestHelper +import androidx.sqlite.SQLiteConnection +import androidx.sqlite.driver.AndroidSQLiteDriver import androidx.test.platform.app.InstrumentationRegistry import one.mixin.android.Constants +import one.mixin.android.db.datasource.execSQL +import one.mixin.android.db.datasource.query import org.junit.Assert.assertEquals import org.junit.Assert.assertTrue import org.junit.Rule @@ -16,8 +18,9 @@ class PerpsMigrationTest { val migrationTestHelper = MigrationTestHelper( InstrumentationRegistry.getInstrumentation(), - PerpsDatabase::class.java.canonicalName, - FrameworkSQLiteOpenHelperFactory(), + InstrumentationRegistry.getInstrumentation().targetContext.getDatabasePath(Constants.DataBase.PERPS_DB_NAME), + AndroidSQLiteDriver(), + PerpsDatabase::class, ) @Test @@ -139,7 +142,7 @@ class PerpsMigrationTest { } } - private fun SupportSQLiteDatabase.insertMarketV2() { + private fun SQLiteConnection.insertMarketV2() { execSQL( """ INSERT INTO markets ( @@ -156,7 +159,7 @@ class PerpsMigrationTest { ) } - private fun SupportSQLiteDatabase.insertPositionV2() { + private fun SQLiteConnection.insertPositionV2() { execSQL( """ INSERT INTO positions ( @@ -172,7 +175,7 @@ class PerpsMigrationTest { ) } - private fun SupportSQLiteDatabase.insertPositionHistoryV3() { + private fun SQLiteConnection.insertPositionHistoryV3() { execSQL( """ INSERT INTO position_histories ( @@ -186,7 +189,7 @@ class PerpsMigrationTest { ) } - private fun SupportSQLiteDatabase.insertOrderV4() { + private fun SQLiteConnection.insertOrderV4() { execSQL( """ INSERT INTO perps_orders ( diff --git a/app/src/main/java/one/mixin/android/MixinApplication.kt b/app/src/main/java/one/mixin/android/MixinApplication.kt index bd8ddb13b7..444e062931 100644 --- a/app/src/main/java/one/mixin/android/MixinApplication.kt +++ b/app/src/main/java/one/mixin/android/MixinApplication.kt @@ -43,6 +43,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.delay import kotlinx.coroutines.launch +import kotlinx.coroutines.runBlocking import kotlinx.coroutines.withContext import okhttp3.OkHttpClient import one.mixin.android.Constants.Account.PREF_APP_AUTH @@ -396,7 +397,9 @@ open class MixinApplication : identityNumber?.let { scopedIdentity -> MixinDatabase.getDatabase(this, scopedIdentity).participantSessionDao().clearKey(sessionId) } - SignalDatabase.getDatabase(this).clearAllTables() + runBlocking { + SignalDatabase.getDatabase(this@MixinApplication).clearAllTables() + } removeValueFromEncryptedPreferences(this, Constants.Tip.MNEMONIC) } diff --git a/app/src/main/java/one/mixin/android/api/response/MembershipOrder.kt b/app/src/main/java/one/mixin/android/api/response/MembershipOrder.kt index 4b1dff2104..af562430de 100644 --- a/app/src/main/java/one/mixin/android/api/response/MembershipOrder.kt +++ b/app/src/main/java/one/mixin/android/api/response/MembershipOrder.kt @@ -1,18 +1,18 @@ package one.mixin.android.api.response import android.os.Parcelable -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.Index -import androidx.room.PrimaryKey -import androidx.room.TypeConverters +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.Index +import androidx.room3.PrimaryKey +import androidx.room3.ColumnTypeConverters import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize import one.mixin.android.db.converter.FiatOrderConverter @Parcelize @Entity(tableName = "membership_orders", indices = [Index(value = ["created_at"])]) -@TypeConverters(FiatOrderConverter::class) +@ColumnTypeConverters(FiatOrderConverter::class) data class MembershipOrder( @SerializedName("order_id") @PrimaryKey diff --git a/app/src/main/java/one/mixin/android/api/response/perps/PerpsMarket.kt b/app/src/main/java/one/mixin/android/api/response/perps/PerpsMarket.kt index 941a1d15df..f8fc55e8ff 100644 --- a/app/src/main/java/one/mixin/android/api/response/perps/PerpsMarket.kt +++ b/app/src/main/java/one/mixin/android/api/response/perps/PerpsMarket.kt @@ -1,14 +1,14 @@ package one.mixin.android.api.response.perps -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey -import androidx.room.TypeConverters +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey +import androidx.room3.ColumnTypeConverters import com.google.gson.annotations.SerializedName import one.mixin.android.db.converter.ListConverter @Entity(tableName = "markets") -@TypeConverters(ListConverter::class) +@ColumnTypeConverters(ListConverter::class) data class PerpsMarket( @PrimaryKey @SerializedName("market_id") @ColumnInfo(name = "market_id") diff --git a/app/src/main/java/one/mixin/android/api/response/perps/PerpsOrder.kt b/app/src/main/java/one/mixin/android/api/response/perps/PerpsOrder.kt index 3509737a0d..da4128de6a 100644 --- a/app/src/main/java/one/mixin/android/api/response/perps/PerpsOrder.kt +++ b/app/src/main/java/one/mixin/android/api/response/perps/PerpsOrder.kt @@ -1,9 +1,9 @@ package one.mixin.android.api.response.perps import android.os.Parcelable -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/one/mixin/android/api/response/perps/PerpsOrderItem.kt b/app/src/main/java/one/mixin/android/api/response/perps/PerpsOrderItem.kt index 1d323b4368..297a7270c6 100644 --- a/app/src/main/java/one/mixin/android/api/response/perps/PerpsOrderItem.kt +++ b/app/src/main/java/one/mixin/android/api/response/perps/PerpsOrderItem.kt @@ -2,7 +2,7 @@ package one.mixin.android.api.response.perps import android.os.Parcelable import androidx.compose.runtime.Immutable -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/one/mixin/android/api/response/perps/PerpsPosition.kt b/app/src/main/java/one/mixin/android/api/response/perps/PerpsPosition.kt index 398f4a96df..bb37914db4 100644 --- a/app/src/main/java/one/mixin/android/api/response/perps/PerpsPosition.kt +++ b/app/src/main/java/one/mixin/android/api/response/perps/PerpsPosition.kt @@ -1,9 +1,9 @@ package one.mixin.android.api.response.perps import android.os.Parcelable -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/one/mixin/android/api/response/perps/PerpsPositionItem.kt b/app/src/main/java/one/mixin/android/api/response/perps/PerpsPositionItem.kt index a70da95e91..f0ee8e0110 100644 --- a/app/src/main/java/one/mixin/android/api/response/perps/PerpsPositionItem.kt +++ b/app/src/main/java/one/mixin/android/api/response/perps/PerpsPositionItem.kt @@ -2,7 +2,7 @@ package one.mixin.android.api.response.perps import android.os.Parcelable import androidx.compose.runtime.Immutable -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/one/mixin/android/api/response/web3/WalletOutput.kt b/app/src/main/java/one/mixin/android/api/response/web3/WalletOutput.kt index 34e2ab5f67..e60200b9ce 100644 --- a/app/src/main/java/one/mixin/android/api/response/web3/WalletOutput.kt +++ b/app/src/main/java/one/mixin/android/api/response/web3/WalletOutput.kt @@ -1,8 +1,8 @@ package one.mixin.android.api.response.web3 -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName @Entity(tableName = "outputs") diff --git a/app/src/main/java/one/mixin/android/crypto/db/IdentityDao.kt b/app/src/main/java/one/mixin/android/crypto/db/IdentityDao.kt index edddd3c25e..779f2c9415 100644 --- a/app/src/main/java/one/mixin/android/crypto/db/IdentityDao.kt +++ b/app/src/main/java/one/mixin/android/crypto/db/IdentityDao.kt @@ -1,8 +1,8 @@ package one.mixin.android.crypto.db -import androidx.room.Dao -import androidx.room.Query -import androidx.room.Transaction +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.Transaction import one.mixin.android.crypto.vo.Identity import one.mixin.android.db.BaseDao diff --git a/app/src/main/java/one/mixin/android/crypto/db/PreKeyDao.kt b/app/src/main/java/one/mixin/android/crypto/db/PreKeyDao.kt index 2142ab4ac1..de5e8ad85f 100644 --- a/app/src/main/java/one/mixin/android/crypto/db/PreKeyDao.kt +++ b/app/src/main/java/one/mixin/android/crypto/db/PreKeyDao.kt @@ -1,8 +1,8 @@ package one.mixin.android.crypto.db -import androidx.room.Dao -import androidx.room.Query -import androidx.room.Transaction +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.Transaction import one.mixin.android.crypto.vo.PreKey import one.mixin.android.db.BaseDao diff --git a/app/src/main/java/one/mixin/android/crypto/db/RatchetSenderKeyDao.kt b/app/src/main/java/one/mixin/android/crypto/db/RatchetSenderKeyDao.kt index 5aa77ea5a8..455561bd7c 100644 --- a/app/src/main/java/one/mixin/android/crypto/db/RatchetSenderKeyDao.kt +++ b/app/src/main/java/one/mixin/android/crypto/db/RatchetSenderKeyDao.kt @@ -1,8 +1,8 @@ package one.mixin.android.crypto.db -import androidx.room.Dao -import androidx.room.Query -import androidx.room.Transaction +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.Transaction import one.mixin.android.crypto.vo.RatchetSenderKey import one.mixin.android.db.BaseDao diff --git a/app/src/main/java/one/mixin/android/crypto/db/SenderKeyDao.kt b/app/src/main/java/one/mixin/android/crypto/db/SenderKeyDao.kt index 06a946dcca..2035614432 100644 --- a/app/src/main/java/one/mixin/android/crypto/db/SenderKeyDao.kt +++ b/app/src/main/java/one/mixin/android/crypto/db/SenderKeyDao.kt @@ -1,8 +1,8 @@ package one.mixin.android.crypto.db -import androidx.room.Dao -import androidx.room.Query -import androidx.room.Transaction +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.Transaction import one.mixin.android.crypto.vo.SenderKey import one.mixin.android.db.BaseDao diff --git a/app/src/main/java/one/mixin/android/crypto/db/SessionDao.kt b/app/src/main/java/one/mixin/android/crypto/db/SessionDao.kt index ceb382b439..48799c0223 100644 --- a/app/src/main/java/one/mixin/android/crypto/db/SessionDao.kt +++ b/app/src/main/java/one/mixin/android/crypto/db/SessionDao.kt @@ -1,8 +1,8 @@ package one.mixin.android.crypto.db -import androidx.room.Dao -import androidx.room.Query -import androidx.room.Transaction +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.Transaction import one.mixin.android.crypto.vo.Session import one.mixin.android.db.BaseDao diff --git a/app/src/main/java/one/mixin/android/crypto/db/SignalDatabase.kt b/app/src/main/java/one/mixin/android/crypto/db/SignalDatabase.kt index c87c0cf2de..525db9646b 100644 --- a/app/src/main/java/one/mixin/android/crypto/db/SignalDatabase.kt +++ b/app/src/main/java/one/mixin/android/crypto/db/SignalDatabase.kt @@ -1,17 +1,19 @@ package one.mixin.android.crypto.db import android.content.Context -import androidx.room.Database -import androidx.room.Room -import androidx.room.RoomDatabase -import androidx.room.migration.Migration -import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room3.Database +import androidx.room3.Room +import androidx.room3.RoomDatabase +import androidx.room3.migration.Migration +import androidx.sqlite.SQLiteConnection +import androidx.sqlite.driver.AndroidSQLiteDriver import one.mixin.android.crypto.vo.Identity import one.mixin.android.crypto.vo.PreKey import one.mixin.android.crypto.vo.RatchetSenderKey import one.mixin.android.crypto.vo.SenderKey import one.mixin.android.crypto.vo.Session import one.mixin.android.crypto.vo.SignedPreKey +import one.mixin.android.db.datasource.execSQL @Database( entities = [ @@ -42,7 +44,7 @@ abstract class SignalDatabase : RoomDatabase() { private val MIGRATION_2_3: Migration = object : Migration(2, 3) { - override fun migrate(database: SupportSQLiteDatabase) { + override suspend fun migrate(database: SQLiteConnection) { database.execSQL("DROP INDEX IF EXISTS index_sessions_address") database.execSQL("ALTER TABLE sessions ADD COLUMN device INTEGER NOT NULL DEFAULT 1") database.execSQL("CREATE UNIQUE INDEX index_sessions_address_device ON sessions (address, device)") @@ -56,6 +58,7 @@ abstract class SignalDatabase : RoomDatabase() { if (INSTANCE == null) { INSTANCE = Room.databaseBuilder(context, SignalDatabase::class.java, "signal.db") + .setDriver(AndroidSQLiteDriver()) .addMigrations(MIGRATION_2_3) .addCallback(CALLBACK) .build() diff --git a/app/src/main/java/one/mixin/android/crypto/db/SignedPreKeyDao.kt b/app/src/main/java/one/mixin/android/crypto/db/SignedPreKeyDao.kt index 28e0bfa899..45ea313492 100644 --- a/app/src/main/java/one/mixin/android/crypto/db/SignedPreKeyDao.kt +++ b/app/src/main/java/one/mixin/android/crypto/db/SignedPreKeyDao.kt @@ -1,8 +1,8 @@ package one.mixin.android.crypto.db -import androidx.room.Dao -import androidx.room.Query -import androidx.room.Transaction +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.Transaction import one.mixin.android.crypto.vo.SignedPreKey import one.mixin.android.db.BaseDao diff --git a/app/src/main/java/one/mixin/android/crypto/vo/Identity.kt b/app/src/main/java/one/mixin/android/crypto/vo/Identity.kt index fcb5a5cd24..9609682d32 100644 --- a/app/src/main/java/one/mixin/android/crypto/vo/Identity.kt +++ b/app/src/main/java/one/mixin/android/crypto/vo/Identity.kt @@ -1,10 +1,10 @@ package one.mixin.android.crypto.vo -import androidx.room.ColumnInfo -import androidx.room.ColumnInfo.Companion.BLOB -import androidx.room.Entity -import androidx.room.Index -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.ColumnInfo.Companion.BLOB +import androidx.room3.Entity +import androidx.room3.Index +import androidx.room3.PrimaryKey import org.whispersystems.libsignal.IdentityKey import org.whispersystems.libsignal.IdentityKeyPair import org.whispersystems.libsignal.ecc.Curve diff --git a/app/src/main/java/one/mixin/android/crypto/vo/PreKey.kt b/app/src/main/java/one/mixin/android/crypto/vo/PreKey.kt index ba6fe3876f..7b5c292957 100644 --- a/app/src/main/java/one/mixin/android/crypto/vo/PreKey.kt +++ b/app/src/main/java/one/mixin/android/crypto/vo/PreKey.kt @@ -1,10 +1,10 @@ package one.mixin.android.crypto.vo -import androidx.room.ColumnInfo -import androidx.room.ColumnInfo.Companion.BLOB -import androidx.room.Entity -import androidx.room.Index -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.ColumnInfo.Companion.BLOB +import androidx.room3.Entity +import androidx.room3.Index +import androidx.room3.PrimaryKey @Entity(tableName = "prekeys", indices = [(Index(value = ["prekey_id"], unique = true))]) class PreKey( diff --git a/app/src/main/java/one/mixin/android/crypto/vo/RatchetSenderKey.kt b/app/src/main/java/one/mixin/android/crypto/vo/RatchetSenderKey.kt index 26d0f5bc96..2d1807bb4f 100644 --- a/app/src/main/java/one/mixin/android/crypto/vo/RatchetSenderKey.kt +++ b/app/src/main/java/one/mixin/android/crypto/vo/RatchetSenderKey.kt @@ -1,7 +1,7 @@ package one.mixin.android.crypto.vo -import androidx.room.ColumnInfo -import androidx.room.Entity +import androidx.room3.ColumnInfo +import androidx.room3.Entity @Entity(tableName = "ratchet_sender_keys", primaryKeys = ["group_id", "sender_id"]) class RatchetSenderKey( diff --git a/app/src/main/java/one/mixin/android/crypto/vo/SenderKey.kt b/app/src/main/java/one/mixin/android/crypto/vo/SenderKey.kt index 9296a011f6..15e4c62f40 100644 --- a/app/src/main/java/one/mixin/android/crypto/vo/SenderKey.kt +++ b/app/src/main/java/one/mixin/android/crypto/vo/SenderKey.kt @@ -1,7 +1,7 @@ package one.mixin.android.crypto.vo -import androidx.room.ColumnInfo -import androidx.room.Entity +import androidx.room3.ColumnInfo +import androidx.room3.Entity @Entity(tableName = "sender_keys", primaryKeys = ["group_id", "sender_id"]) class SenderKey( diff --git a/app/src/main/java/one/mixin/android/crypto/vo/Session.kt b/app/src/main/java/one/mixin/android/crypto/vo/Session.kt index 468922bb1b..e975e86908 100644 --- a/app/src/main/java/one/mixin/android/crypto/vo/Session.kt +++ b/app/src/main/java/one/mixin/android/crypto/vo/Session.kt @@ -1,10 +1,10 @@ package one.mixin.android.crypto.vo -import androidx.room.ColumnInfo -import androidx.room.ColumnInfo.Companion.BLOB -import androidx.room.Entity -import androidx.room.Index -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.ColumnInfo.Companion.BLOB +import androidx.room3.Entity +import androidx.room3.Index +import androidx.room3.PrimaryKey @Entity(tableName = "sessions", indices = [(Index(value = ["address", "device"], unique = true))]) class Session( diff --git a/app/src/main/java/one/mixin/android/crypto/vo/SignedPreKey.kt b/app/src/main/java/one/mixin/android/crypto/vo/SignedPreKey.kt index fd75671a40..00759c5f9b 100644 --- a/app/src/main/java/one/mixin/android/crypto/vo/SignedPreKey.kt +++ b/app/src/main/java/one/mixin/android/crypto/vo/SignedPreKey.kt @@ -1,9 +1,9 @@ package one.mixin.android.crypto.vo -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.Index -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.Index +import androidx.room3.PrimaryKey @Entity(tableName = "signed_prekeys", indices = [(Index(value = ["prekey_id"], unique = true))]) class SignedPreKey( diff --git a/app/src/main/java/one/mixin/android/db/AddressDao.kt b/app/src/main/java/one/mixin/android/db/AddressDao.kt index 53d6c4b35a..b66655130d 100644 --- a/app/src/main/java/one/mixin/android/db/AddressDao.kt +++ b/app/src/main/java/one/mixin/android/db/AddressDao.kt @@ -1,8 +1,8 @@ package one.mixin.android.db import androidx.lifecycle.LiveData -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import kotlinx.coroutines.flow.Flow import one.mixin.android.vo.Address import one.mixin.android.vo.AddressItem diff --git a/app/src/main/java/one/mixin/android/db/AlertDao.kt b/app/src/main/java/one/mixin/android/db/AlertDao.kt index 786159dccb..cf4c5aa91e 100644 --- a/app/src/main/java/one/mixin/android/db/AlertDao.kt +++ b/app/src/main/java/one/mixin/android/db/AlertDao.kt @@ -1,9 +1,9 @@ package one.mixin.android.db import androidx.lifecycle.LiveData -import androidx.room.Dao -import androidx.room.Query -import androidx.room.Transaction +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.Transaction import kotlinx.coroutines.flow.Flow import one.mixin.android.ui.wallet.alert.vo.Alert import one.mixin.android.ui.wallet.alert.vo.AlertGroup diff --git a/app/src/main/java/one/mixin/android/db/AppDao.kt b/app/src/main/java/one/mixin/android/db/AppDao.kt index 75dca80e43..c77f3b4e75 100644 --- a/app/src/main/java/one/mixin/android/db/AppDao.kt +++ b/app/src/main/java/one/mixin/android/db/AppDao.kt @@ -1,9 +1,9 @@ package one.mixin.android.db import androidx.lifecycle.LiveData -import androidx.room.Dao -import androidx.room.Query -import androidx.room.RoomWarnings +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.RoomWarnings import one.mixin.android.db.BaseDao.Companion.ESCAPE_SUFFIX import one.mixin.android.vo.App import one.mixin.android.vo.AppItem @@ -23,7 +23,7 @@ interface AppDao : BaseDao { """ } - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ $PREFIX_APP_ITEM diff --git a/app/src/main/java/one/mixin/android/db/AssetDao.kt b/app/src/main/java/one/mixin/android/db/AssetDao.kt index cfe56d3ebd..2e8733318a 100644 --- a/app/src/main/java/one/mixin/android/db/AssetDao.kt +++ b/app/src/main/java/one/mixin/android/db/AssetDao.kt @@ -1,10 +1,10 @@ package one.mixin.android.db import androidx.lifecycle.LiveData -import androidx.room.Dao -import androidx.room.Query -import androidx.room.RoomWarnings -import androidx.room.Update +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.RoomWarnings +import androidx.room3.Update import one.mixin.android.db.BaseDao.Companion.ESCAPE_SUFFIX import one.mixin.android.vo.Asset import one.mixin.android.vo.AssetItem @@ -43,23 +43,23 @@ interface AssetDao : BaseDao { @Query("SELECT * FROM assets WHERE asset_id = :id") suspend fun simpleAsset(id: String): Asset? - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query("$PREFIX_ASSET_ITEM WHERE ae.hidden = 1 $POSTFIX_ASSET_ITEM") fun hiddenAssetItems(): LiveData> - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query("$PREFIX_ASSET_ITEM $POSTFIX_ASSET_ITEM_NOT_HIDDEN") fun assetItemsNotHidden(): LiveData> - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query("$PREFIX_ASSET_ITEM $POSTFIX_ASSET_ITEM") fun assetItems(): LiveData> - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query("""$PREFIX_ASSET_ITEM WHERE a1.asset_id IN (:assetIds) $POSTFIX_ASSET_ITEM """) fun assetItems(assetIds: List): LiveData> - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """$PREFIX_ASSET_ITEM WHERE a1.balance > 0 @@ -74,7 +74,7 @@ interface AssetDao : BaseDao { symbol: String, ): List - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """$PREFIX_ASSET_ITEM WHERE (a1.symbol LIKE '%' || :symbol || '%' $ESCAPE_SUFFIX OR a1.name LIKE '%' || :name || '%' $ESCAPE_SUFFIX) @@ -88,15 +88,15 @@ interface AssetDao : BaseDao { symbol: String, ): List - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query("$PREFIX_ASSET_ITEM WHERE a1.asset_id = :id") fun assetItem(id: String): LiveData - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query("$PREFIX_ASSET_ITEM WHERE a1.asset_id = :assetId") suspend fun simpleAssetItem(assetId: String): AssetItem? - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query("$PREFIX_ASSET_ITEM WHERE a1.balance > 0 $POSTFIX_ASSET_ITEM") fun assetItemsWithBalance(): LiveData> diff --git a/app/src/main/java/one/mixin/android/db/BaseDao.kt b/app/src/main/java/one/mixin/android/db/BaseDao.kt index 4acea30582..1a1b9811fd 100644 --- a/app/src/main/java/one/mixin/android/db/BaseDao.kt +++ b/app/src/main/java/one/mixin/android/db/BaseDao.kt @@ -1,10 +1,10 @@ package one.mixin.android.db -import androidx.room.Delete -import androidx.room.Insert -import androidx.room.OnConflictStrategy -import androidx.room.Update -import androidx.room.Upsert +import androidx.room3.Delete +import androidx.room3.Insert +import androidx.room3.OnConflictStrategy +import androidx.room3.Update +import androidx.room3.Upsert interface BaseDao { @Insert(onConflict = OnConflictStrategy.REPLACE) diff --git a/app/src/main/java/one/mixin/android/db/ChainDao.kt b/app/src/main/java/one/mixin/android/db/ChainDao.kt index a47808662c..ad4ca56dc0 100644 --- a/app/src/main/java/one/mixin/android/db/ChainDao.kt +++ b/app/src/main/java/one/mixin/android/db/ChainDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.vo.Chain @Dao diff --git a/app/src/main/java/one/mixin/android/db/CircleConversationDao.kt b/app/src/main/java/one/mixin/android/db/CircleConversationDao.kt index c7dbe177da..722d408f99 100644 --- a/app/src/main/java/one/mixin/android/db/CircleConversationDao.kt +++ b/app/src/main/java/one/mixin/android/db/CircleConversationDao.kt @@ -1,8 +1,8 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query -import androidx.room.Transaction +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.Transaction import one.mixin.android.vo.CircleConversation @Dao diff --git a/app/src/main/java/one/mixin/android/db/CircleDao.kt b/app/src/main/java/one/mixin/android/db/CircleDao.kt index 8ff27ea00f..7b1af54cbb 100644 --- a/app/src/main/java/one/mixin/android/db/CircleDao.kt +++ b/app/src/main/java/one/mixin/android/db/CircleDao.kt @@ -1,11 +1,11 @@ package one.mixin.android.db import androidx.lifecycle.LiveData -import androidx.room.Dao -import androidx.room.Query -import androidx.room.RoomWarnings -import androidx.room.Transaction -import androidx.room.Update +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.RoomWarnings +import androidx.room3.Transaction +import androidx.room3.Update import one.mixin.android.vo.Circle import one.mixin.android.vo.CircleOrder import one.mixin.android.vo.ConversationCircleItem @@ -106,7 +106,7 @@ interface CircleDao : BaseDao { @Query("SELECT * FROM circles WHERE circle_id = :circleId") fun findCircleById(circleId: String): Circle? - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT c.conversation_id AS conversationId, c.icon_url AS groupIconUrl, c.category AS category, diff --git a/app/src/main/java/one/mixin/android/db/ConversationDao.kt b/app/src/main/java/one/mixin/android/db/ConversationDao.kt index ae51521db7..38d3d02bd0 100644 --- a/app/src/main/java/one/mixin/android/db/ConversationDao.kt +++ b/app/src/main/java/one/mixin/android/db/ConversationDao.kt @@ -2,9 +2,9 @@ package one.mixin.android.db import androidx.lifecycle.LiveData import androidx.paging.DataSource -import androidx.room.Dao -import androidx.room.Query -import androidx.room.RoomWarnings +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.RoomWarnings import one.mixin.android.vo.Conversation import one.mixin.android.vo.ConversationItem import one.mixin.android.vo.ConversationMinimal @@ -39,7 +39,7 @@ interface ConversationDao : BaseDao { } // Read SQL - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH, RoomWarnings.QUERY_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """$PREFIX_CONVERSATION_ITEM WHERE c.category IN ('CONTACT', 'GROUP') @@ -48,7 +48,7 @@ interface ConversationDao : BaseDao { ) fun conversationList(): DataSource.Factory - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH, RoomWarnings.QUERY_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT c.conversation_id AS conversationId, c.icon_url AS groupIconUrl, c.category AS category, @@ -112,7 +112,7 @@ interface ConversationDao : BaseDao { @Query("SELECT c.draft FROM conversations c WHERE c.conversation_id = :conversationId") suspend fun getConversationDraftById(conversationId: String): String? - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH, RoomWarnings.QUERY_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( "SELECT c.conversation_id AS conversationId, c.icon_url AS groupIconUrl, c.category AS category, " + "c.name AS groupName, c.status AS status, c.last_read_message_id AS lastReadMessageId, " + diff --git a/app/src/main/java/one/mixin/android/db/ConversationExtDao.kt b/app/src/main/java/one/mixin/android/db/ConversationExtDao.kt index 98c5148257..45824e37f4 100644 --- a/app/src/main/java/one/mixin/android/db/ConversationExtDao.kt +++ b/app/src/main/java/one/mixin/android/db/ConversationExtDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.extension.nowInUtc import one.mixin.android.vo.ConversationExt diff --git a/app/src/main/java/one/mixin/android/db/DatabaseVersion.kt b/app/src/main/java/one/mixin/android/db/DatabaseVersion.kt new file mode 100644 index 0000000000..8832c714cc --- /dev/null +++ b/app/src/main/java/one/mixin/android/db/DatabaseVersion.kt @@ -0,0 +1,10 @@ +package one.mixin.android.db + +import android.database.sqlite.SQLiteDatabase +import java.io.File + +fun readVersion(file: File): Int { + return SQLiteDatabase.openDatabase(file.absolutePath, null, SQLiteDatabase.OPEN_READONLY).use { db -> + db.version + } +} diff --git a/app/src/main/java/one/mixin/android/db/DepositDao.kt b/app/src/main/java/one/mixin/android/db/DepositDao.kt index e0f66c733f..1517738a97 100644 --- a/app/src/main/java/one/mixin/android/db/DepositDao.kt +++ b/app/src/main/java/one/mixin/android/db/DepositDao.kt @@ -1,8 +1,8 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query -import androidx.room.Transaction +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.Transaction import one.mixin.android.vo.safe.DepositEntry import one.mixin.android.vo.safe.DestinationTag diff --git a/app/src/main/java/one/mixin/android/db/ExpiredMessageDao.kt b/app/src/main/java/one/mixin/android/db/ExpiredMessageDao.kt index bdd6b3bfef..4a4f3884e3 100644 --- a/app/src/main/java/one/mixin/android/db/ExpiredMessageDao.kt +++ b/app/src/main/java/one/mixin/android/db/ExpiredMessageDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.vo.ExpiredMessage @Dao diff --git a/app/src/main/java/one/mixin/android/db/FavoriteAppDao.kt b/app/src/main/java/one/mixin/android/db/FavoriteAppDao.kt index 03af3204cc..9482664241 100644 --- a/app/src/main/java/one/mixin/android/db/FavoriteAppDao.kt +++ b/app/src/main/java/one/mixin/android/db/FavoriteAppDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.vo.FavoriteApp @Dao diff --git a/app/src/main/java/one/mixin/android/db/FloodMessageDao.kt b/app/src/main/java/one/mixin/android/db/FloodMessageDao.kt index 960a1e3cb3..c3525b2f25 100644 --- a/app/src/main/java/one/mixin/android/db/FloodMessageDao.kt +++ b/app/src/main/java/one/mixin/android/db/FloodMessageDao.kt @@ -1,8 +1,8 @@ package one.mixin.android.db import androidx.lifecycle.LiveData -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.vo.FloodMessage @Dao diff --git a/app/src/main/java/one/mixin/android/db/HistoryPriceDao.kt b/app/src/main/java/one/mixin/android/db/HistoryPriceDao.kt index c372640e06..121d5705f8 100644 --- a/app/src/main/java/one/mixin/android/db/HistoryPriceDao.kt +++ b/app/src/main/java/one/mixin/android/db/HistoryPriceDao.kt @@ -1,8 +1,8 @@ package one.mixin.android.db import androidx.lifecycle.LiveData -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.vo.market.HistoryPrice @Dao diff --git a/app/src/main/java/one/mixin/android/db/HyperlinkDao.kt b/app/src/main/java/one/mixin/android/db/HyperlinkDao.kt index 94ffee7afc..4fb6297129 100644 --- a/app/src/main/java/one/mixin/android/db/HyperlinkDao.kt +++ b/app/src/main/java/one/mixin/android/db/HyperlinkDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.vo.Hyperlink @Dao diff --git a/app/src/main/java/one/mixin/android/db/InscriptionCollectionDao.kt b/app/src/main/java/one/mixin/android/db/InscriptionCollectionDao.kt index f0b9274644..6c97f9c5b6 100644 --- a/app/src/main/java/one/mixin/android/db/InscriptionCollectionDao.kt +++ b/app/src/main/java/one/mixin/android/db/InscriptionCollectionDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import kotlinx.coroutines.flow.Flow import one.mixin.android.vo.InscriptionCollection import one.mixin.android.vo.InscriptionItem diff --git a/app/src/main/java/one/mixin/android/db/InscriptionDao.kt b/app/src/main/java/one/mixin/android/db/InscriptionDao.kt index 8fdb571cb8..747e0a2db2 100644 --- a/app/src/main/java/one/mixin/android/db/InscriptionDao.kt +++ b/app/src/main/java/one/mixin/android/db/InscriptionDao.kt @@ -1,8 +1,8 @@ package one.mixin.android.db import androidx.lifecycle.LiveData -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.vo.InscriptionCollection import one.mixin.android.vo.InscriptionItem import one.mixin.android.vo.safe.SafeCollectible diff --git a/app/src/main/java/one/mixin/android/db/JobDao.kt b/app/src/main/java/one/mixin/android/db/JobDao.kt index b3dadc1ab8..a18a07b6f8 100644 --- a/app/src/main/java/one/mixin/android/db/JobDao.kt +++ b/app/src/main/java/one/mixin/android/db/JobDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.Constants.ACK_LIMIT import one.mixin.android.vo.Job diff --git a/app/src/main/java/one/mixin/android/db/MarketCapRankDao.kt b/app/src/main/java/one/mixin/android/db/MarketCapRankDao.kt index f9f743859f..463be8592b 100644 --- a/app/src/main/java/one/mixin/android/db/MarketCapRankDao.kt +++ b/app/src/main/java/one/mixin/android/db/MarketCapRankDao.kt @@ -1,8 +1,8 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query -import androidx.room.Transaction +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.Transaction import one.mixin.android.vo.market.MarketCapRank @Dao diff --git a/app/src/main/java/one/mixin/android/db/MarketCoinDao.kt b/app/src/main/java/one/mixin/android/db/MarketCoinDao.kt index a9a06bf780..f695359406 100644 --- a/app/src/main/java/one/mixin/android/db/MarketCoinDao.kt +++ b/app/src/main/java/one/mixin/android/db/MarketCoinDao.kt @@ -1,8 +1,8 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query -import androidx.room.RoomWarnings +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.RoomWarnings import one.mixin.android.db.TokenDao.Companion.PREFIX_ASSET_ITEM import one.mixin.android.vo.market.MarketCoin import one.mixin.android.vo.safe.TokenItem diff --git a/app/src/main/java/one/mixin/android/db/MarketDao.kt b/app/src/main/java/one/mixin/android/db/MarketDao.kt index 07ffb7885b..ba6901d1bf 100644 --- a/app/src/main/java/one/mixin/android/db/MarketDao.kt +++ b/app/src/main/java/one/mixin/android/db/MarketDao.kt @@ -3,10 +3,10 @@ package one.mixin.android.db import androidx.lifecycle.LiveData import androidx.paging.PagingSource -import androidx.room.Dao -import androidx.room.Query -import androidx.room.RewriteQueriesToDropUnusedColumns -import androidx.room.RoomWarnings +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.RewriteQueriesToDropUnusedColumns +import androidx.room3.RoomWarnings import one.mixin.android.ui.wallet.alert.vo.CoinItem import one.mixin.android.vo.market.Market import one.mixin.android.vo.market.MarketItem diff --git a/app/src/main/java/one/mixin/android/db/MarketFavoredDao.kt b/app/src/main/java/one/mixin/android/db/MarketFavoredDao.kt index 14dcf5e759..87e56100ac 100644 --- a/app/src/main/java/one/mixin/android/db/MarketFavoredDao.kt +++ b/app/src/main/java/one/mixin/android/db/MarketFavoredDao.kt @@ -1,6 +1,6 @@ package one.mixin.android.db -import androidx.room.Dao +import androidx.room3.Dao import one.mixin.android.vo.market.MarketFavored @Dao diff --git a/app/src/main/java/one/mixin/android/db/MembershipOrderDao.kt b/app/src/main/java/one/mixin/android/db/MembershipOrderDao.kt index 2529fc24b2..b4cc6c5130 100644 --- a/app/src/main/java/one/mixin/android/db/MembershipOrderDao.kt +++ b/app/src/main/java/one/mixin/android/db/MembershipOrderDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import kotlinx.coroutines.flow.Flow import one.mixin.android.api.response.MembershipOrder diff --git a/app/src/main/java/one/mixin/android/db/MessageDao.kt b/app/src/main/java/one/mixin/android/db/MessageDao.kt index 32ca4e6876..8000563807 100644 --- a/app/src/main/java/one/mixin/android/db/MessageDao.kt +++ b/app/src/main/java/one/mixin/android/db/MessageDao.kt @@ -2,11 +2,11 @@ package one.mixin.android.db import androidx.lifecycle.LiveData import androidx.paging.DataSource -import androidx.room.Dao -import androidx.room.Query -import androidx.room.RawQuery -import androidx.room.RoomWarnings -import androidx.sqlite.db.SupportSQLiteQuery +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.RawQuery +import androidx.room3.RoomWarnings +import androidx.room3.RoomRawQuery import one.mixin.android.db.contants.AUDIOS import one.mixin.android.db.contants.DATA import one.mixin.android.db.contants.IMAGES @@ -66,7 +66,7 @@ interface MessageDao : BaseDao { } // Read SQL - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query("$PREFIX_MESSAGE_ITEM WHERE m.conversation_id = :conversationId AND m.category IN $CHAT_CATEGORY ORDER BY m.created_at ASC LIMIT :limit OFFSET :offset") suspend fun getChatMessages( conversationId: String, @@ -86,7 +86,7 @@ interface MessageDao : BaseDao { messageId: String, ): String? - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT m.id AS messageId, m.conversation_id AS conversationId, u.user_id AS userId, @@ -104,7 +104,7 @@ interface MessageDao : BaseDao { ) fun getMediaMessages(conversationId: String): DataSource.Factory - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT m.id AS messageId, m.conversation_id AS conversationId, u.user_id AS userId, @@ -122,7 +122,7 @@ interface MessageDao : BaseDao { ) suspend fun getMediaMessagesList(conversationId: String): List - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT m.id AS messageId, m.conversation_id AS conversationId, u.user_id AS userId, @@ -140,7 +140,7 @@ interface MessageDao : BaseDao { ) suspend fun getMediaMessagesExcludeLiveList(conversationId: String): List - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT m.id AS messageId, m.conversation_id AS conversationId, u.user_id AS userId, @@ -181,7 +181,7 @@ interface MessageDao : BaseDao { """) suspend fun countIndexMediaMessages(conversationId: String): Int - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT m.id AS messageId, m.conversation_id AS conversationId, u.user_id AS userId, @@ -220,7 +220,7 @@ interface MessageDao : BaseDao { """) suspend fun countIndexMediaMessagesExcludeLive(conversationId: String): Int - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT m.id AS messageId, m.conversation_id AS conversationId, u.user_id AS userId, u.avatar_url AS userAvatarUrl, @@ -236,7 +236,7 @@ interface MessageDao : BaseDao { ) fun getAudioMessages(conversationId: String): DataSource.Factory - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT m.id AS messageId, m.conversation_id AS conversationId, u.user_id AS userId, u.avatar_url AS userAvatarUrl, @@ -252,7 +252,7 @@ interface MessageDao : BaseDao { ) fun getPostMessages(conversationId: String): DataSource.Factory - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT m.id AS messageId, m.conversation_id AS conversationId, u.user_id AS userId, @@ -281,7 +281,7 @@ interface MessageDao : BaseDao { ) fun getLinkMessages(conversationId: String): DataSource.Factory - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT m.id AS messageId, m.conversation_id AS conversationId, u.user_id AS userId, @@ -296,7 +296,7 @@ interface MessageDao : BaseDao { ) fun getFileMessages(conversationId: String): DataSource.Factory - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT m.id AS messageId, m.conversation_id AS conversationId, u.user_id AS userId, @@ -334,7 +334,7 @@ interface MessageDao : BaseDao { ): Int @RawQuery - suspend fun fuzzySearchMessage(query: SupportSQLiteQuery): List + suspend fun fuzzySearchMessage(query: RoomRawQuery): List @Query( """ @@ -400,7 +400,7 @@ interface MessageDao : BaseDao { limit: Int, ): List - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT m.* FROM messages m @@ -414,7 +414,7 @@ interface MessageDao : BaseDao { rowId: Long, ): List - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT m.* FROM messages m @@ -429,7 +429,7 @@ interface MessageDao : BaseDao { conversationIds: Collection, ): List - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT m.* FROM messages m @@ -444,7 +444,7 @@ interface MessageDao : BaseDao { createdAt: String, ): List - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT m.* FROM messages m @@ -470,7 +470,7 @@ interface MessageDao : BaseDao { @Query("SELECT DISTINCT conversation_id FROM messages WHERE id IN (:messages)") fun findConversationsByMessages(messages: List): List - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT rowid, id FROM messages WHERE conversation_id = :conversationId @@ -502,7 +502,7 @@ interface MessageDao : BaseDao { encryptedCategory: String, ): List - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ $PREFIX_MESSAGE_ITEM WHERE m.conversation_id = :conversationId AND (m.category IN ($AUDIOS)) AND m.created_at >= :createdAt AND @@ -515,7 +515,7 @@ interface MessageDao : BaseDao { messageId: String, ): MessageItem? - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT * FROM messages WHERE conversation_id = :conversationId AND (category IN ($AUDIOS)) @@ -643,7 +643,7 @@ interface MessageDao : BaseDao { @Query("SELECT count(id) FROM messages WHERE conversation_id = :conversationId") suspend fun countDeleteMessageByConversationId(conversationId: String): Int - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT m.id AS messageId, m.conversation_id AS conversationId, u.user_id AS userId, @@ -660,7 +660,7 @@ interface MessageDao : BaseDao { ) fun findAudiosByConversationId(conversationId: String): DataSource.Factory - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT count(1) FROM messages @@ -677,7 +677,7 @@ interface MessageDao : BaseDao { conversationId: String, ): Int - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT m.id AS messageId, m.conversation_id AS conversationId, u.user_id AS userId, @@ -694,7 +694,7 @@ interface MessageDao : BaseDao { ids: List, ): List - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query("$PREFIX_MESSAGE_ITEM WHERE m.id = :messageId") fun findMessageItemByMessageId(messageId: String): LiveData @@ -704,7 +704,7 @@ interface MessageDao : BaseDao { @Query("SELECT id FROM messages LIMIT 1") suspend fun hasMessage(): String? - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query("SELECT * FROM messages WHERE id = :messageId") fun findMessageMediaById(messageId: String): MessageMedia? diff --git a/app/src/main/java/one/mixin/android/db/MessageHistoryDao.kt b/app/src/main/java/one/mixin/android/db/MessageHistoryDao.kt index 12a27d0575..51b064de70 100644 --- a/app/src/main/java/one/mixin/android/db/MessageHistoryDao.kt +++ b/app/src/main/java/one/mixin/android/db/MessageHistoryDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.vo.MessageHistory @Dao diff --git a/app/src/main/java/one/mixin/android/db/MessageMentionDao.kt b/app/src/main/java/one/mixin/android/db/MessageMentionDao.kt index 7a6cba20a0..f3312c0184 100644 --- a/app/src/main/java/one/mixin/android/db/MessageMentionDao.kt +++ b/app/src/main/java/one/mixin/android/db/MessageMentionDao.kt @@ -1,9 +1,9 @@ package one.mixin.android.db import androidx.lifecycle.LiveData -import androidx.room.Dao -import androidx.room.Query -import androidx.room.RoomWarnings +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.RoomWarnings import one.mixin.android.ui.transfer.vo.compatible.TransferMessageMention import one.mixin.android.vo.MessageMention @@ -54,14 +54,14 @@ interface MessageMentionDao : BaseDao { @Query("SELECT * FROM message_mentions WHERE message_id = :id") fun findMessageMentionById(id: String): MessageMention? - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query("SELECT mm.* FROM message_mentions mm WHERE mm.rowid > :rowId ORDER BY mm.rowid ASC LIMIT :limit") fun getMessageMentionByLimitAndRowId( limit: Int, rowId: Long, ): List - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query("SELECT mm.* FROM message_mentions mm WHERE mm.rowid > :rowId AND conversation_id IN (:conversationIds) ORDER BY mm.rowid ASC LIMIT :limit") fun getMessageMentionByLimitAndRowId( limit: Int, diff --git a/app/src/main/java/one/mixin/android/db/MixinDatabase.kt b/app/src/main/java/one/mixin/android/db/MixinDatabase.kt index f4cb915ad0..dce812e682 100644 --- a/app/src/main/java/one/mixin/android/db/MixinDatabase.kt +++ b/app/src/main/java/one/mixin/android/db/MixinDatabase.kt @@ -4,14 +4,15 @@ import android.annotation.SuppressLint import android.content.Context import android.database.Cursor import android.util.ArrayMap -import androidx.arch.core.executor.ArchTaskExecutor -import androidx.room.Database -import androidx.room.Room -import androidx.room.RoomDatabase -import androidx.room.TypeConverters -import androidx.sqlite.db.SupportSQLiteDatabase -import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory -import one.mixin.android.BuildConfig +import androidx.room3.Database +import androidx.room3.DaoReturnTypeConverters +import androidx.room3.Room +import androidx.room3.RoomDatabase +import androidx.room3.ColumnTypeConverters +import androidx.room3.livedata.LiveDataDaoReturnTypeConverter +import androidx.room3.paging.PagingSourceDaoReturnTypeConverter +import androidx.sqlite.SQLiteConnection +import androidx.sqlite.driver.AndroidSQLiteDriver import one.mixin.android.Constants.DataBase.CURRENT_VERSION import one.mixin.android.Constants.DataBase.DB_NAME import one.mixin.android.api.response.MembershipOrder @@ -72,7 +73,9 @@ import one.mixin.android.db.MixinDatabaseMigrations.Companion.MIGRATION_68_69 import one.mixin.android.db.MixinDatabaseMigrations.Companion.MIGRATION_69_70 import one.mixin.android.db.converter.DepositEntryListConverter import one.mixin.android.db.converter.FiatOrderConverter - +import one.mixin.android.db.datasource.DataSourceFactoryDaoReturnTypeConverter +import one.mixin.android.db.datasource.RoomDatabaseCompat +import one.mixin.android.db.datasource.execSQL import one.mixin.android.db.converter.MembershipConverter import one.mixin.android.db.converter.MessageStatusConverter import one.mixin.android.db.converter.OutputStateConverter @@ -85,13 +88,11 @@ import one.mixin.android.db.converter.WithdrawalMemoPossibilityConverter import one.mixin.android.session.Session import one.mixin.android.ui.wallet.alert.vo.Alert import one.mixin.android.util.GsonHelper -import one.mixin.android.util.SINGLE_DB_EXECUTOR import one.mixin.android.util.database.dbDir import one.mixin.android.util.database.moveLegacyDatabaseFile import one.mixin.android.util.database.moveLegacyFtsDatabaseFile import one.mixin.android.util.database.moveLegacyPendingDatabaseFile import one.mixin.android.util.debug.getContent -import one.mixin.android.util.reportException import one.mixin.android.vo.Account import one.mixin.android.vo.Address import one.mixin.android.vo.App @@ -141,6 +142,7 @@ import one.mixin.android.vo.safe.RawTransaction import one.mixin.android.vo.safe.SafeSnapshot import one.mixin.android.vo.safe.Token import one.mixin.android.vo.safe.TokensExtra +import kotlinx.coroutines.asCoroutineDispatcher import java.io.File import java.util.concurrent.Executors import kotlin.math.max @@ -201,7 +203,7 @@ import kotlin.math.min ], version = CURRENT_VERSION, ) -@TypeConverters( +@ColumnTypeConverters( MessageStatusConverter::class, DepositEntryListConverter::class, WithdrawalMemoPossibilityConverter::class, @@ -214,6 +216,11 @@ import kotlin.math.min MembershipConverter::class, FiatOrderConverter::class ) +@DaoReturnTypeConverters( + DataSourceFactoryDaoReturnTypeConverter::class, + LiveDataDaoReturnTypeConverter::class, + PagingSourceDaoReturnTypeConverter::class, +) abstract class MixinDatabase : RoomDatabase() { abstract fun conversationDao(): ConversationDao @@ -310,7 +317,6 @@ abstract class MixinDatabase : RoomDatabase() { private var INSTANCE: MixinDatabase? = null private val lock = Any() - private var supportSQLiteDatabase: SupportSQLiteDatabase? = null private var currentIdentityNumber: String? = null fun destroy(close: Boolean = false) { @@ -319,7 +325,6 @@ abstract class MixinDatabase : RoomDatabase() { INSTANCE?.close() } INSTANCE = null - supportSQLiteDatabase = null currentIdentityNumber = null } } @@ -349,7 +354,6 @@ abstract class MixinDatabase : RoomDatabase() { if (INSTANCE != null && currentIdentityNumber != scopedIdentity) { INSTANCE?.close() INSTANCE = null - supportSQLiteDatabase = null } if (INSTANCE == null) { Session.getAccount()?.let { account -> @@ -358,19 +362,7 @@ abstract class MixinDatabase : RoomDatabase() { val dbPath = File(dbDir(context, scopedIdentity), DB_NAME).absolutePath val builder = Room.databaseBuilder(context, MixinDatabase::class.java, dbPath) - .openHelperFactory( - MixinOpenHelperFactory( - FrameworkSQLiteOpenHelperFactory(), - listOf( - object : MixinCorruptionCallback { - override fun onCorruption(database: SupportSQLiteDatabase) { - val e = IllegalStateException("Mixin database is corrupted, current DB version: $CURRENT_VERSION") - reportException(e) - } - }, - ), - ), - ) + .setDriver(AndroidSQLiteDriver()) .addMigrations( MIGRATION_15_16, MIGRATION_16_17, @@ -429,30 +421,17 @@ abstract class MixinDatabase : RoomDatabase() { MIGRATION_69_70, ) .enableMultiInstanceInvalidation() - .setQueryExecutor( + .setQueryCoroutineContext( Executors.newFixedThreadPool( max( 2, min(Runtime.getRuntime().availableProcessors() - 1, 4), ), - ), + ).asCoroutineDispatcher(), ) - .setTransactionExecutor(SINGLE_DB_EXECUTOR) .addCallback(CALLBACK) - if (BuildConfig.DEBUG) { - builder.setQueryCallback( - object : QueryCallback { - override fun onQuery( - sqlQuery: String, - bindArgs: List, - ) { - DatabaseMonitor.monitor(sqlQuery, bindArgs) - } - }, - ArchTaskExecutor.getIOThreadExecutor(), - ) - } - INSTANCE = builder.build() + val database = builder.build() + INSTANCE = database currentIdentityNumber = scopedIdentity } return INSTANCE as MixinDatabase @@ -463,8 +442,9 @@ abstract class MixinDatabase : RoomDatabase() { val start = System.currentTimeMillis() var cursor: Cursor? = null try { + val database = INSTANCE ?: return null cursor = - supportSQLiteDatabase?.query(query) ?: return null + RoomDatabaseCompat.query(database, query) cursor.moveToFirst() val result = ArrayList>() do { @@ -483,18 +463,13 @@ abstract class MixinDatabase : RoomDatabase() { } fun checkPoint() { - supportSQLiteDatabase?.query("PRAGMA wal_checkpoint(FULL)")?.close() - } - - fun getWritableDatabase(): SupportSQLiteDatabase? { - return INSTANCE?.openHelper?.writableDatabase + INSTANCE?.let { RoomDatabaseCompat.query(it, "PRAGMA wal_checkpoint(FULL)").close() } } private val CALLBACK = object : RoomDatabase.Callback() { - override fun onOpen(db: SupportSQLiteDatabase) { + override suspend fun onOpen(db: SQLiteConnection) { super.onOpen(db) - supportSQLiteDatabase = db db.execSQL("PRAGMA synchronous = NORMAL") db.execSQL("DROP TRIGGER IF EXISTS conversation_unseen_count_insert") db.execSQL("DROP TRIGGER IF EXISTS conversation_unseen_message_count_insert") @@ -509,7 +484,6 @@ abstract class MixinDatabase : RoomDatabase() { synchronized(lock) { if (INSTANCE === this) { INSTANCE = null - supportSQLiteDatabase = null currentIdentityNumber = null } } diff --git a/app/src/main/java/one/mixin/android/db/MixinDatabaseMigrations.kt b/app/src/main/java/one/mixin/android/db/MixinDatabaseMigrations.kt index 97afb771b6..ea863f1160 100644 --- a/app/src/main/java/one/mixin/android/db/MixinDatabaseMigrations.kt +++ b/app/src/main/java/one/mixin/android/db/MixinDatabaseMigrations.kt @@ -1,8 +1,10 @@ package one.mixin.android.db -import androidx.room.migration.Migration -import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room3.migration.Migration +import androidx.sqlite.SQLiteConnection import one.mixin.android.Constants.DataBase.MINI_VERSION +import one.mixin.android.db.datasource.execSQL +import one.mixin.android.db.datasource.query import one.mixin.android.extension.nowInUtc import one.mixin.android.session.Session @@ -10,7 +12,7 @@ class MixinDatabaseMigrations private constructor() { companion object { val MIGRATION_15_16: Migration = object : Migration(MINI_VERSION, 16) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("DROP TABLE IF EXISTS assets") db.execSQL( "CREATE TABLE IF NOT EXISTS assets(asset_id TEXT PRIMARY KEY NOT NULL, symbol TEXT NOT NULL, name TEXT NOT NULL, " + @@ -27,7 +29,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_16_17: Migration = object : Migration(16, 17) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL( "CREATE TABLE IF NOT EXISTS jobs (job_id TEXT NOT NULL, action TEXT NOT NULL, created_at TEXT NOT NULL, order_id INTEGER, priority " + "INTEGER NOT NULL, user_id TEXT, blaze_message TEXT, conversation_id TEXT, resend_message_id TEXT, run_count INTEGER NOT NULL, PRIMARY KEY" + @@ -42,7 +44,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_17_18: Migration = object : Migration(17, 18) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE addresses ADD COLUMN dust TEXT") db.execSQL("DROP TRIGGER IF EXISTS conversation_unseen_message_count_update") } @@ -50,14 +52,14 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_18_19: Migration = object : Migration(18, 19) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE snapshots ADD COLUMN confirmations INTEGER") } } val MIGRATION_19_20: Migration = object : Migration(19, 20) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("DROP TABLE IF EXISTS top_assets") db.execSQL( "CREATE TABLE IF NOT EXISTS top_assets(asset_id TEXT PRIMARY KEY NOT NULL, symbol TEXT NOT NULL, name TEXT NOT NULL, " + @@ -69,28 +71,28 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_20_21: Migration = object : Migration(20, 21) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE assets ADD COLUMN asset_key TEXT") } } val MIGRATION_21_22: Migration = object : Migration(21, 22) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE messages ADD COLUMN thumb_url TEXT") } } val MIGRATION_22_23: Migration = object : Migration(22, 23) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE users ADD COLUMN biography TEXT NOT NULL DEFAULT ''") } } val MIGRATION_23_24: Migration = object : Migration(23, 24) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("DROP TABLE IF EXISTS addresses") db.execSQL( """ @@ -125,7 +127,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_24_25: Migration = object : Migration(24, 25) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL( "CREATE TABLE IF NOT EXISTS participant_session (`conversation_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `session_id` TEXT NOT NULL, `sent_to_server` INTEGER, `created_at` TEXT, PRIMARY KEY(`conversation_id`, `user_id`, `session_id`))", ) @@ -135,7 +137,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_25_26: Migration = object : Migration(25, 26) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL( "CREATE TABLE IF NOT EXISTS favorite_apps (`app_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`app_id`, `user_id`))", ) @@ -147,7 +149,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_26_27: Migration = object : Migration(26, 27) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL( """ CREATE TABLE IF NOT EXISTS `new_snapshots` (`snapshot_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, `created_at` TEXT NOT NULL, `opponent_id` TEXT, `trace_id` TEXT, `transaction_hash` TEXT, `sender` TEXT, `receiver` TEXT, `memo` TEXT, `confirmations` INTEGER, PRIMARY KEY(`snapshot_id`)) @@ -184,7 +186,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_27_28: Migration = object : Migration(27, 28) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL( "CREATE TABLE IF NOT EXISTS `message_mentions` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `mentions` TEXT NOT NULL, `has_read` INTEGER NOT NULL, PRIMARY KEY(`message_id`))", ) @@ -195,7 +197,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_28_29: Migration = object : Migration(28, 29) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("DROP INDEX IF EXISTS index_conversations_created_at") db.execSQL("DROP INDEX IF EXISTS index_conversations_conversation_id") db.execSQL("CREATE INDEX IF NOT EXISTS `index_snapshots_asset_id` ON `snapshots` (`asset_id`)") @@ -212,7 +214,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_29_30: Migration = object : Migration(29, 30) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL( "CREATE TABLE IF NOT EXISTS `circles` (`circle_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `ordered_at` TEXT, PRIMARY KEY(`circle_id`))", ) @@ -224,7 +226,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_30_31: Migration = object : Migration(30, 31) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE assets ADD COLUMN reserve TEXT") db.execSQL("ALTER TABLE apps ADD COLUMN category TEXT") } @@ -232,14 +234,14 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_31_32: Migration = object : Migration(31, 32) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE users ADD COLUMN is_scam INTEGER") } } val MIGRATION_32_33: Migration = object : Migration(32, 33) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL( """ CREATE TABLE IF NOT EXISTS `traces` (`trace_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `amount` TEXT NOT NULL, @@ -252,7 +254,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_33_34: Migration = object : Migration(33, 34) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE participant_session ADD COLUMN public_key TEXT") db.execSQL("ALTER TABLE messages ADD COLUMN caption TEXT") db.execSQL("CREATE INDEX IF NOT EXISTS `index_messages_conversation_id_status_user_id` ON `messages` (`conversation_id`, `status`, `user_id`)") @@ -262,14 +264,14 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_34_35: Migration = object : Migration(34, 35) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("CREATE INDEX IF NOT EXISTS `index_jobs_action` ON `jobs` (`action`)") } } val MIGRATION_35_36: Migration = object : Migration(35, 36) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE conversations ADD COLUMN last_message_created_at TEXT") db.execSQL("CREATE INDEX IF NOT EXISTS `index_conversations_pin_time_last_message_created_at` ON `conversations` (`pin_time`, `last_message_created_at`)") db.execSQL("UPDATE conversations SET last_message_created_at = (SELECT created_at FROM messages WHERE id = conversations.last_message_id)") @@ -280,7 +282,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_36_37: Migration = object : Migration(36, 37) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("DROP INDEX IF EXISTS `index_participants_conversation_id`") db.execSQL("DROP INDEX IF EXISTS `index_participants_created_at`") db.execSQL("DROP INDEX IF EXISTS `index_users_full_name`") @@ -292,14 +294,14 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_37_38: Migration = object : Migration(37, 38) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("CREATE TABLE IF NOT EXISTS `transcript_messages` (`transcript_id` TEXT NOT NULL, `message_id` TEXT NOT NULL, `user_id` TEXT, `user_full_name` TEXT, `category` TEXT NOT NULL, `created_at` TEXT NOT NULL, `content` TEXT, `media_url` TEXT, `media_name` TEXT, `media_size` INTEGER, `media_width` INTEGER, `media_height` INTEGER, `media_mime_type` TEXT, `media_duration` INTEGER, `media_status` TEXT, `media_waveform` BLOB, `thumb_image` TEXT, `thumb_url` TEXT, `media_key` BLOB, `media_digest` BLOB, `media_created_at` TEXT, `sticker_id` TEXT, `shared_user_id` TEXT, `mentions` TEXT, `quote_id` TEXT, `quote_content` TEXT, `caption` TEXT, PRIMARY KEY(`transcript_id`, `message_id`))") } } val MIGRATION_38_39: Migration = object : Migration(38, 39) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("CREATE TABLE IF NOT EXISTS `pin_messages` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`message_id`))") db.execSQL("CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id` ON `pin_messages` (`conversation_id`)") db.execSQL("DROP INDEX IF EXISTS `index_messages_conversation_id_user_id_status_created_at`") @@ -310,7 +312,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_39_40: Migration = object : Migration(39, 40) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL( "CREATE TABLE IF NOT EXISTS `properties` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`key`))", ) @@ -319,7 +321,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_40_41: Migration = object : Migration(40, 41) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE sticker_albums ADD COLUMN banner TEXT") db.execSQL("ALTER TABLE sticker_albums ADD COLUMN ordered_at INTEGER NOT NULL DEFAULT 0") db.execSQL("ALTER TABLE sticker_albums ADD COLUMN added INTEGER NOT NULL DEFAULT 0") @@ -329,7 +331,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_41_42: Migration = object : Migration(41, 42) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE sticker_albums ADD COLUMN is_verified INTEGER NOT NULL DEFAULT 0") db.execSQL("UPDATE sticker_albums SET is_verified = 1 WHERE category = 'SYSTEM'") } @@ -337,7 +339,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_42_43: Migration = object : Migration(42, 43) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("CREATE TABLE IF NOT EXISTS `remote_messages_status` (`message_id` TEXT NOT NULL, `conversation_id` TEXT NOT NULL, `status` TEXT NOT NULL, PRIMARY KEY(`message_id`))") db.execSQL("CREATE INDEX IF NOT EXISTS `index_remote_messages_status_conversation_id_status` ON `remote_messages_status` (`conversation_id`, `status`)") Session.getAccountId()?.let { selfId -> @@ -357,7 +359,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_43_44: Migration = object : Migration(43, 44) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE `conversations` ADD COLUMN `expire_in` INTEGER") db.execSQL("CREATE TABLE IF NOT EXISTS `expired_messages` (`message_id` TEXT NOT NULL, `expire_in` INTEGER NOT NULL, `expire_at` INTEGER, PRIMARY KEY(`message_id`))") } @@ -365,21 +367,21 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_44_45: Migration = object : Migration(44, 45) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE `assets` ADD COLUMN `deposit_entries` TEXT") } } val MIGRATION_45_46: Migration = object : Migration(45, 46) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE `addresses` ADD COLUMN fee_asset_id TEXT NOT NULL DEFAULT ''") } } val MIGRATION_46_47: Migration = object : Migration(46, 47) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("CREATE TABLE IF NOT EXISTS `conversation_ext` (`conversation_id` TEXT NOT NULL, `count` INTEGER NOT NULL DEFAULT 0, `created_at` TEXT NOT NULL, PRIMARY KEY(`conversation_id`))") db.execSQL("INSERT OR REPLACE INTO `conversation_ext` (`conversation_id`, `count`, `created_at`) SELECT conversation_id, count(1), '${nowInUtc()}' FROM messages m INNER JOIN users u ON m.user_id = u.user_id GROUP BY conversation_id LIMIT 100") } @@ -387,14 +389,14 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_47_48: Migration = object : Migration(47, 48) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("CREATE TABLE IF NOT EXISTS `chains` (`chain_id` TEXT NOT NULL, `name` TEXT NOT NULL, `symbol` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `threshold` INTEGER NOT NULL, PRIMARY KEY(`chain_id`))") } } val MIGRATION_48_49: Migration = object : Migration(48, 49) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE `snapshots` ADD COLUMN `snapshot_hash` TEXT") db.execSQL("ALTER TABLE `snapshots` ADD COLUMN `opening_balance` TEXT") db.execSQL("ALTER TABLE `snapshots` ADD COLUMN `closing_balance` TEXT") @@ -403,7 +405,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_49_50: Migration = object : Migration(49, 50) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE `users` ADD COLUMN `is_deactivated` INTEGER") db.execSQL("ALTER TABLE `assets` ADD COLUMN `withdrawal_memo_possibility` text") } @@ -411,7 +413,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_50_51: Migration = object : Migration(50, 51) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("CREATE TABLE IF NOT EXISTS `outputs` (`output_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `asset` TEXT NOT NULL, `sequence` INTEGER NOT NULL, `amount` TEXT NOT NULL, `mask` TEXT NOT NULL, `keys` TEXT NOT NULL, `receivers` TEXT NOT NULL, `receivers_hash` TEXT NOT NULL, `receivers_threshold` INTEGER NOT NULL, `extra` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `signed_by` TEXT NOT NULL, `signed_at` TEXT NOT NULL, `spent_at` TEXT NOT NULL, PRIMARY KEY(`output_id`))") db.execSQL("CREATE TABLE IF NOT EXISTS `tokens` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `name` TEXT NOT NULL, `icon_url` TEXT NOT NULL, `price_btc` TEXT NOT NULL, `price_usd` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `change_usd` TEXT NOT NULL, `change_btc` TEXT NOT NULL, `confirmations` INTEGER NOT NULL, `asset_key` TEXT NOT NULL, `dust` TEXT NOT NULL, PRIMARY KEY(`asset_id`))") db.execSQL("CREATE TABLE IF NOT EXISTS `tokens_extra` (`asset_id` TEXT NOT NULL, `kernel_asset_id` TEXT NOT NULL, `hidden` INTEGER, `balance` TEXT, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))") @@ -428,7 +430,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_51_52: Migration = object : Migration(51, 52) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE `safe_snapshots` ADD COLUMN `deposit` TEXT") db.execSQL("ALTER TABLE `safe_snapshots` ADD COLUMN `withdrawal` TEXT") db.execSQL("DROP INDEX IF EXISTS `index_outputs_asset_state_created_at`") @@ -438,7 +440,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_52_53: Migration = object : Migration(52, 53) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE `raw_transactions` ADD COLUMN `state` TEXT NOT NULL DEFAULT 'unspent'") db.execSQL("ALTER TABLE `raw_transactions` ADD COLUMN `type` INTEGER NOT NULL DEFAULT 0") db.execSQL("CREATE INDEX IF NOT EXISTS `index_raw_transactions_state_type` ON `raw_transactions` (`state`, `type`)") @@ -447,7 +449,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_53_54: Migration = object : Migration(53, 54) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE `outputs` ADD COLUMN `inscription_hash` TEXT") db.execSQL("ALTER TABLE `tokens` ADD COLUMN `collection_hash` TEXT") db.execSQL("ALTER TABLE `safe_snapshots` ADD COLUMN `inscription_hash` TEXT") @@ -461,7 +463,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_54_55: Migration = object : Migration(54, 55) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE `inscription_items` ADD COLUMN `traits` TEXT") db.execSQL("ALTER TABLE `inscription_items` ADD COLUMN `owner` TEXT") db.execSQL("ALTER TABLE `inscription_collections` ADD COLUMN `description` TEXT") @@ -470,21 +472,21 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_55_56: Migration = object : Migration(55, 56) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE `inscription_collections` ADD COLUMN `kernel_asset_id` TEXT") } } val MIGRATION_56_57: Migration = object : Migration(56, 57) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE `inscription_collections` ADD COLUMN `treasury` TEXT") } } val MIGRATION_57_58: Migration = object : Migration(57, 58) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("CREATE TABLE IF NOT EXISTS `markets` (`asset_id` TEXT NOT NULL, `current_price` TEXT NOT NULL, `market_cap` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `total_volume` TEXT NOT NULL, `high_24h` TEXT NOT NULL, `low_24h` TEXT NOT NULL, `price_change_24h` TEXT NOT NULL, `price_change_percentage_24h` TEXT NOT NULL, `market_cap_change_24h` TEXT NOT NULL, `market_cap_change_percentage_24h` TEXT NOT NULL, `circulating_supply` TEXT NOT NULL, `total_supply` TEXT NOT NULL, `max_supply` TEXT NOT NULL, `ath` TEXT NOT NULL, `ath_change_percentage` TEXT NOT NULL, `ath_date` TEXT NOT NULL, `atl` TEXT NOT NULL, `atl_change_percentage` TEXT NOT NULL, `atl_date` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`))") db.execSQL("CREATE TABLE IF NOT EXISTS `history_prices` (`asset_id` TEXT NOT NULL, `type` TEXT NOT NULL, `data` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`asset_id`, `type`))") db.execSQL("ALTER TABLE `users` ADD COLUMN `membership` TEXT") @@ -493,7 +495,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_58_59: Migration = object : Migration(58, 59) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("DROP TABLE IF EXISTS `history_prices`") db.execSQL("CREATE TABLE IF NOT EXISTS `history_prices` (`coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `data` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`, `type`))") db.execSQL("DROP TABLE IF EXISTS `markets`") @@ -505,7 +507,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_59_60: Migration = object : Migration(59, 60) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL( "CREATE TABLE IF NOT EXISTS new_addresses (address_id TEXT NOT NULL, type TEXT NOT NULL, asset_id TEXT NOT NULL, destination TEXT NOT NULL, label TEXT NOT NULL, updated_at TEXT NOT NULL, tag TEXT, dust TEXT, PRIMARY KEY(address_id))" ) @@ -525,7 +527,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_60_61: Migration = object : Migration(60, 61) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("CREATE INDEX IF NOT EXISTS `index_safe_snapshots_created_at` ON `safe_snapshots` (`created_at`)") db.execSQL("CREATE INDEX IF NOT EXISTS `index_safe_snapshots_type_asset_id` ON `safe_snapshots` (`type`, `asset_id`)") } @@ -533,7 +535,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_61_62: Migration = object : Migration(61, 62) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("CREATE TABLE IF NOT EXISTS `market_alerts` (`alert_id` TEXT NOT NULL, `coin_id` TEXT NOT NULL, `type` TEXT NOT NULL, `frequency` TEXT NOT NULL, `status` TEXT NOT NULL, `value` TEXT NOT NULL, `created_at` TEXT NOT NULL, PRIMARY KEY(`alert_id`))") db.execSQL("CREATE TABLE IF NOT EXISTS `market_cap_ranks` (`coin_id` TEXT NOT NULL, `market_cap_rank` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`coin_id`))") } @@ -541,7 +543,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_62_63: Migration = object : Migration(62, 63) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE `markets` ADD COLUMN `sparkline_in_24h` TEXT NOT NULL DEFAULT ''") db.execSQL("DROP INDEX IF EXISTS `index_pin_messages_conversation_id`") db.execSQL("CREATE INDEX IF NOT EXISTS `index_pin_messages_conversation_id_created_at` ON `pin_messages` (`conversation_id`, `created_at`)") @@ -550,7 +552,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_63_64: Migration = object : Migration(63, 64) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("CREATE TABLE IF NOT EXISTS `swap_orders` (`order_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `pay_asset_id` TEXT NOT NULL, `receive_asset_id` TEXT NOT NULL, `pay_amount` TEXT NOT NULL, `receive_amount` TEXT NOT NULL, `pay_trace_id` TEXT NOT NULL, `receive_trace_id` TEXT NOT NULL, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_type` TEXT NOT NULL, PRIMARY KEY(`order_id`))") db.execSQL("CREATE INDEX IF NOT EXISTS `index_swap_orders_state_created_at` ON `swap_orders` (`state`, `created_at`)") } @@ -558,7 +560,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_64_65: Migration = object : Migration(64, 65) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("DROP TABLE IF EXISTS `addresses`") db.execSQL("CREATE TABLE IF NOT EXISTS `addresses` (`address_id` TEXT NOT NULL, `type` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `destination` TEXT NOT NULL, `label` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `tag` TEXT, `dust` TEXT, PRIMARY KEY(`address_id`))") db.execSQL("CREATE INDEX IF NOT EXISTS `index_addresses_chain_id_updated_at` ON `addresses` (`chain_id`, `updated_at`)") @@ -567,7 +569,7 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_65_66: Migration = object : Migration(65, 66) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("CREATE TABLE IF NOT EXISTS `membership_orders` (`order_id` TEXT NOT NULL, `category` TEXT NOT NULL, `amount` TEXT NOT NULL, `amount_actual` TEXT NOT NULL, `amount_original` TEXT NOT NULL, `after` TEXT NOT NULL, `before` TEXT NOT NULL, `created_at` TEXT NOT NULL, `fiat_order` TEXT, `stars` INTEGER NOT NULL, `payment_url` TEXT, `status` TEXT NOT NULL, PRIMARY KEY(`order_id`))") db.execSQL("CREATE INDEX IF NOT EXISTS `index_membership_orders_created_at` ON `membership_orders` (`created_at`)") } @@ -575,14 +577,14 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_66_67: Migration = object : Migration(66, 67) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE `tokens` ADD COLUMN `precision` INTEGER NOT NULL DEFAULT -1") } } val MIGRATION_67_68: Migration = object : Migration(67, 68) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("DELETE FROM deposit_entries") db.execSQL("ALTER TABLE `deposit_entries` ADD COLUMN `minimum` TEXT NOT NULL DEFAULT ''") db.execSQL("ALTER TABLE `deposit_entries` ADD COLUMN `maximum` TEXT NOT NULL DEFAULT ''") @@ -592,14 +594,14 @@ class MixinDatabaseMigrations private constructor() { val MIGRATION_68_69: Migration = object : Migration(68, 69) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("DROP TABLE IF EXISTS `swap_orders`") } } val MIGRATION_69_70: Migration = object : Migration(69, 70) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE `markets` ADD COLUMN `descriptions` TEXT") } } diff --git a/app/src/main/java/one/mixin/android/db/MixinOpenHelper.kt b/app/src/main/java/one/mixin/android/db/MixinOpenHelper.kt deleted file mode 100644 index 19e5c6dd7a..0000000000 --- a/app/src/main/java/one/mixin/android/db/MixinOpenHelper.kt +++ /dev/null @@ -1,65 +0,0 @@ -package one.mixin.android.db - -import androidx.sqlite.db.SupportSQLiteDatabase -import androidx.sqlite.db.SupportSQLiteOpenHelper -import timber.log.Timber - -interface MixinCorruptionCallback { - fun onCorruption(database: SupportSQLiteDatabase) -} - -class MixinOpenHelperFactory( - private val delegate: SupportSQLiteOpenHelper.Factory, - private val corruptions: List, -) : SupportSQLiteOpenHelper.Factory { - override fun create(configuration: SupportSQLiteOpenHelper.Configuration): SupportSQLiteOpenHelper { - val decoratedConfiguration = - SupportSQLiteOpenHelper.Configuration.builder(configuration.context) - .name(configuration.name) - .callback(MixinOpenHelperCallback(configuration.callback, corruptions)) - .build() - return delegate.create(decoratedConfiguration) - } -} - -class MixinOpenHelperCallback( - private val delegate: SupportSQLiteOpenHelper.Callback, - private val corruptions: List, -) : SupportSQLiteOpenHelper.Callback(delegate.version) { - override fun onDowngrade( - db: SupportSQLiteDatabase, - oldVersion: Int, - newVersion: Int, - ) { - delegate.onDowngrade(db, oldVersion, newVersion) - } - - override fun onCreate(db: SupportSQLiteDatabase) { - delegate.onCreate(db) - } - - override fun onOpen(db: SupportSQLiteDatabase) { - delegate.onOpen(db) - } - - override fun onConfigure(db: SupportSQLiteDatabase) { - delegate.onConfigure(db) - } - - override fun onCorruption(db: SupportSQLiteDatabase) { - try { - corruptions.forEach { it.onCorruption(db) } - } catch (e: Exception) { - Timber.w(e) - } - delegate.onCorruption(db) - } - - override fun onUpgrade( - db: SupportSQLiteDatabase, - oldVersion: Int, - newVersion: Int, - ) { - delegate.onUpgrade(db, oldVersion, newVersion) - } -} diff --git a/app/src/main/java/one/mixin/android/db/OffsetDao.kt b/app/src/main/java/one/mixin/android/db/OffsetDao.kt index 2f2a426a7e..9cd67f9e21 100644 --- a/app/src/main/java/one/mixin/android/db/OffsetDao.kt +++ b/app/src/main/java/one/mixin/android/db/OffsetDao.kt @@ -1,8 +1,8 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query -import androidx.room.Transaction +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.Transaction import one.mixin.android.vo.Offset @Dao diff --git a/app/src/main/java/one/mixin/android/db/OrderDao.kt b/app/src/main/java/one/mixin/android/db/OrderDao.kt index 8cd94b722e..f84b1e1330 100644 --- a/app/src/main/java/one/mixin/android/db/OrderDao.kt +++ b/app/src/main/java/one/mixin/android/db/OrderDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import kotlinx.coroutines.flow.Flow import one.mixin.android.vo.route.Order import one.mixin.android.vo.route.OrderItem diff --git a/app/src/main/java/one/mixin/android/db/OutputDao.kt b/app/src/main/java/one/mixin/android/db/OutputDao.kt index 7516bb34df..4cc8341b2b 100644 --- a/app/src/main/java/one/mixin/android/db/OutputDao.kt +++ b/app/src/main/java/one/mixin/android/db/OutputDao.kt @@ -2,10 +2,10 @@ package one.mixin.android.db import androidx.lifecycle.LiveData import androidx.paging.PagingSource -import androidx.room.Dao -import androidx.room.Query -import androidx.room.RoomWarnings -import androidx.room.Transaction +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.RoomWarnings +import androidx.room3.Transaction import one.mixin.android.ui.home.web3.components.InscriptionState import one.mixin.android.vo.UtxoItem import one.mixin.android.vo.safe.Output diff --git a/app/src/main/java/one/mixin/android/db/ParticipantDao.kt b/app/src/main/java/one/mixin/android/db/ParticipantDao.kt index 4f549f029b..dd27fc4b46 100644 --- a/app/src/main/java/one/mixin/android/db/ParticipantDao.kt +++ b/app/src/main/java/one/mixin/android/db/ParticipantDao.kt @@ -2,10 +2,10 @@ package one.mixin.android.db import androidx.lifecycle.LiveData import androidx.paging.PagingSource -import androidx.room.Dao -import androidx.room.Query -import androidx.room.RoomWarnings -import androidx.room.Transaction +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.RoomWarnings +import androidx.room3.Transaction import one.mixin.android.vo.Participant import one.mixin.android.vo.ParticipantItem import one.mixin.android.vo.User diff --git a/app/src/main/java/one/mixin/android/db/ParticipantSessionDao.kt b/app/src/main/java/one/mixin/android/db/ParticipantSessionDao.kt index 887f2a34f1..50da460568 100644 --- a/app/src/main/java/one/mixin/android/db/ParticipantSessionDao.kt +++ b/app/src/main/java/one/mixin/android/db/ParticipantSessionDao.kt @@ -1,12 +1,12 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Insert -import androidx.room.OnConflictStrategy -import androidx.room.Query -import androidx.room.RoomWarnings -import androidx.room.Transaction -import androidx.room.Update +import androidx.room3.Dao +import androidx.room3.Insert +import androidx.room3.OnConflictStrategy +import androidx.room3.Query +import androidx.room3.RoomWarnings +import androidx.room3.Transaction +import androidx.room3.Update import one.mixin.android.vo.ParticipantSession import one.mixin.android.vo.ParticipantSessionKey import one.mixin.android.vo.ParticipantSessionSent @@ -24,7 +24,7 @@ interface ParticipantSessionDao : BaseDao { @Query("SELECT * FROM participant_session WHERE conversation_id = :conversationId") fun getParticipantSessionsByConversationId(conversationId: String): List - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query("SELECT * FROM participant_session WHERE conversation_id = :conversationId AND user_id != :userId LIMIT 1") fun getParticipantSessionKeyWithoutSelf( conversationId: String, diff --git a/app/src/main/java/one/mixin/android/db/PerpsDatabase.kt b/app/src/main/java/one/mixin/android/db/PerpsDatabase.kt index 71975cd80a..f14ddd1f41 100644 --- a/app/src/main/java/one/mixin/android/db/PerpsDatabase.kt +++ b/app/src/main/java/one/mixin/android/db/PerpsDatabase.kt @@ -1,22 +1,24 @@ package one.mixin.android.db import android.content.Context -import androidx.room.Database -import androidx.room.Room -import androidx.room.RoomDatabase -import androidx.room.migration.Migration -import androidx.sqlite.db.SupportSQLiteDatabase -import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory +import androidx.room3.Database +import androidx.room3.DaoReturnTypeConverters +import androidx.room3.Room +import androidx.room3.RoomDatabase +import androidx.room3.migration.Migration +import androidx.room3.paging.PagingSourceDaoReturnTypeConverter +import androidx.sqlite.SQLiteConnection +import androidx.sqlite.driver.AndroidSQLiteDriver import one.mixin.android.Constants import one.mixin.android.api.response.perps.PerpsMarket import one.mixin.android.api.response.perps.PerpsOrder import one.mixin.android.api.response.perps.PerpsPosition +import one.mixin.android.db.datasource.execSQL import one.mixin.android.db.perps.PerpsMarketDao import one.mixin.android.db.perps.PerpsOrderDao import one.mixin.android.db.perps.PerpsPositionDao -import one.mixin.android.util.SINGLE_DB_EXECUTOR import one.mixin.android.util.database.dbDir -import one.mixin.android.util.reportException +import kotlinx.coroutines.asCoroutineDispatcher import java.io.File import java.util.concurrent.Executors import kotlin.math.max @@ -30,6 +32,7 @@ import kotlin.math.min ], version = 5, ) +@DaoReturnTypeConverters(PagingSourceDaoReturnTypeConverter::class) abstract class PerpsDatabase : RoomDatabase() { companion object { private var INSTANCE: PerpsDatabase? = null @@ -37,14 +40,14 @@ abstract class PerpsDatabase : RoomDatabase() { private var currentIdentityNumber: String? = null val MIGRATION_1_2 = object : Migration(1, 2) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE markets ADD COLUMN category TEXT NOT NULL DEFAULT ''") db.execSQL("ALTER TABLE markets ADD COLUMN tags TEXT NOT NULL DEFAULT '[]'") } } val MIGRATION_2_3 = object : Migration(2, 3) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE positions ADD COLUMN take_profit_price TEXT") db.execSQL("ALTER TABLE positions ADD COLUMN stop_loss_price TEXT") db.execSQL("ALTER TABLE positions ADD COLUMN liquidation_price TEXT") @@ -53,7 +56,7 @@ abstract class PerpsDatabase : RoomDatabase() { } val MIGRATION_3_4 = object : Migration(3, 4) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("DROP TABLE IF EXISTS position_histories") db.execSQL( """ @@ -81,7 +84,7 @@ abstract class PerpsDatabase : RoomDatabase() { } val MIGRATION_4_5 = object : Migration(4, 5) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE perps_orders ADD COLUMN pay_amount TEXT NOT NULL DEFAULT '0'") db.execSQL("DELETE FROM perps_orders") } @@ -104,21 +107,10 @@ abstract class PerpsDatabase : RoomDatabase() { context, PerpsDatabase::class.java, File(dir, Constants.DataBase.PERPS_DB_NAME).absolutePath, - ).openHelperFactory( - MixinOpenHelperFactory( - FrameworkSQLiteOpenHelperFactory(), - listOf( - object : MixinCorruptionCallback { - override fun onCorruption(database: SupportSQLiteDatabase) { - val e = IllegalStateException("Perps database is corrupted, current DB version: 5") - reportException(e) - } - }, - ), - ), - ).addCallback( + ).setDriver(AndroidSQLiteDriver()) + .addCallback( object : Callback() { - override fun onOpen(db: SupportSQLiteDatabase) { + override suspend fun onOpen(db: SQLiteConnection) { super.onOpen(db) db.execSQL("PRAGMA synchronous = NORMAL") } @@ -126,12 +118,11 @@ abstract class PerpsDatabase : RoomDatabase() { ).addMigrations(MIGRATION_1_2, MIGRATION_2_3, MIGRATION_3_4, MIGRATION_4_5) .fallbackToDestructiveMigration() .enableMultiInstanceInvalidation() - .setQueryExecutor( + .setQueryCoroutineContext( Executors.newFixedThreadPool( max(2, min(Runtime.getRuntime().availableProcessors() - 1, 4)), - ), + ).asCoroutineDispatcher(), ) - .setTransactionExecutor(SINGLE_DB_EXECUTOR) INSTANCE = builder.build() currentIdentityNumber = scopedIdentity } diff --git a/app/src/main/java/one/mixin/android/db/PinMessageDao.kt b/app/src/main/java/one/mixin/android/db/PinMessageDao.kt index 93f61e33f7..e763d73cd2 100644 --- a/app/src/main/java/one/mixin/android/db/PinMessageDao.kt +++ b/app/src/main/java/one/mixin/android/db/PinMessageDao.kt @@ -1,8 +1,8 @@ package one.mixin.android.db import androidx.lifecycle.LiveData -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.vo.PinMessage import one.mixin.android.vo.PinMessageItem import one.mixin.android.vo.PinMessageMinimal diff --git a/app/src/main/java/one/mixin/android/db/PropertyDao.kt b/app/src/main/java/one/mixin/android/db/PropertyDao.kt index 5a4ae9c81c..37d5a14175 100644 --- a/app/src/main/java/one/mixin/android/db/PropertyDao.kt +++ b/app/src/main/java/one/mixin/android/db/PropertyDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.extension.nowInUtc import one.mixin.android.vo.Property diff --git a/app/src/main/java/one/mixin/android/db/RawTransactionDao.kt b/app/src/main/java/one/mixin/android/db/RawTransactionDao.kt index 49a849f4bb..c18e97bdd4 100644 --- a/app/src/main/java/one/mixin/android/db/RawTransactionDao.kt +++ b/app/src/main/java/one/mixin/android/db/RawTransactionDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.vo.safe.RawTransaction @Dao diff --git a/app/src/main/java/one/mixin/android/db/RemoteMessageStatusDao.kt b/app/src/main/java/one/mixin/android/db/RemoteMessageStatusDao.kt index 665f2be5d6..8b57cf4753 100644 --- a/app/src/main/java/one/mixin/android/db/RemoteMessageStatusDao.kt +++ b/app/src/main/java/one/mixin/android/db/RemoteMessageStatusDao.kt @@ -1,8 +1,8 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query -import androidx.room.Transaction +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.Transaction import one.mixin.android.Constants.MARK_REMOTE_LIMIT import one.mixin.android.vo.RemoteMessageStatus import one.mixin.android.vo.StatusMessage diff --git a/app/src/main/java/one/mixin/android/db/ResendSessionMessageDao.kt b/app/src/main/java/one/mixin/android/db/ResendSessionMessageDao.kt index 15023e7c2d..051e8e388f 100644 --- a/app/src/main/java/one/mixin/android/db/ResendSessionMessageDao.kt +++ b/app/src/main/java/one/mixin/android/db/ResendSessionMessageDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.vo.ResendSessionMessage @Dao diff --git a/app/src/main/java/one/mixin/android/db/RoomDatabaseTransaction.kt b/app/src/main/java/one/mixin/android/db/RoomDatabaseTransaction.kt new file mode 100644 index 0000000000..cbeb5f1877 --- /dev/null +++ b/app/src/main/java/one/mixin/android/db/RoomDatabaseTransaction.kt @@ -0,0 +1,6 @@ +package one.mixin.android.db + +import androidx.room3.RoomDatabase +import one.mixin.android.db.datasource.RoomDatabaseCompat + +fun RoomDatabase.runInTransaction(block: () -> T): T = RoomDatabaseCompat.runInWriteTransaction(this) { block() } diff --git a/app/src/main/java/one/mixin/android/db/SafeSnapshotDao.kt b/app/src/main/java/one/mixin/android/db/SafeSnapshotDao.kt index ac8a5c6d58..865763c115 100644 --- a/app/src/main/java/one/mixin/android/db/SafeSnapshotDao.kt +++ b/app/src/main/java/one/mixin/android/db/SafeSnapshotDao.kt @@ -3,12 +3,12 @@ package one.mixin.android.db import androidx.lifecycle.LiveData import androidx.paging.DataSource import androidx.paging.PagingSource -import androidx.room.Dao -import androidx.room.Query -import androidx.room.RawQuery -import androidx.room.RoomWarnings -import androidx.room.Transaction -import androidx.sqlite.db.SupportSQLiteQuery +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.RawQuery +import androidx.room3.RoomWarnings +import androidx.room3.Transaction +import androidx.room3.RoomRawQuery import one.mixin.android.db.BaseDao.Companion.ESCAPE_SUFFIX import one.mixin.android.vo.InscriptionCollection import one.mixin.android.vo.InscriptionItem @@ -104,7 +104,7 @@ interface SafeSnapshotDao : BaseDao { suspend fun findSnapshotByTraceId(traceId: String): SnapshotItem? @RawQuery(observedEntities = [SafeSnapshot::class, User::class, Token::class, InscriptionItem::class, InscriptionCollection::class]) - fun getSnapshots(query: SupportSQLiteQuery): PagingSource + fun getSnapshots(query: RoomRawQuery): PagingSource @Query("$SNAPSHOT_ITEM_PREFIX ORDER BY abs(s.amount * t.price_usd) DESC") fun allSnapshotsOrderByAmount(): DataSource.Factory diff --git a/app/src/main/java/one/mixin/android/db/SnapshotDao.kt b/app/src/main/java/one/mixin/android/db/SnapshotDao.kt index ceb938c19b..d77e3222d1 100644 --- a/app/src/main/java/one/mixin/android/db/SnapshotDao.kt +++ b/app/src/main/java/one/mixin/android/db/SnapshotDao.kt @@ -2,8 +2,8 @@ package one.mixin.android.db import androidx.paging.DataSource import androidx.paging.PagingSource -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.ui.oldwallet.SnapshotItem import one.mixin.android.vo.Snapshot diff --git a/app/src/main/java/one/mixin/android/db/StickerAlbumDao.kt b/app/src/main/java/one/mixin/android/db/StickerAlbumDao.kt index 4d1b1426c6..366d0d3090 100644 --- a/app/src/main/java/one/mixin/android/db/StickerAlbumDao.kt +++ b/app/src/main/java/one/mixin/android/db/StickerAlbumDao.kt @@ -1,10 +1,10 @@ package one.mixin.android.db import androidx.lifecycle.LiveData -import androidx.room.Dao -import androidx.room.Query -import androidx.room.Transaction -import androidx.room.Update +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.Transaction +import androidx.room3.Update import one.mixin.android.ui.sticker.StoreAlbum import one.mixin.android.vo.StickerAlbum import one.mixin.android.vo.StickerAlbumAdded diff --git a/app/src/main/java/one/mixin/android/db/StickerDao.kt b/app/src/main/java/one/mixin/android/db/StickerDao.kt index 073b16c0ab..a980e41490 100644 --- a/app/src/main/java/one/mixin/android/db/StickerDao.kt +++ b/app/src/main/java/one/mixin/android/db/StickerDao.kt @@ -1,9 +1,9 @@ package one.mixin.android.db import androidx.lifecycle.LiveData -import androidx.room.Dao -import androidx.room.Query -import androidx.room.Transaction +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.Transaction import one.mixin.android.vo.Sticker @Dao diff --git a/app/src/main/java/one/mixin/android/db/StickerRelationshipDao.kt b/app/src/main/java/one/mixin/android/db/StickerRelationshipDao.kt index be5a069ae8..65e78f39da 100644 --- a/app/src/main/java/one/mixin/android/db/StickerRelationshipDao.kt +++ b/app/src/main/java/one/mixin/android/db/StickerRelationshipDao.kt @@ -1,8 +1,8 @@ package one.mixin.android.db import androidx.lifecycle.LiveData -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.db.contants.STICKERS import one.mixin.android.vo.Sticker import one.mixin.android.vo.StickerRelationship diff --git a/app/src/main/java/one/mixin/android/db/TokenDao.kt b/app/src/main/java/one/mixin/android/db/TokenDao.kt index 23c917d429..ce05e924d8 100644 --- a/app/src/main/java/one/mixin/android/db/TokenDao.kt +++ b/app/src/main/java/one/mixin/android/db/TokenDao.kt @@ -1,12 +1,12 @@ package one.mixin.android.db import androidx.lifecycle.LiveData -import androidx.room.Dao -import androidx.room.Query -import androidx.room.RawQuery -import androidx.room.RoomRawQuery -import androidx.room.RoomWarnings -import androidx.room.Update +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.RawQuery +import androidx.room3.RoomRawQuery +import androidx.room3.RoomWarnings +import androidx.room3.Update import kotlinx.coroutines.flow.Flow import one.mixin.android.Constants import one.mixin.android.db.BaseDao.Companion.ESCAPE_SUFFIX diff --git a/app/src/main/java/one/mixin/android/db/TokensExtraDao.kt b/app/src/main/java/one/mixin/android/db/TokensExtraDao.kt index 8095ff5d1b..c5346888c6 100644 --- a/app/src/main/java/one/mixin/android/db/TokensExtraDao.kt +++ b/app/src/main/java/one/mixin/android/db/TokensExtraDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import kotlinx.coroutines.flow.Flow import one.mixin.android.vo.safe.TokensExtra diff --git a/app/src/main/java/one/mixin/android/db/TopAssetDao.kt b/app/src/main/java/one/mixin/android/db/TopAssetDao.kt index 5c934c278c..c4b6e1eeba 100644 --- a/app/src/main/java/one/mixin/android/db/TopAssetDao.kt +++ b/app/src/main/java/one/mixin/android/db/TopAssetDao.kt @@ -1,16 +1,16 @@ package one.mixin.android.db import androidx.lifecycle.LiveData -import androidx.room.Dao -import androidx.room.Query -import androidx.room.RoomWarnings +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.RoomWarnings import one.mixin.android.vo.TopAsset import one.mixin.android.vo.TopAssetItem @Dao @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) interface TopAssetDao : BaseDao { - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT ta.asset_id as asset_id, ta.symbol as symbol, ta.name as name, ta.icon_url as icon_url, ta.chain_id as chain_id, a.icon_url as chain_icon_url, diff --git a/app/src/main/java/one/mixin/android/db/TraceDao.kt b/app/src/main/java/one/mixin/android/db/TraceDao.kt index 4b61de8d39..b309a57caf 100644 --- a/app/src/main/java/one/mixin/android/db/TraceDao.kt +++ b/app/src/main/java/one/mixin/android/db/TraceDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.vo.Trace @Dao diff --git a/app/src/main/java/one/mixin/android/db/TranscriptMessageDao.kt b/app/src/main/java/one/mixin/android/db/TranscriptMessageDao.kt index 2dd95b89d4..2d0d1682f9 100644 --- a/app/src/main/java/one/mixin/android/db/TranscriptMessageDao.kt +++ b/app/src/main/java/one/mixin/android/db/TranscriptMessageDao.kt @@ -1,9 +1,9 @@ package one.mixin.android.db import androidx.paging.DataSource -import androidx.room.Dao -import androidx.room.Query -import androidx.room.RoomWarnings +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.RoomWarnings import one.mixin.android.db.contants.AUDIOS import one.mixin.android.db.contants.DATA import one.mixin.android.db.contants.IMAGES @@ -31,7 +31,7 @@ interface TranscriptMessageDao : BaseDao { @Query("SELECT * FROM transcript_messages WHERE message_id = :messageId AND category IN ($IMAGES, $VIDEOS, $DATA, $AUDIOS) AND (media_status = 'DONE' OR media_status = 'READ')") fun findAttachmentMessage(messageId: String): TranscriptMessage? - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query("SELECT * FROM transcript_messages WHERE transcript_id = :transcriptId") fun getTranscript(transcriptId: String): List @@ -62,7 +62,7 @@ interface TranscriptMessageDao : BaseDao { mediaStatus: String, ) - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT t.transcript_id AS transcriptId, t.message_id AS messageId, t.user_id AS userId , IFNULL(u.full_name, t.user_full_name) AS userFullName, u.app_id AS appId, u.identity_number AS userIdentityNumber, @@ -88,7 +88,7 @@ interface TranscriptMessageDao : BaseDao { messageId: String, ): Int - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """ SELECT t.transcript_id AS transcriptId, t.message_id AS messageId, t.user_id AS userId , IFNULL(u.full_name, t.user_full_name) AS userFullName, u.app_id AS appId, u.identity_number AS userIdentityNumber, t.category AS type, t.content, t.created_at AS createdAt, t.media_status AS mediaStatus, t.media_name AS mediaName, diff --git a/app/src/main/java/one/mixin/android/db/UserDao.kt b/app/src/main/java/one/mixin/android/db/UserDao.kt index 6c7ade9a6e..d6b6959eb2 100644 --- a/app/src/main/java/one/mixin/android/db/UserDao.kt +++ b/app/src/main/java/one/mixin/android/db/UserDao.kt @@ -1,10 +1,10 @@ package one.mixin.android.db import androidx.lifecycle.LiveData -import androidx.room.Dao -import androidx.room.Query -import androidx.room.RoomWarnings -import androidx.room.Transaction +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.RoomWarnings +import androidx.room3.Transaction import kotlinx.coroutines.flow.Flow import one.mixin.android.db.BaseDao.Companion.ESCAPE_SUFFIX import one.mixin.android.vo.App @@ -189,7 +189,7 @@ interface UserDao : BaseDao { relationship: String, ) - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( "SELECT u.user_id, u.identity_number, u.biography, u.full_name, u.relationship FROM participants p, users u " + "WHERE p.conversation_id = :conversationId AND p.user_id = u.user_id", @@ -214,14 +214,14 @@ interface UserDao : BaseDao { phone: String, ) - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query("SELECT u.* FROM users u INNER JOIN conversations c ON c.owner_id = u.user_id WHERE c.category = 'CONTACT' AND u.app_id IS NULL") fun findContactUsers(): LiveData> @Query("SELECT * FROM users WHERE user_id IN (:userIds)") suspend fun findMultiUsersByIds(userIds: Set): List - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """SELECT * FROM users u INNER JOIN participants p ON p.user_id = u.user_id WHERE p.conversation_id = :conversationId AND u.user_id IN (:userIds) @@ -232,7 +232,7 @@ interface UserDao : BaseDao { userIds: Set, ): List - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( """SELECT * FROM users u INNER JOIN participants p ON p.user_id = u.user_id WHERE p.conversation_id = :conversationId AND u.user_id = :userId diff --git a/app/src/main/java/one/mixin/android/db/WalletDatabase.kt b/app/src/main/java/one/mixin/android/db/WalletDatabase.kt index 195e52e292..44a870be33 100644 --- a/app/src/main/java/one/mixin/android/db/WalletDatabase.kt +++ b/app/src/main/java/one/mixin/android/db/WalletDatabase.kt @@ -1,17 +1,22 @@ package one.mixin.android.db import android.content.Context -import androidx.room.Database -import androidx.room.Room -import androidx.room.RoomDatabase -import androidx.room.TypeConverters -import androidx.room.migration.Migration -import androidx.sqlite.db.SupportSQLiteDatabase -import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory +import androidx.room3.Database +import androidx.room3.DaoReturnTypeConverters +import androidx.room3.Room +import androidx.room3.RoomDatabase +import androidx.room3.ColumnTypeConverters +import androidx.room3.livedata.LiveDataDaoReturnTypeConverter +import androidx.room3.migration.Migration +import androidx.room3.paging.PagingSourceDaoReturnTypeConverter +import androidx.sqlite.SQLiteConnection +import androidx.sqlite.driver.AndroidSQLiteDriver import one.mixin.android.Constants import one.mixin.android.api.response.web3.WalletOutput import one.mixin.android.db.converter.AssetChangeListConverter import one.mixin.android.db.converter.Web3TypeConverters +import one.mixin.android.db.datasource.RoomDatabaseCompat +import one.mixin.android.db.datasource.execSQL import one.mixin.android.db.web3.SafeWalletsDao import one.mixin.android.db.web3.WalletOutputDao import one.mixin.android.db.web3.Web3AddressDao @@ -29,11 +34,10 @@ import one.mixin.android.db.web3.vo.Web3Token import one.mixin.android.db.web3.vo.Web3TokensExtra import one.mixin.android.db.web3.vo.Web3Transaction import one.mixin.android.db.web3.vo.Web3Wallet -import one.mixin.android.util.SINGLE_DB_EXECUTOR import one.mixin.android.util.database.dbDir -import one.mixin.android.util.reportException import one.mixin.android.vo.Property import one.mixin.android.vo.route.Order +import kotlinx.coroutines.asCoroutineDispatcher import java.io.File import java.util.concurrent.Executors import kotlin.math.max @@ -55,7 +59,11 @@ import kotlin.math.min ], version = 7, ) -@TypeConverters(Web3TypeConverters::class, AssetChangeListConverter::class) +@ColumnTypeConverters(Web3TypeConverters::class, AssetChangeListConverter::class) +@DaoReturnTypeConverters( + LiveDataDaoReturnTypeConverter::class, + PagingSourceDaoReturnTypeConverter::class, +) abstract class WalletDatabase : RoomDatabase() { companion object { private var INSTANCE: WalletDatabase? = null @@ -63,10 +71,8 @@ abstract class WalletDatabase : RoomDatabase() { private val lock = Any() private var currentIdentityNumber: String? = null - private lateinit var supportSQLiteDatabase: SupportSQLiteDatabase - val MIGRATION_1_2 = object : Migration(1, 2) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("DROP TABLE IF EXISTS transactions") db.execSQL("DELETE FROM properties") // delete old offset db.execSQL( @@ -80,7 +86,7 @@ abstract class WalletDatabase : RoomDatabase() { } val MIGRATION_2_3 = object : Migration(2, 3) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE tokens ADD COLUMN level INTEGER NOT NULL DEFAULT ${Constants.AssetLevel.VERIFIED}") db.execSQL("ALTER TABLE transactions ADD COLUMN level INTEGER NOT NULL DEFAULT ${Constants.AssetLevel.UNKNOWN}") db.execSQL("DELETE FROM properties WHERE `key` IN (SELECT DISTINCT destination FROM addresses)") // delete old offset @@ -90,13 +96,13 @@ abstract class WalletDatabase : RoomDatabase() { } val MIGRATION_3_4 = object : Migration(3, 4) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("ALTER TABLE addresses ADD COLUMN path TEXT") } } val MIGRATION_4_5 = object : Migration(4, 5) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("CREATE TABLE IF NOT EXISTS `orders` (`order_id` TEXT NOT NULL, `wallet_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `pay_asset_id` TEXT NOT NULL, `receive_asset_id` TEXT NOT NULL, `pay_amount` TEXT NOT NULL, `receive_amount` TEXT, `pay_trace_id` TEXT, `receive_trace_id` TEXT, `state` TEXT NOT NULL, `created_at` TEXT NOT NULL, `order_type` TEXT NOT NULL, `fund_status` TEXT, `price` TEXT, `pending_amount` TEXT, `filled_receive_amount` TEXT, `expected_receive_amount` TEXT, `expired_at` TEXT, PRIMARY KEY(`order_id`))") db.execSQL("CREATE INDEX IF NOT EXISTS `index_orders_state_created_at` ON `orders` (`state`, `created_at`)") db.execSQL("CREATE INDEX IF NOT EXISTS `index_orders_order_type_created_at` ON `orders` (`order_type`, `created_at`)") @@ -104,13 +110,13 @@ abstract class WalletDatabase : RoomDatabase() { } val MIGRATION_5_6 = object : Migration(5, 6) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("CREATE TABLE IF NOT EXISTS `safe_wallets` (`wallet_id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `role` TEXT NOT NULL, `chain_id` TEXT NOT NULL, `address` TEXT NOT NULL, `url` TEXT NOT NULL, PRIMARY KEY(`wallet_id`))") } } val MIGRATION_6_7 = object : Migration(6, 7) { - override fun migrate(db: SupportSQLiteDatabase) { + override suspend fun migrate(db: SQLiteConnection) { db.execSQL("CREATE TABLE IF NOT EXISTS `outputs` (`output_id` TEXT NOT NULL, `asset_id` TEXT NOT NULL, `transaction_hash` TEXT NOT NULL, `output_index` INTEGER NOT NULL, `amount` TEXT NOT NULL, `address` TEXT NOT NULL, `pubkey_hex` TEXT NOT NULL, `pubkey_type` TEXT NOT NULL, `status` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, PRIMARY KEY(`output_id`))") } } @@ -133,38 +139,26 @@ abstract class WalletDatabase : RoomDatabase() { context, WalletDatabase::class.java, File(dir, Constants.DataBase.WEB3_DB_NAME).absolutePath, - ).openHelperFactory( - MixinOpenHelperFactory( - FrameworkSQLiteOpenHelperFactory(), - listOf( - object : MixinCorruptionCallback { - override fun onCorruption(database: SupportSQLiteDatabase) { - val e = IllegalStateException("Wallet database is corrupted, current DB version: 7") - reportException(e) - } - }, - ), - ), - ).addCallback( + ).setDriver(AndroidSQLiteDriver()) + .addCallback( object : Callback() { - override fun onOpen(db: SupportSQLiteDatabase) { + override suspend fun onOpen(db: SQLiteConnection) { super.onOpen(db) db.execSQL("PRAGMA synchronous = NORMAL") - supportSQLiteDatabase = db } }, ).addMigrations(MIGRATION_1_2, MIGRATION_2_3, MIGRATION_3_4, MIGRATION_4_5, MIGRATION_5_6, MIGRATION_6_7) .enableMultiInstanceInvalidation() - .setQueryExecutor( + .setQueryCoroutineContext( Executors.newFixedThreadPool( max( 2, min(Runtime.getRuntime().availableProcessors() - 1, 4), ), - ), + ).asCoroutineDispatcher(), ) - .setTransactionExecutor(SINGLE_DB_EXECUTOR) - INSTANCE = builder.build() + val database = builder.build() + INSTANCE = database currentIdentityNumber = scopedIdentity } } diff --git a/app/src/main/java/one/mixin/android/db/converter/AssetChangeListConverter.kt b/app/src/main/java/one/mixin/android/db/converter/AssetChangeListConverter.kt index 81b5544644..58e352bf86 100644 --- a/app/src/main/java/one/mixin/android/db/converter/AssetChangeListConverter.kt +++ b/app/src/main/java/one/mixin/android/db/converter/AssetChangeListConverter.kt @@ -1,6 +1,6 @@ package one.mixin.android.db.converter -import androidx.room.TypeConverter +import androidx.room3.ColumnTypeConverter import com.google.gson.Gson import com.google.gson.reflect.TypeToken import one.mixin.android.db.web3.vo.AssetChange @@ -8,7 +8,7 @@ import one.mixin.android.db.web3.vo.AssetChange class AssetChangeListConverter { private val gson = Gson() - @TypeConverter + @ColumnTypeConverter fun fromAssetChangeList(value: List?): String { return if (value == null) { "[]" @@ -17,7 +17,7 @@ class AssetChangeListConverter { } } - @TypeConverter + @ColumnTypeConverter fun toAssetChangeList(value: String): List? { val listType = object : TypeToken>() {}.type return try { diff --git a/app/src/main/java/one/mixin/android/db/converter/DepositEntryListConverter.kt b/app/src/main/java/one/mixin/android/db/converter/DepositEntryListConverter.kt index 0c5aa4df91..e7cf72a3ca 100644 --- a/app/src/main/java/one/mixin/android/db/converter/DepositEntryListConverter.kt +++ b/app/src/main/java/one/mixin/android/db/converter/DepositEntryListConverter.kt @@ -1,12 +1,12 @@ package one.mixin.android.db.converter -import androidx.room.TypeConverter +import androidx.room3.ColumnTypeConverter import com.google.gson.reflect.TypeToken import one.mixin.android.util.GsonHelper import one.mixin.android.vo.OldDepositEntry class DepositEntryListConverter { - @TypeConverter + @ColumnTypeConverter fun revertDate(value: String?): List { val listType = object : TypeToken>() {}.type return if (value.isNullOrBlank()) { @@ -16,7 +16,7 @@ class DepositEntryListConverter { } } - @TypeConverter + @ColumnTypeConverter fun converterDate(list: List?): String = if (list.isNullOrEmpty()) { "" diff --git a/app/src/main/java/one/mixin/android/db/converter/DescriptionsConverter.kt b/app/src/main/java/one/mixin/android/db/converter/DescriptionsConverter.kt index 8c7d49bc3f..ab8db81b5a 100644 --- a/app/src/main/java/one/mixin/android/db/converter/DescriptionsConverter.kt +++ b/app/src/main/java/one/mixin/android/db/converter/DescriptionsConverter.kt @@ -1,19 +1,19 @@ package one.mixin.android.db.converter -import androidx.room.TypeConverter +import androidx.room3.ColumnTypeConverter import com.google.gson.Gson import com.google.gson.reflect.TypeToken import one.mixin.android.extension.equalsIgnoreCase object DescriptionsConverter { - @TypeConverter + @ColumnTypeConverter fun fromString(value: String?): Map? { if (value.isNullOrEmpty() || value.equalsIgnoreCase("null")) return null val mapType = object : TypeToken>() {}.type return Gson().fromJson(value, mapType) } - @TypeConverter + @ColumnTypeConverter fun fromMap(map: Map?): String? { if (map.isNullOrEmpty()) return null return Gson().toJson(map) diff --git a/app/src/main/java/one/mixin/android/db/converter/FiatOrderConverter.kt b/app/src/main/java/one/mixin/android/db/converter/FiatOrderConverter.kt index 0a1f3daf69..4966e541ff 100644 --- a/app/src/main/java/one/mixin/android/db/converter/FiatOrderConverter.kt +++ b/app/src/main/java/one/mixin/android/db/converter/FiatOrderConverter.kt @@ -1,18 +1,18 @@ package one.mixin.android.db.converter -import androidx.room.TypeConverter +import androidx.room3.ColumnTypeConverter import com.google.gson.reflect.TypeToken import one.mixin.android.api.response.FiatOrderView import one.mixin.android.util.GsonHelper class FiatOrderConverter { - @TypeConverter + @ColumnTypeConverter fun fromFiatOrder(fiatOrder: FiatOrderView?): String? { if (fiatOrder == null) return null return GsonHelper.customGson.toJson(fiatOrder) } - @TypeConverter + @ColumnTypeConverter fun toFiatOrder(json: String?): FiatOrderView? { if (json == null) return null return GsonHelper.customGson.fromJson(json, object : TypeToken() {}.type) diff --git a/app/src/main/java/one/mixin/android/db/converter/LimitOrderConverters.kt b/app/src/main/java/one/mixin/android/db/converter/LimitOrderConverters.kt index 7328eb531b..e44ace1c60 100644 --- a/app/src/main/java/one/mixin/android/db/converter/LimitOrderConverters.kt +++ b/app/src/main/java/one/mixin/android/db/converter/LimitOrderConverters.kt @@ -1,19 +1,19 @@ package one.mixin.android.db.converter -import androidx.room.TypeConverter +import androidx.room3.ColumnTypeConverter import one.mixin.android.vo.route.LimitOrderFundStatus import one.mixin.android.vo.route.LimitOrderStatus class LimitOrderConverters { - @TypeConverter + @ColumnTypeConverter fun fromStatus(value: String?): LimitOrderStatus? = value?.let { LimitOrderStatus.fromString(it) } - @TypeConverter + @ColumnTypeConverter fun toStatus(value: LimitOrderStatus?): String? = value?.value - @TypeConverter + @ColumnTypeConverter fun fromFundStatus(value: String?): LimitOrderFundStatus? = value?.let { LimitOrderFundStatus.fromString(it) } - @TypeConverter + @ColumnTypeConverter fun toFundStatus(value: LimitOrderFundStatus?): String? = value?.value } diff --git a/app/src/main/java/one/mixin/android/db/converter/ListConverter.java b/app/src/main/java/one/mixin/android/db/converter/ListConverter.java index c4058437cb..021a8bd5fb 100644 --- a/app/src/main/java/one/mixin/android/db/converter/ListConverter.java +++ b/app/src/main/java/one/mixin/android/db/converter/ListConverter.java @@ -1,6 +1,6 @@ package one.mixin.android.db.converter; -import androidx.room.TypeConverter; +import androidx.room3.ColumnTypeConverter; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; @@ -9,13 +9,13 @@ import java.util.List; public class ListConverter { - @TypeConverter + @ColumnTypeConverter public static List fromString(String value) { Type listType = new TypeToken>() {}.getType(); return new Gson().fromJson(value, listType); } - @TypeConverter + @ColumnTypeConverter public static String fromList(List list) { Gson gson = new Gson(); return gson.toJson(list); diff --git a/app/src/main/java/one/mixin/android/db/converter/MembershipConverter.kt b/app/src/main/java/one/mixin/android/db/converter/MembershipConverter.kt index 13e747b590..53b7cff7e2 100644 --- a/app/src/main/java/one/mixin/android/db/converter/MembershipConverter.kt +++ b/app/src/main/java/one/mixin/android/db/converter/MembershipConverter.kt @@ -1,17 +1,17 @@ package one.mixin.android.db.converter -import androidx.room.TypeConverter +import androidx.room3.ColumnTypeConverter import one.mixin.android.util.GsonHelper import one.mixin.android.vo.Membership class MembershipConverter { - @TypeConverter + @ColumnTypeConverter fun revertData(value: String?): Membership? { if (value == null) return null return GsonHelper.customGson.fromJson(value, Membership::class.java) } - @TypeConverter + @ColumnTypeConverter fun converterData(treasury: Membership?): String? { if (treasury == null) return null return GsonHelper.customGson.toJson(treasury) diff --git a/app/src/main/java/one/mixin/android/db/converter/MessageStatusConverter.kt b/app/src/main/java/one/mixin/android/db/converter/MessageStatusConverter.kt index 774ec44d82..22e5ef06c5 100644 --- a/app/src/main/java/one/mixin/android/db/converter/MessageStatusConverter.kt +++ b/app/src/main/java/one/mixin/android/db/converter/MessageStatusConverter.kt @@ -1,14 +1,14 @@ package one.mixin.android.db.converter -import androidx.room.TypeConverter +import androidx.room3.ColumnTypeConverter import one.mixin.android.vo.MessageStatus class MessageStatusConverter { - @TypeConverter + @ColumnTypeConverter fun revertDate(value: String): MessageStatus { return requireNotNull(MessageStatus.values().firstOrNull { it.name == value }) } - @TypeConverter + @ColumnTypeConverter fun converterDate(status: MessageStatus) = status.name } diff --git a/app/src/main/java/one/mixin/android/db/converter/OptionalListConverter.kt b/app/src/main/java/one/mixin/android/db/converter/OptionalListConverter.kt index 10cbcb318f..dcbb3b77b1 100644 --- a/app/src/main/java/one/mixin/android/db/converter/OptionalListConverter.kt +++ b/app/src/main/java/one/mixin/android/db/converter/OptionalListConverter.kt @@ -1,19 +1,19 @@ package one.mixin.android.db.converter -import androidx.room.TypeConverter +import androidx.room3.ColumnTypeConverter import com.google.gson.Gson import com.google.gson.reflect.TypeToken import one.mixin.android.extension.equalsIgnoreCase object OptionalListConverter { - @TypeConverter + @ColumnTypeConverter fun fromString(value: String?): List? { if (value.isNullOrEmpty() || value.equalsIgnoreCase("null")) return null val listType = object : TypeToken?>() {}.type return Gson().fromJson(value, listType) } - @TypeConverter + @ColumnTypeConverter fun fromList(list: List?): String? { if (list.isNullOrEmpty()) return null val gson = Gson() diff --git a/app/src/main/java/one/mixin/android/db/converter/OutputStateConverter.kt b/app/src/main/java/one/mixin/android/db/converter/OutputStateConverter.kt index 9cade524f4..690842625a 100644 --- a/app/src/main/java/one/mixin/android/db/converter/OutputStateConverter.kt +++ b/app/src/main/java/one/mixin/android/db/converter/OutputStateConverter.kt @@ -1,16 +1,16 @@ package one.mixin.android.db.converter -import androidx.room.TypeConverter +import androidx.room3.ColumnTypeConverter import one.mixin.android.vo.safe.OutputState import java.util.Locale class OutputStateConverter { - @TypeConverter + @ColumnTypeConverter fun toOutputState(value: String): OutputState { return OutputState.valueOf(value.lowercase(Locale.US)) } - @TypeConverter + @ColumnTypeConverter fun fromOutputState(state: OutputState): String { return state.name.lowercase(Locale.US) } diff --git a/app/src/main/java/one/mixin/android/db/converter/PriceListConverter.kt b/app/src/main/java/one/mixin/android/db/converter/PriceListConverter.kt index 3fe954e5fa..ec5c371f05 100644 --- a/app/src/main/java/one/mixin/android/db/converter/PriceListConverter.kt +++ b/app/src/main/java/one/mixin/android/db/converter/PriceListConverter.kt @@ -1,12 +1,12 @@ package one.mixin.android.db.converter -import androidx.room.TypeConverter +import androidx.room3.ColumnTypeConverter import com.google.gson.reflect.TypeToken import one.mixin.android.util.GsonHelper import one.mixin.android.vo.market.Price class PriceListConverter { - @TypeConverter + @ColumnTypeConverter fun revertDate(value: String?): List { val listType = object : TypeToken>() {}.type return if (value.isNullOrBlank()) { @@ -16,7 +16,7 @@ class PriceListConverter { } } - @TypeConverter + @ColumnTypeConverter fun converterDate(list: List?): String? = if (list.isNullOrEmpty()) { null diff --git a/app/src/main/java/one/mixin/android/db/converter/RawTransactionTypeConverter.kt b/app/src/main/java/one/mixin/android/db/converter/RawTransactionTypeConverter.kt index 06569a86dc..ddc6c50b27 100644 --- a/app/src/main/java/one/mixin/android/db/converter/RawTransactionTypeConverter.kt +++ b/app/src/main/java/one/mixin/android/db/converter/RawTransactionTypeConverter.kt @@ -1,16 +1,16 @@ package one.mixin.android.db.converter -import androidx.room.TypeConverter +import androidx.room3.ColumnTypeConverter import one.mixin.android.vo.safe.RawTransactionType class RawTransactionTypeConverter { - @TypeConverter + @ColumnTypeConverter fun toRawTransactionType(value: Int): RawTransactionType { return RawTransactionType.entries.firstOrNull { it.value == value } ?: throw IllegalArgumentException("Invalid RawTransactionType value: $value") } - @TypeConverter + @ColumnTypeConverter fun fromRawTransactionType(type: RawTransactionType): Int { return type.value } diff --git a/app/src/main/java/one/mixin/android/db/converter/SafeChainConverter.kt b/app/src/main/java/one/mixin/android/db/converter/SafeChainConverter.kt index 63cc049327..0f3f1b32a0 100644 --- a/app/src/main/java/one/mixin/android/db/converter/SafeChainConverter.kt +++ b/app/src/main/java/one/mixin/android/db/converter/SafeChainConverter.kt @@ -1,15 +1,15 @@ package one.mixin.android.db.converter -import androidx.room.TypeConverter +import androidx.room3.ColumnTypeConverter import one.mixin.android.db.web3.vo.SafeChain class SafeChainConverter { - @TypeConverter + @ColumnTypeConverter fun toSafeChain(value: String?): SafeChain? { return SafeChain.fromValue(value) } - @TypeConverter + @ColumnTypeConverter fun fromSafeChain(chain: SafeChain?): String? { return chain?.value } diff --git a/app/src/main/java/one/mixin/android/db/converter/SafeDepositConverter.kt b/app/src/main/java/one/mixin/android/db/converter/SafeDepositConverter.kt index 5cf1c408b9..2f6beecc43 100644 --- a/app/src/main/java/one/mixin/android/db/converter/SafeDepositConverter.kt +++ b/app/src/main/java/one/mixin/android/db/converter/SafeDepositConverter.kt @@ -1,17 +1,17 @@ package one.mixin.android.db.converter -import androidx.room.TypeConverter +import androidx.room3.ColumnTypeConverter import one.mixin.android.util.GsonHelper import one.mixin.android.vo.safe.SafeDeposit class SafeDepositConverter { - @TypeConverter + @ColumnTypeConverter fun revertData(value: String?): SafeDeposit? { if (value == null) return null return GsonHelper.customGson.fromJson(value, SafeDeposit::class.java) } - @TypeConverter + @ColumnTypeConverter fun converterData(status: SafeDeposit?): String? { return GsonHelper.customGson.toJson(status) } diff --git a/app/src/main/java/one/mixin/android/db/converter/SafeWithdrawalConverter.kt b/app/src/main/java/one/mixin/android/db/converter/SafeWithdrawalConverter.kt index bad5ac2197..fc1330cdfe 100644 --- a/app/src/main/java/one/mixin/android/db/converter/SafeWithdrawalConverter.kt +++ b/app/src/main/java/one/mixin/android/db/converter/SafeWithdrawalConverter.kt @@ -1,17 +1,17 @@ package one.mixin.android.db.converter -import androidx.room.TypeConverter +import androidx.room3.ColumnTypeConverter import one.mixin.android.util.GsonHelper import one.mixin.android.vo.safe.SafeWithdrawal class SafeWithdrawalConverter { - @TypeConverter + @ColumnTypeConverter fun revertData(value: String?): SafeWithdrawal? { if (value == null) return null return GsonHelper.customGson.fromJson(value, SafeWithdrawal::class.java) } - @TypeConverter + @ColumnTypeConverter fun converterData(status: SafeWithdrawal?): String? { return GsonHelper.customGson.toJson(status) } diff --git a/app/src/main/java/one/mixin/android/db/converter/TreasuryConverter.kt b/app/src/main/java/one/mixin/android/db/converter/TreasuryConverter.kt index 7a3e2efd54..3b3912bce0 100644 --- a/app/src/main/java/one/mixin/android/db/converter/TreasuryConverter.kt +++ b/app/src/main/java/one/mixin/android/db/converter/TreasuryConverter.kt @@ -1,17 +1,17 @@ package one.mixin.android.db.converter -import androidx.room.TypeConverter +import androidx.room3.ColumnTypeConverter import one.mixin.android.util.GsonHelper import one.mixin.android.vo.safe.Treasury class TreasuryConverter { - @TypeConverter + @ColumnTypeConverter fun revertData(value: String?): Treasury? { if (value == null) return null return GsonHelper.customGson.fromJson(value, Treasury::class.java) } - @TypeConverter + @ColumnTypeConverter fun converterData(treasury: Treasury?): String? { if (treasury == null) return null return GsonHelper.customGson.toJson(treasury) diff --git a/app/src/main/java/one/mixin/android/db/converter/Web3TypeConverters.kt b/app/src/main/java/one/mixin/android/db/converter/Web3TypeConverters.kt index 52de18d2c5..a157e3c918 100644 --- a/app/src/main/java/one/mixin/android/db/converter/Web3TypeConverters.kt +++ b/app/src/main/java/one/mixin/android/db/converter/Web3TypeConverters.kt @@ -1,6 +1,6 @@ package one.mixin.android.db.converter -import androidx.room.TypeConverter +import androidx.room3.ColumnTypeConverter import one.mixin.android.api.response.AppMetadata import one.mixin.android.api.response.Approval import one.mixin.android.api.response.Web3Fee @@ -10,28 +10,28 @@ import one.mixin.android.util.GsonHelper class Web3TypeConverters { private val gson = GsonHelper.customGson - @TypeConverter + @ColumnTypeConverter fun fromFee(fee: Web3Fee): String = gson.toJson(fee) - @TypeConverter + @ColumnTypeConverter fun toFee(json: String): Web3Fee = gson.fromJson(json, Web3Fee::class.java) - @TypeConverter + @ColumnTypeConverter fun fromTransfers(transfers: List): String = gson.toJson(transfers) - @TypeConverter + @ColumnTypeConverter fun toTransfers(json: String): List = gson.fromJson(json, Array::class.java).toList() - @TypeConverter + @ColumnTypeConverter fun fromApprovals(approvals: List): String = gson.toJson(approvals) - @TypeConverter + @ColumnTypeConverter fun toApprovals(json: String): List = gson.fromJson(json, Array::class.java).toList() - @TypeConverter + @ColumnTypeConverter fun fromAppMetadata(metadata: AppMetadata?): String? = metadata?.let { gson.toJson(it) } - @TypeConverter + @ColumnTypeConverter fun toAppMetadata(json: String?): AppMetadata? = json?.let { gson.fromJson(it, AppMetadata::class.java) } } \ No newline at end of file diff --git a/app/src/main/java/one/mixin/android/db/converter/WithdrawalMemoPossibilityConverter.kt b/app/src/main/java/one/mixin/android/db/converter/WithdrawalMemoPossibilityConverter.kt index 7637520d9f..5c083f75f0 100644 --- a/app/src/main/java/one/mixin/android/db/converter/WithdrawalMemoPossibilityConverter.kt +++ b/app/src/main/java/one/mixin/android/db/converter/WithdrawalMemoPossibilityConverter.kt @@ -1,16 +1,16 @@ package one.mixin.android.db.converter -import androidx.room.TypeConverter +import androidx.room3.ColumnTypeConverter import one.mixin.android.vo.WithdrawalMemoPossibility class WithdrawalMemoPossibilityConverter { - @TypeConverter + @ColumnTypeConverter fun revertDate(value: String?): WithdrawalMemoPossibility? { if (value == null) return null return requireNotNull(WithdrawalMemoPossibility.values().firstOrNull { it.value == value }) } - @TypeConverter + @ColumnTypeConverter fun converterDate(status: WithdrawalMemoPossibility?): String? { return status?.value } diff --git a/app/src/main/java/one/mixin/android/db/datasource/DataSourceFactoryDaoReturnTypeConverter.kt b/app/src/main/java/one/mixin/android/db/datasource/DataSourceFactoryDaoReturnTypeConverter.kt new file mode 100644 index 0000000000..9653f3c3a0 --- /dev/null +++ b/app/src/main/java/one/mixin/android/db/datasource/DataSourceFactoryDaoReturnTypeConverter.kt @@ -0,0 +1,94 @@ +package one.mixin.android.db.datasource + +import androidx.paging.DataSource +import androidx.paging.PositionalDataSource +import androidx.room3.DaoReturnTypeConverter +import androidx.room3.OperationType +import androidx.room3.RoomDatabase +import androidx.room3.RoomRawQuery +import androidx.room3.useReaderConnection +import kotlinx.coroutines.runBlocking +import timber.log.Timber + +object DataSourceFactoryDaoReturnTypeConverter { + @DaoReturnTypeConverter(operations = [OperationType.READ]) + fun convert( + db: RoomDatabase, + tableNames: Array, + rawQuery: RoomRawQuery, + executeAndConvert: suspend (RoomRawQuery) -> List, + ): DataSource.Factory { + return object : DataSource.Factory() { + override fun create(): DataSource { + return RoomRawQueryDataSource(db, tableNames, rawQuery, executeAndConvert) + } + } + } +} + +private class RoomRawQueryDataSource( + private val db: RoomDatabase, + private val tableNames: Array, + private val rawQuery: RoomRawQuery, + private val executeAndConvert: suspend (RoomRawQuery) -> List, +) : PositionalDataSource() { + init { + RoomDatabaseCompat.observeInvalidation(db, this, *tableNames) + } + + override fun loadInitial( + params: LoadInitialParams, + callback: LoadInitialCallback, + ) { + val totalCount = countItems() + if (totalCount == 0) { + callback.onResult(emptyList(), 0, 0) + return + } + val firstLoadPosition = computeInitialLoadPosition(params, totalCount) + val firstLoadSize = computeInitialLoadSize(params, firstLoadPosition, totalCount) + val list = loadRange(firstLoadPosition, firstLoadSize) + try { + callback.onResult(list, firstLoadPosition, totalCount) + } catch (e: IllegalArgumentException) { + Timber.w(e) + try { + callback.onResult(list, firstLoadPosition, firstLoadPosition + list.size) + } catch (iae: IllegalArgumentException) { + Timber.w(iae) + } + } + } + + override fun loadRange( + params: LoadRangeParams, + callback: LoadRangeCallback, + ) { + callback.onResult(loadRange(params.startPosition, params.loadSize)) + } + + private fun countItems(): Int { + val countSql = "SELECT COUNT(*) FROM (${rawQuery.sql})" + return runBlocking(RoomDatabaseCompat.queryContext(db)) { + db.useReaderConnection { connection -> + connection.usePrepared(countSql) { statement -> + RoomRawQueryCompat.bind(rawQuery, statement) + if (statement.step()) statement.getLong(0).toInt() else 0 + } + } + } + } + + private fun loadRange( + startPosition: Int, + loadCount: Int, + ): List { + val limitOffsetQuery = + RoomRawQuery("${rawQuery.sql} LIMIT $loadCount OFFSET $startPosition") { statement -> + RoomRawQueryCompat.bind(rawQuery, statement) + } + return runBlocking(RoomDatabaseCompat.queryContext(db)) { + executeAndConvert(limitOffsetQuery) + } + } +} diff --git a/app/src/main/java/one/mixin/android/db/datasource/MixinCountLimitOffsetDataSource.kt b/app/src/main/java/one/mixin/android/db/datasource/MixinCountLimitOffsetDataSource.kt index b9884af50d..383ac13abe 100644 --- a/app/src/main/java/one/mixin/android/db/datasource/MixinCountLimitOffsetDataSource.kt +++ b/app/src/main/java/one/mixin/android/db/datasource/MixinCountLimitOffsetDataSource.kt @@ -5,29 +5,26 @@ import android.database.Cursor import android.os.CancellationSignal import androidx.paging.PagingSource import androidx.paging.PagingState -import androidx.room.RoomDatabase -import androidx.room.RoomSQLiteQuery -import androidx.room.paging.util.INITIAL_ITEM_COUNT -import androidx.room.paging.util.INVALID -import androidx.room.paging.util.getClippedRefreshKey -import androidx.room.paging.util.getLimit -import androidx.room.paging.util.getOffset -import androidx.room.withTransaction -import kotlinx.coroutines.asCoroutineDispatcher +import androidx.room3.RoomDatabase +import androidx.room3.paging.util.INITIAL_ITEM_COUNT +import androidx.room3.paging.util.getClippedRefreshKey +import androidx.room3.paging.util.getLimit +import androidx.room3.paging.util.getOffset +import androidx.room3.withReadTransaction import kotlinx.coroutines.withContext import java.util.concurrent.atomic.AtomicInteger @SuppressLint("RestrictedApi") abstract class MixinCountLimitOffsetDataSource( - private val offsetStatement: RoomSQLiteQuery, + private val offsetStatement: RoomQuery, private val fastCountCallback: () -> Int, - private val querySqlGenerator: (ids: String) -> RoomSQLiteQuery, + private val querySqlGenerator: (ids: String) -> RoomQuery, private val db: RoomDatabase, ) : PagingSource() { internal val itemCount: AtomicInteger = AtomicInteger(INITIAL_ITEM_COUNT) override suspend fun load(params: LoadParams): LoadResult { - return withContext(db.queryExecutor.asCoroutineDispatcher()) { + return withContext(RoomDatabaseCompat.queryContext(db)) { val tempCount = itemCount.get() // if itemCount is < 0, then it is initial load if (tempCount == INITIAL_ITEM_COUNT) { @@ -49,7 +46,7 @@ abstract class MixinCountLimitOffsetDataSource( * initial load. */ private suspend fun initialLoad(params: LoadParams): LoadResult { - return db.withTransaction { + return db.withReadTransaction { val tempCount = getItemCount() itemCount.set(tempCount) queryData(params = params, itemCount = tempCount) @@ -65,11 +62,8 @@ abstract class MixinCountLimitOffsetDataSource( tempCount: Int, ): LoadResult { val loadResult = queryData(params, tempCount) - // manually check if database has been updated. If so, the observer's - // invalidation callback will invalidate this paging source - db.invalidationTracker.refreshVersionsSync() @Suppress("UNCHECKED_CAST") - return if (invalid) INVALID as LoadResult.Invalid else loadResult + return if (invalid) LoadResult.Invalid() else loadResult } private fun queryData( @@ -80,7 +74,7 @@ abstract class MixinCountLimitOffsetDataSource( val key = params.key ?: 0 val limit: Int = getLimit(params, key) val offset: Int = getOffset(params, key, itemCount) - val offsetQuery = RoomSQLiteQuery.copyFrom(offsetStatement) + val offsetQuery = RoomQuery.copyFrom(offsetStatement) val argCount = offsetStatement.argCount offsetQuery.bindLong(argCount - 1, limit.toLong()) offsetQuery.bindLong(argCount, offset.toLong()) diff --git a/app/src/main/java/one/mixin/android/db/datasource/MixinLimitOffsetDataSource.kt b/app/src/main/java/one/mixin/android/db/datasource/MixinLimitOffsetDataSource.kt index 4603be3122..1686f8042b 100644 --- a/app/src/main/java/one/mixin/android/db/datasource/MixinLimitOffsetDataSource.kt +++ b/app/src/main/java/one/mixin/android/db/datasource/MixinLimitOffsetDataSource.kt @@ -4,22 +4,18 @@ import android.annotation.SuppressLint import android.database.Cursor import androidx.annotation.RestrictTo import androidx.paging.PositionalDataSource -import androidx.room.InvalidationTracker -import androidx.room.RoomDatabase -import androidx.room.RoomSQLiteQuery +import androidx.room3.RoomDatabase import timber.log.Timber @SuppressLint("RestrictedApi") @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) abstract class MixinLimitOffsetDataSource protected constructor( private val db: RoomDatabase, - private val countQuery: RoomSQLiteQuery, - private val offsetStatement: RoomSQLiteQuery, - private val querySqlGenerator: (String) -> RoomSQLiteQuery, + private val countQuery: RoomQuery, + private val offsetStatement: RoomQuery, + private val querySqlGenerator: (String) -> RoomQuery, private val tables: Array, ) : PositionalDataSource() { - private val observer: InvalidationTracker.Observer - /** * Count number of rows query can return */ @@ -33,7 +29,6 @@ abstract class MixinLimitOffsetDataSource protected constructor( } } finally { cursor.close() - countQuery.release() } } @@ -89,7 +84,6 @@ abstract class MixinLimitOffsetDataSource protected constructor( return convertRows(cursor) } finally { cursor.close() - sqLiteQuery.release() } } @@ -97,7 +91,7 @@ abstract class MixinLimitOffsetDataSource protected constructor( startPosition: Int, loadCount: Int, ): String { - val offsetQuery = RoomSQLiteQuery.copyFrom(offsetStatement) + val offsetQuery = RoomQuery.copyFrom(offsetStatement) val argCount = offsetStatement.argCount offsetQuery.bindLong(argCount - 1, loadCount.toLong()) offsetQuery.bindLong(argCount, startPosition.toLong()) @@ -111,17 +105,10 @@ abstract class MixinLimitOffsetDataSource protected constructor( return ids.joinToString() } finally { cursor.close() - offsetQuery.release() } } init { - observer = - object : InvalidationTracker.Observer(tables) { - override fun onInvalidated(tables: Set) { - invalidate() - } - } - db.invalidationTracker.addWeakObserver(observer) + RoomDatabaseCompat.observeInvalidation(db, this, *tables) } } diff --git a/app/src/main/java/one/mixin/android/db/datasource/MixinNonCountLimitOffsetDataSource.kt b/app/src/main/java/one/mixin/android/db/datasource/MixinNonCountLimitOffsetDataSource.kt index 16e2fa30d2..016b6aaddc 100644 --- a/app/src/main/java/one/mixin/android/db/datasource/MixinNonCountLimitOffsetDataSource.kt +++ b/app/src/main/java/one/mixin/android/db/datasource/MixinNonCountLimitOffsetDataSource.kt @@ -5,32 +5,26 @@ import android.database.Cursor import android.os.CancellationSignal import androidx.paging.PagingSource import androidx.paging.PagingState -import androidx.room.RoomDatabase -import androidx.room.RoomSQLiteQuery -import androidx.room.paging.util.ThreadSafeInvalidationObserver -import androidx.room.paging.util.getClippedRefreshKey -import androidx.room.paging.util.getLimit -import androidx.room.paging.util.getOffset -import androidx.room.withTransaction -import kotlinx.coroutines.asCoroutineDispatcher +import androidx.room3.RoomDatabase +import androidx.room3.paging.util.getClippedRefreshKey +import androidx.room3.paging.util.getLimit +import androidx.room3.paging.util.getOffset +import androidx.room3.withReadTransaction import kotlinx.coroutines.withContext @SuppressLint("RestrictedApi") abstract class MixinNonCountLimitOffsetDataSource( - private val offsetStatement: RoomSQLiteQuery, + private val offsetStatement: RoomQuery, private val totalCount: Int, private val db: RoomDatabase, vararg tables: String, ) : PagingSource() { - private val observer = - ThreadSafeInvalidationObserver( - tables = tables, - onInvalidated = ::invalidate, - ) + init { + RoomDatabaseCompat.observeInvalidation(db, this, *tables) + } override suspend fun load(params: LoadParams): LoadResult { - return withContext(db.queryExecutor.asCoroutineDispatcher()) { - observer.registerIfNecessary(db) + return withContext(RoomDatabaseCompat.queryContext(db)) { initialLoad(params) } } @@ -46,7 +40,7 @@ abstract class MixinNonCountLimitOffsetDataSource( * initial load. */ private suspend fun initialLoad(params: LoadParams): LoadResult { - return db.withTransaction { + return db.withReadTransaction { queryData( params = params, itemCount = totalCount, @@ -62,7 +56,7 @@ abstract class MixinNonCountLimitOffsetDataSource( val key = params.key ?: 0 val limit: Int = getLimit(params, key) val offset: Int = getOffset(params, key, itemCount) - val offsetQuery = RoomSQLiteQuery.copyFrom(offsetStatement) + val offsetQuery = RoomQuery.copyFrom(offsetStatement) val argCount = offsetStatement.argCount offsetQuery.bindLong(argCount - 1, limit.toLong()) offsetQuery.bindLong(argCount, offset.toLong()) diff --git a/app/src/main/java/one/mixin/android/db/datasource/NoCountLimitOffsetDataSource.java b/app/src/main/java/one/mixin/android/db/datasource/NoCountLimitOffsetDataSource.java index c5f99ea42b..87a1797fe3 100644 --- a/app/src/main/java/one/mixin/android/db/datasource/NoCountLimitOffsetDataSource.java +++ b/app/src/main/java/one/mixin/android/db/datasource/NoCountLimitOffsetDataSource.java @@ -7,42 +7,28 @@ import androidx.annotation.Nullable; import androidx.annotation.RestrictTo; import androidx.paging.PositionalDataSource; -import androidx.room.InvalidationTracker; -import androidx.room.RoomDatabase; -import androidx.room.RoomSQLiteQuery; +import androidx.room3.RoomDatabase; import java.util.List; -import java.util.Set; import timber.log.Timber; @SuppressLint("RestrictedApi") @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) public abstract class NoCountLimitOffsetDataSource extends PositionalDataSource { - private final RoomSQLiteQuery mSourceQuery; - private final String mLimitOffsetQuery; + private final RoomQuery mSourceQuery; private final int mTotalCount; private final RoomDatabase mDb; - @SuppressWarnings("FieldCanBeLocal") - private final InvalidationTracker.Observer mObserver; - protected NoCountLimitOffsetDataSource(RoomDatabase db, RoomSQLiteQuery query, int count, String... tables) { + protected NoCountLimitOffsetDataSource(RoomDatabase db, RoomQuery query, int count, String... tables) { mDb = db; mTotalCount = count; mSourceQuery = query; - mLimitOffsetQuery = mSourceQuery.getSql() + " LIMIT ? OFFSET ?"; - mObserver = new InvalidationTracker.Observer(tables) { - @Override - public void onInvalidated(@NonNull Set tables) { - invalidate(); - } - }; - db.getInvalidationTracker().addWeakObserver(mObserver); + RoomDatabaseCompat.observeInvalidation(db, this, tables); } @Override public boolean isInvalid() { - mDb.getInvalidationTracker().refreshVersionsSync(); return super.isInvalid(); } @@ -82,18 +68,13 @@ public void loadRange(@NonNull LoadRangeParams params, @Nullable public List loadRange(int startPosition, int loadCount) { - final RoomSQLiteQuery sqLiteQuery = RoomSQLiteQuery.acquire(mLimitOffsetQuery, - mSourceQuery.getArgCount() + 2); - sqLiteQuery.copyArgumentsFrom(mSourceQuery); - sqLiteQuery.bindLong(sqLiteQuery.getArgCount() - 1, loadCount); - sqLiteQuery.bindLong(sqLiteQuery.getArgCount(), startPosition); - Cursor cursor = mDb.query(sqLiteQuery); + final RoomQuery sqLiteQuery = mSourceQuery.withLimitOffset(loadCount, startPosition); + Cursor cursor = RoomDatabaseCompat.query(mDb, sqLiteQuery); //noinspection TryFinallyCanBeTryWithResources try { return convertRows(cursor); } finally { cursor.close(); - sqLiteQuery.release(); } } } diff --git a/app/src/main/java/one/mixin/android/db/datasource/RoomDatabaseCompat.kt b/app/src/main/java/one/mixin/android/db/datasource/RoomDatabaseCompat.kt new file mode 100644 index 0000000000..8bff223af3 --- /dev/null +++ b/app/src/main/java/one/mixin/android/db/datasource/RoomDatabaseCompat.kt @@ -0,0 +1,181 @@ +package one.mixin.android.db.datasource + +import android.database.Cursor +import android.os.CancellationSignal +import androidx.paging.DataSource +import androidx.paging.PagingSource +import androidx.room3.PooledConnection +import androidx.room3.RoomDatabase +import androidx.room3.RoomRawQuery +import androidx.room3.Transactor.SQLiteTransactionType +import androidx.room3.useReaderConnection +import androidx.room3.useWriterConnection +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Job +import kotlinx.coroutines.flow.drop +import kotlinx.coroutines.launch +import kotlinx.coroutines.runBlocking +import kotlin.coroutines.CoroutineContext + +object RoomDatabaseCompat { + @JvmStatic + fun queryContext(db: RoomDatabase): CoroutineContext = db.getQueryContext() + + @JvmStatic + fun query( + db: RoomDatabase, + query: RoomRawQuery, + ): Cursor = query(db, query, null) + + @JvmStatic + fun query( + db: RoomDatabase, + query: RoomRawQuery, + cancellationSignal: CancellationSignal?, + ): Cursor = + runBlocking(queryContext(db)) { + cancellationSignal?.throwIfCanceled() + db.useReaderConnection { connection -> + connection.usePrepared(query.sql) { statement -> + RoomRawQueryCompat.bind(query, statement) + cancellationSignal?.throwIfCanceled() + statement.toCursor() + } + } + } + + @JvmStatic + fun query( + db: RoomDatabase, + query: RoomQuery, + ): Cursor = query(db, query.toRoomRawQuery(), null) + + @JvmStatic + fun query( + db: RoomDatabase, + query: RoomQuery, + cancellationSignal: CancellationSignal?, + ): Cursor = query(db, query.toRoomRawQuery(), cancellationSignal) + + @JvmStatic + fun query( + db: RoomDatabase, + sql: String, + bindArgs: Array = emptyArray(), + ): Cursor { + return query( + db, + RoomRawQuery(sql) { statement -> + bindArgs.forEachIndexed { index, value -> + statement.bindArg(index + 1, value) + } + }, + ) + } + + @JvmStatic + fun execute( + db: RoomDatabase, + sql: String, + bindArgs: Array = emptyArray(), + ) { + runBlocking(queryContext(db)) { + db.useWriterConnection { connection -> + connection.execSQL(sql, bindArgs) + } + } + } + + @JvmStatic + fun statementDatabase(db: RoomDatabase): RoomStatementDatabase = RoomStatementDatabase(db) + + fun runInWriteTransaction( + db: RoomDatabase, + block: suspend androidx.room3.TransactionScope.() -> T, + ): T { + return runBlocking(queryContext(db)) { + db.useWriterConnection { connection -> + connection.withTransaction(SQLiteTransactionType.IMMEDIATE, block) + } + } + } + + @JvmStatic + fun observeInvalidation( + db: RoomDatabase, + dataSource: DataSource<*, *>, + vararg tables: String, + ) { + val job = observeInvalidationForTables(db.getCoroutineScope(), db, tables) { dataSource.invalidate() } + dataSource.addInvalidatedCallback { job.cancel() } + } + + @JvmStatic + fun observeInvalidation( + db: RoomDatabase, + pagingSource: PagingSource<*, *>, + vararg tables: String, + ) { + val job = observeInvalidationForTables(db.getCoroutineScope(), db, tables) { pagingSource.invalidate() } + pagingSource.registerInvalidatedCallback { job.cancel() } + } + + @JvmStatic + fun observeInvalidation( + scope: CoroutineScope, + db: RoomDatabase, + tableName: String, + onInvalidated: Runnable, + ): Job = observeInvalidationForTables(scope, db, arrayOf(tableName)) { onInvalidated.run() } + + fun observeInvalidation( + scope: CoroutineScope, + db: RoomDatabase, + vararg tables: String, + onInvalidated: () -> Unit, + ): Job = observeInvalidationForTables(scope, db, tables, onInvalidated) + + private fun observeInvalidationForTables( + scope: CoroutineScope, + db: RoomDatabase, + tables: Array, + onInvalidated: () -> Unit, + ): Job { + return scope.launch { + db.invalidationTracker.createFlow(*tables) + .drop(1) + .collect { onInvalidated() } + } + } +} + +suspend fun PooledConnection.execSQL( + sql: String, + bindArgs: Array = emptyArray(), +) { + usePrepared(sql) { statement -> + bindArgs.forEachIndexed { index, value -> + statement.bindArg(index + 1, value) + } + statement.step() + } +} + +fun RoomDatabase.query(query: RoomRawQuery): Cursor = RoomDatabaseCompat.query(this, query) + +fun RoomDatabase.query( + query: RoomRawQuery, + cancellationSignal: CancellationSignal?, +): Cursor = RoomDatabaseCompat.query(this, query, cancellationSignal) + +fun RoomDatabase.query(query: RoomQuery): Cursor = RoomDatabaseCompat.query(this, query) + +fun RoomDatabase.query( + query: RoomQuery, + cancellationSignal: CancellationSignal?, +): Cursor = RoomDatabaseCompat.query(this, query, cancellationSignal) + +fun RoomDatabase.query( + sql: String, + bindArgs: Array = emptyArray(), +): Cursor = RoomDatabaseCompat.query(this, sql, bindArgs) diff --git a/app/src/main/java/one/mixin/android/db/datasource/RoomQuery.kt b/app/src/main/java/one/mixin/android/db/datasource/RoomQuery.kt new file mode 100644 index 0000000000..60df56abed --- /dev/null +++ b/app/src/main/java/one/mixin/android/db/datasource/RoomQuery.kt @@ -0,0 +1,93 @@ +package one.mixin.android.db.datasource + +import androidx.room3.RoomRawQuery +import androidx.sqlite.SQLiteStatement + +class RoomQuery private constructor( + val sql: String, + private val bindArgs: Array, +) { + val argCount: Int + get() = bindArgs.size + + fun bindNull(index: Int) { + bindArgs[index - 1] = null + } + + fun bindLong(index: Int, value: Long) { + bindArgs[index - 1] = value + } + + fun bindDouble(index: Int, value: Double) { + bindArgs[index - 1] = value + } + + fun bindString(index: Int, value: String) { + bindArgs[index - 1] = value + } + + fun bindBlob(index: Int, value: ByteArray) { + bindArgs[index - 1] = value + } + + fun copyArgumentsFrom(other: RoomQuery) { + val count = minOf(bindArgs.size, other.bindArgs.size) + for (i in 0 until count) { + bindArgs[i] = other.bindArgs[i] + } + } + + fun release() = Unit + + fun toRoomRawQuery(): RoomRawQuery { + return RoomRawQuery(sql) { statement -> + bindArgs.forEachIndexed { index, value -> + statement.bindArg(index + 1, value) + } + } + } + + fun bindTo(statement: SQLiteStatement) { + bindArgs.forEachIndexed { index, value -> + statement.bindArg(index + 1, value) + } + } + + fun withLimitOffset( + limit: Int, + offset: Int, + ): RoomQuery { + val args = bindArgs.copyOf(bindArgs.size + 2) + args[bindArgs.size] = limit.toLong() + args[bindArgs.size + 1] = offset.toLong() + return RoomQuery("$sql LIMIT ? OFFSET ?", args) + } + + companion object { + @JvmStatic + fun acquire( + sql: String, + argCount: Int, + ): RoomQuery = RoomQuery(sql, arrayOfNulls(argCount)) + + @JvmStatic + fun copyFrom(other: RoomQuery): RoomQuery { + return RoomQuery(other.sql, other.bindArgs.copyOf()) + } + } +} + +fun SQLiteStatement.bindArg( + index: Int, + value: Any?, +) { + when (value) { + null -> bindNull(index) + is ByteArray -> bindBlob(index, value) + is Float -> bindDouble(index, value.toDouble()) + is Double -> bindDouble(index, value) + is Number -> bindLong(index, value.toLong()) + is Boolean -> bindLong(index, if (value) 1L else 0L) + else -> bindText(index, value.toString()) + } +} diff --git a/app/src/main/java/one/mixin/android/db/datasource/RoomRawQueryCompat.kt b/app/src/main/java/one/mixin/android/db/datasource/RoomRawQueryCompat.kt new file mode 100644 index 0000000000..0a947158c0 --- /dev/null +++ b/app/src/main/java/one/mixin/android/db/datasource/RoomRawQueryCompat.kt @@ -0,0 +1,19 @@ +package one.mixin.android.db.datasource + +import androidx.room3.RoomRawQuery +import androidx.sqlite.SQLiteStatement + +private val roomRawQueryBindingFunctionMethod by lazy { + RoomRawQuery::class.java.getDeclaredMethod("getBindingFunction") +} + +internal object RoomRawQueryCompat { + @Suppress("UNCHECKED_CAST") + fun bind( + query: RoomRawQuery, + statement: SQLiteStatement, + ) { + val bindingFunction = roomRawQueryBindingFunctionMethod.invoke(query) as (SQLiteStatement) -> Unit + bindingFunction(statement) + } +} diff --git a/app/src/main/java/one/mixin/android/db/datasource/RoomStatementDatabase.kt b/app/src/main/java/one/mixin/android/db/datasource/RoomStatementDatabase.kt new file mode 100644 index 0000000000..8485ed25f2 --- /dev/null +++ b/app/src/main/java/one/mixin/android/db/datasource/RoomStatementDatabase.kt @@ -0,0 +1,94 @@ +package one.mixin.android.db.datasource + +import androidx.room3.RoomDatabase + +class RoomStatementDatabase internal constructor( + private val db: RoomDatabase, +) { + private var transactionStatements: MutableList>>? = null + private var transactionSuccessful = false + + fun compileStatement(sql: String): RoomStatement = RoomStatement(this, sql) + + fun beginTransaction() { + transactionStatements = mutableListOf() + transactionSuccessful = false + } + + fun setTransactionSuccessful() { + transactionSuccessful = true + } + + fun endTransaction() { + val statements = transactionStatements + transactionStatements = null + if (transactionSuccessful && statements != null) { + RoomDatabaseCompat.runInWriteTransaction(db) { + statements.forEach { (sql, bindArgs) -> + execSQL(sql, bindArgs) + } + } + } + transactionSuccessful = false + } + + internal fun execute( + sql: String, + bindArgs: Array, + ) { + val statements = transactionStatements + if (statements == null) { + RoomDatabaseCompat.execute(db, sql, bindArgs) + } else { + statements += sql to bindArgs + } + } +} + +class RoomStatement internal constructor( + private val db: RoomStatementDatabase, + private val sql: String, +) { + private val bindArgs = linkedMapOf() + + fun bindNull(index: Int) { + bindArgs[index] = null + } + + fun bindLong( + index: Int, + value: Long, + ) { + bindArgs[index] = value + } + + fun bindLong( + index: Int, + value: Int, + ) { + bindArgs[index] = value.toLong() + } + + fun bindString( + index: Int, + value: String, + ) { + bindArgs[index] = value + } + + fun bindBlob( + index: Int, + value: ByteArray, + ) { + bindArgs[index] = value + } + + fun executeInsert(): Long { + val args = Array((bindArgs.keys.maxOrNull() ?: 0)) { index -> bindArgs[index + 1] } + db.execute(sql, args) + bindArgs.clear() + return -1L + } + + fun close() = Unit +} diff --git a/app/src/main/java/one/mixin/android/db/datasource/SQLiteConnectionCompat.kt b/app/src/main/java/one/mixin/android/db/datasource/SQLiteConnectionCompat.kt new file mode 100644 index 0000000000..f954b0d99f --- /dev/null +++ b/app/src/main/java/one/mixin/android/db/datasource/SQLiteConnectionCompat.kt @@ -0,0 +1,62 @@ +package one.mixin.android.db.datasource + +import android.content.ContentValues +import android.database.Cursor +import android.database.sqlite.SQLiteDatabase +import androidx.sqlite.SQLiteConnection + +fun SQLiteConnection.execSQL(sql: String) { + prepare(sql).use { it.step() } +} + +fun SQLiteConnection.execSQL( + sql: String, + bindArgs: Array, +) { + prepare(sql).use { statement -> + bindArgs.forEachIndexed { index, value -> + statement.bindArg(index + 1, value) + } + statement.step() + } +} + +fun SQLiteConnection.query(sql: String): Cursor = prepare(sql).toCursor() + +fun SQLiteConnection.insert( + table: String, + conflictAlgorithm: Int, + values: ContentValues, +): Long { + val columns = values.keySet().toList() + val conflictClause = + when (conflictAlgorithm) { + SQLiteDatabase.CONFLICT_ROLLBACK -> "OR ROLLBACK " + SQLiteDatabase.CONFLICT_ABORT -> "OR ABORT " + SQLiteDatabase.CONFLICT_FAIL -> "OR FAIL " + SQLiteDatabase.CONFLICT_IGNORE -> "OR IGNORE " + SQLiteDatabase.CONFLICT_REPLACE -> "OR REPLACE " + else -> "" + } + val sql = + if (columns.isEmpty()) { + "INSERT ${conflictClause}INTO `$table` DEFAULT VALUES" + } else { + val columnList = columns.joinToString(", ") { "`$it`" } + val placeholders = columns.joinToString(", ") { "?" } + "INSERT ${conflictClause}INTO `$table` ($columnList) VALUES ($placeholders)" + } + prepare(sql).use { statement -> + columns.forEachIndexed { index, column -> + statement.bindArg(index + 1, values.get(column)) + } + statement.step() + } + return lastInsertRowId() +} + +private fun SQLiteConnection.lastInsertRowId(): Long { + return prepare("SELECT last_insert_rowid()").use { statement -> + if (statement.step()) statement.getLong(0) else -1L + } +} diff --git a/app/src/main/java/one/mixin/android/db/datasource/SQLiteStatementCursor.kt b/app/src/main/java/one/mixin/android/db/datasource/SQLiteStatementCursor.kt new file mode 100644 index 0000000000..708176ffe2 --- /dev/null +++ b/app/src/main/java/one/mixin/android/db/datasource/SQLiteStatementCursor.kt @@ -0,0 +1,95 @@ +package one.mixin.android.db.datasource + +import android.database.AbstractCursor +import android.database.Cursor +import androidx.sqlite.SQLiteStatement + +internal class SQLiteStatementCursor private constructor( + private val names: Array, + private val rows: List>, +) : AbstractCursor() { + override fun getCount(): Int = rows.size + + override fun getColumnNames(): Array = names + + override fun getString(column: Int): String? { + return value(column)?.let { + when (it) { + is ByteArray -> String(it) + else -> it.toString() + } + } + } + + override fun getShort(column: Int): Short = getLong(column).toShort() + + override fun getInt(column: Int): Int = getLong(column).toInt() + + override fun getLong(column: Int): Long { + return when (val value = value(column)) { + null -> 0L + is Number -> value.toLong() + is Boolean -> if (value) 1L else 0L + else -> value.toString().toLong() + } + } + + override fun getFloat(column: Int): Float = getDouble(column).toFloat() + + override fun getDouble(column: Int): Double { + return when (val value = value(column)) { + null -> 0.0 + is Number -> value.toDouble() + is Boolean -> if (value) 1.0 else 0.0 + else -> value.toString().toDouble() + } + } + + override fun getBlob(column: Int): ByteArray? { + return when (val value = value(column)) { + null -> null + is ByteArray -> value + else -> value.toString().toByteArray() + } + } + + override fun isNull(column: Int): Boolean = value(column) == null + + override fun getType(column: Int): Int { + return when (value(column)) { + null -> Cursor.FIELD_TYPE_NULL + is ByteArray -> Cursor.FIELD_TYPE_BLOB + is Float, is Double -> Cursor.FIELD_TYPE_FLOAT + is Number, is Boolean -> Cursor.FIELD_TYPE_INTEGER + else -> Cursor.FIELD_TYPE_STRING + } + } + + private fun value(column: Int): Any? = rows[position][column] + + companion object { + fun from(statement: SQLiteStatement): Cursor { + statement.use { + val columnCount = it.getColumnCount() + val columnNames = Array(columnCount) { index -> it.getColumnName(index) } + val rows = mutableListOf>() + while (it.step()) { + rows += Array(columnCount) { index -> it.readValue(index) } + } + return SQLiteStatementCursor(columnNames, rows) + } + } + + private fun SQLiteStatement.readValue(index: Int): Any? { + if (isNull(index)) return null + return when (getColumnType(index)) { + Cursor.FIELD_TYPE_BLOB -> getBlob(index) + Cursor.FIELD_TYPE_FLOAT -> getDouble(index) + Cursor.FIELD_TYPE_INTEGER -> getLong(index) + else -> getText(index) + } + } + } +} + +fun SQLiteStatement.toCursor(): Cursor = SQLiteStatementCursor.from(this) diff --git a/app/src/main/java/one/mixin/android/db/pending/PendingDatabase.kt b/app/src/main/java/one/mixin/android/db/pending/PendingDatabase.kt index 176b2d6702..a6c7bff98c 100644 --- a/app/src/main/java/one/mixin/android/db/pending/PendingDatabase.kt +++ b/app/src/main/java/one/mixin/android/db/pending/PendingDatabase.kt @@ -1,6 +1,7 @@ package one.mixin.android.db.pending -import androidx.room.InvalidationTracker +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Job as CoroutineJob import one.mixin.android.db.FloodMessageDao import one.mixin.android.db.JobDao import one.mixin.android.vo.FloodMessage @@ -25,9 +26,11 @@ interface PendingDatabase { fun insertFloodMessage(floodMessage: FloodMessage) - fun addObserver(observer: InvalidationTracker.Observer) - - fun removeObserver(observer: InvalidationTracker.Observer) + fun observeInvalidation( + scope: CoroutineScope, + tableName: String, + onInvalidated: () -> Unit, + ): CoroutineJob fun deleteFloodMessage(floodMessage: FloodMessage) diff --git a/app/src/main/java/one/mixin/android/db/pending/PendingDatabaseImp.kt b/app/src/main/java/one/mixin/android/db/pending/PendingDatabaseImp.kt index 8e5473b2fa..da8fe737ce 100644 --- a/app/src/main/java/one/mixin/android/db/pending/PendingDatabaseImp.kt +++ b/app/src/main/java/one/mixin/android/db/pending/PendingDatabaseImp.kt @@ -5,14 +5,18 @@ import android.content.Context import android.database.Cursor import android.database.sqlite.SQLiteDatabase import android.util.ArrayMap -import androidx.room.Database -import androidx.room.InvalidationTracker -import androidx.room.Room -import androidx.room.RoomDatabase -import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room3.Database +import androidx.room3.DaoReturnTypeConverters +import androidx.room3.Room +import androidx.room3.RoomDatabase +import androidx.room3.livedata.LiveDataDaoReturnTypeConverter +import androidx.sqlite.SQLiteConnection +import androidx.sqlite.driver.AndroidSQLiteDriver import one.mixin.android.Constants.DataBase.PENDING_DB_NAME import one.mixin.android.db.FloodMessageDao import one.mixin.android.db.JobDao +import one.mixin.android.db.datasource.RoomDatabaseCompat +import one.mixin.android.db.datasource.insert import one.mixin.android.db.insertNoReplace import one.mixin.android.util.GsonHelper import one.mixin.android.util.database.dbDir @@ -21,6 +25,8 @@ import one.mixin.android.vo.FloodMessage import one.mixin.android.vo.Job import one.mixin.android.vo.MessageMedia import java.io.File +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Job as CoroutineJob @Database( entities = [ @@ -30,6 +36,7 @@ import java.io.File ], version = 1, ) +@DaoReturnTypeConverters(LiveDataDaoReturnTypeConverter::class) abstract class PendingDatabaseImp : RoomDatabase(), PendingDatabase { abstract override fun floodMessageDao(): FloodMessageDao @@ -55,7 +62,6 @@ abstract class PendingDatabaseImp : RoomDatabase(), PendingDatabase { if (INSTANCE != null && currentIdentityNumber != scopedIdentity) { INSTANCE?.close() INSTANCE = null - supportSQLiteDatabase = null } if (INSTANCE == null) { val dbPath = File(dbDir(context, scopedIdentity), PENDING_DB_NAME).absolutePath @@ -64,14 +70,14 @@ abstract class PendingDatabaseImp : RoomDatabase(), PendingDatabase { context, PendingDatabaseImp::class.java, dbPath, - ).enableMultiInstanceInvalidation().addCallback( + ).setDriver(AndroidSQLiteDriver()) + .enableMultiInstanceInvalidation().addCallback( object : Callback() { - override fun onOpen(db: SupportSQLiteDatabase) { + override suspend fun onOpen(db: SQLiteConnection) { super.onOpen(db) - supportSQLiteDatabase = db } - override fun onCreate(db: SupportSQLiteDatabase) { + override suspend fun onCreate(db: SQLiteConnection) { while (true) { val list = floodMessageDao.limit100() list.forEach { msg -> @@ -110,21 +116,21 @@ abstract class PendingDatabaseImp : RoomDatabase(), PendingDatabase { } }, ) - INSTANCE = builder.build() + val database = builder.build() + INSTANCE = database currentIdentityNumber = scopedIdentity } } return INSTANCE as PendingDatabaseImp } - private var supportSQLiteDatabase: SupportSQLiteDatabase? = null - fun query(query: String): String? { val start = System.currentTimeMillis() var cursor: Cursor? = null try { + val database = INSTANCE ?: return null cursor = - supportSQLiteDatabase?.query(query) ?: return null + RoomDatabaseCompat.query(database, query) cursor.moveToFirst() val result = ArrayList>() do { @@ -167,13 +173,11 @@ abstract class PendingDatabaseImp : RoomDatabase(), PendingDatabase { override fun deleteFloodMessage(floodMessage: FloodMessage) = floodMessageDao().delete(floodMessage) - override fun addObserver(observer: InvalidationTracker.Observer) { - invalidationTracker.addObserver(observer) - } - - override fun removeObserver(observer: InvalidationTracker.Observer) { - invalidationTracker.removeObserver(observer) - } + override fun observeInvalidation( + scope: CoroutineScope, + tableName: String, + onInvalidated: () -> Unit, + ): CoroutineJob = RoomDatabaseCompat.observeInvalidation(scope, this, tableName) { onInvalidated() } override fun insertJobs(jobs: List) { jobDao().insertList(jobs) @@ -192,7 +196,6 @@ abstract class PendingDatabaseImp : RoomDatabase(), PendingDatabase { synchronized(lock) { INSTANCE = null currentIdentityNumber = null - supportSQLiteDatabase = null } } } diff --git a/app/src/main/java/one/mixin/android/db/pending/PendingMessage.kt b/app/src/main/java/one/mixin/android/db/pending/PendingMessage.kt index ddb6937c81..0b5944f9d6 100644 --- a/app/src/main/java/one/mixin/android/db/pending/PendingMessage.kt +++ b/app/src/main/java/one/mixin/android/db/pending/PendingMessage.kt @@ -1,8 +1,8 @@ package one.mixin.android.db.pending -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import one.mixin.android.vo.Message diff --git a/app/src/main/java/one/mixin/android/db/pending/PendingMessageDao.kt b/app/src/main/java/one/mixin/android/db/pending/PendingMessageDao.kt index fd45d2ff57..9370869b4b 100644 --- a/app/src/main/java/one/mixin/android/db/pending/PendingMessageDao.kt +++ b/app/src/main/java/one/mixin/android/db/pending/PendingMessageDao.kt @@ -1,9 +1,9 @@ package one.mixin.android.db.pending import androidx.lifecycle.LiveData -import androidx.room.Dao -import androidx.room.Query -import androidx.room.RoomWarnings +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.RoomWarnings import one.mixin.android.db.BaseDao import one.mixin.android.vo.ConversationWithStatus import one.mixin.android.vo.Message @@ -46,7 +46,7 @@ interface PendingMessageDao : BaseDao { messageId: String, ): String? - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query("SELECT category, id, conversation_id, media_url FROM pending_messages WHERE id = :messageId") fun findMessageMediaById(messageId: String): MessageMedia? diff --git a/app/src/main/java/one/mixin/android/db/perps/PerpsMarketDao.kt b/app/src/main/java/one/mixin/android/db/perps/PerpsMarketDao.kt index fb1dbaddf7..c0b5a48952 100644 --- a/app/src/main/java/one/mixin/android/db/perps/PerpsMarketDao.kt +++ b/app/src/main/java/one/mixin/android/db/perps/PerpsMarketDao.kt @@ -1,9 +1,9 @@ package one.mixin.android.db.perps -import androidx.room.Dao -import androidx.room.Insert -import androidx.room.OnConflictStrategy -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Insert +import androidx.room3.OnConflictStrategy +import androidx.room3.Query import kotlinx.coroutines.flow.Flow import one.mixin.android.api.response.perps.PerpsMarket import one.mixin.android.db.BaseDao diff --git a/app/src/main/java/one/mixin/android/db/perps/PerpsOrderDao.kt b/app/src/main/java/one/mixin/android/db/perps/PerpsOrderDao.kt index cea57b84ff..bdf201e45c 100644 --- a/app/src/main/java/one/mixin/android/db/perps/PerpsOrderDao.kt +++ b/app/src/main/java/one/mixin/android/db/perps/PerpsOrderDao.kt @@ -1,10 +1,10 @@ package one.mixin.android.db.perps import androidx.paging.PagingSource -import androidx.room.Dao -import androidx.room.Insert -import androidx.room.OnConflictStrategy -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Insert +import androidx.room3.OnConflictStrategy +import androidx.room3.Query import kotlinx.coroutines.flow.Flow import one.mixin.android.api.response.perps.PerpsOrder import one.mixin.android.api.response.perps.PerpsOrderItem diff --git a/app/src/main/java/one/mixin/android/db/perps/PerpsPositionDao.kt b/app/src/main/java/one/mixin/android/db/perps/PerpsPositionDao.kt index 0ef4439edf..f71d3febc2 100644 --- a/app/src/main/java/one/mixin/android/db/perps/PerpsPositionDao.kt +++ b/app/src/main/java/one/mixin/android/db/perps/PerpsPositionDao.kt @@ -1,10 +1,10 @@ package one.mixin.android.db.perps import androidx.paging.PagingSource -import androidx.room.Dao -import androidx.room.Insert -import androidx.room.OnConflictStrategy -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Insert +import androidx.room3.OnConflictStrategy +import androidx.room3.Query import kotlinx.coroutines.flow.Flow import one.mixin.android.api.response.perps.PerpsPosition import one.mixin.android.api.response.perps.PerpsPositionItem diff --git a/app/src/main/java/one/mixin/android/db/provider/DataConverter.kt b/app/src/main/java/one/mixin/android/db/provider/DataConverter.kt index eed2976cf1..f2257b80f0 100644 --- a/app/src/main/java/one/mixin/android/db/provider/DataConverter.kt +++ b/app/src/main/java/one/mixin/android/db/provider/DataConverter.kt @@ -3,9 +3,8 @@ package one.mixin.android.db.provider import android.annotation.SuppressLint import android.database.Cursor import android.os.CancellationSignal -import androidx.room.RoomSQLiteQuery -import androidx.room.util.getColumnIndexOrThrow -import androidx.room.util.query +import one.mixin.android.db.datasource.RoomDatabaseCompat +import one.mixin.android.db.datasource.RoomQuery import one.mixin.android.db.MixinDatabase import one.mixin.android.db.converter.DepositEntryListConverter import one.mixin.android.db.converter.MembershipConverter @@ -24,6 +23,11 @@ import one.mixin.android.vo.safe.SafeCollectible import one.mixin.android.vo.safe.TokenItem import java.util.concurrent.Callable +private fun getColumnIndexOrThrow( + cursor: Cursor, + columnName: String, +): Int = cursor.getColumnIndexOrThrow(columnName) + @SuppressLint("RestrictedApi") fun convertToConversationItems(cursor: Cursor?): List { cursor ?: return emptyList() @@ -420,11 +424,11 @@ fun convertToMessageItems(cursor: Cursor?): ArrayList { @SuppressLint("RestrictedApi") fun callableUser( db: MixinDatabase, - statement: RoomSQLiteQuery, + statement: RoomQuery, cancellationSignal: CancellationSignal, ): Callable> { return Callable> { - val cursor = query(db, statement, false, cancellationSignal) + val cursor = RoomDatabaseCompat.query(db, statement, cancellationSignal) try { val cursorIndexOfUserId = getColumnIndexOrThrow(cursor, "user_id") @@ -568,7 +572,6 @@ fun callableUser( return@Callable result } finally { cursor.close() - statement.release() } } } @@ -577,11 +580,11 @@ fun callableUser( @SuppressLint("RestrictedApi") fun callableBot( db: MixinDatabase, - statement: RoomSQLiteQuery, + statement: RoomQuery, cancellationSignal: CancellationSignal, ): Callable> { return Callable> { - val cursor = query(db, statement, false, cancellationSignal) + val cursor = RoomDatabaseCompat.query(db, statement, cancellationSignal) try { val cursorIndexOfUserId = getColumnIndexOrThrow(cursor, "user_id") @@ -725,7 +728,6 @@ fun callableBot( return@Callable result } finally { cursor.close() - statement.release() } } } @@ -741,11 +743,11 @@ private val membershipConverter by lazy { @SuppressLint("RestrictedApi") fun callableTokenItem( db: MixinDatabase, - statement: RoomSQLiteQuery, + statement: RoomQuery, cancellationSignal: CancellationSignal, ): Callable> { return Callable> { - val cursor = query(db, statement, false, cancellationSignal) + val cursor = RoomDatabaseCompat.query(db, statement, cancellationSignal) try { val cursorIndexOfAssetId = 0 val cursorIndexOfSymbol = 1 @@ -913,7 +915,6 @@ fun callableTokenItem( return@Callable result } finally { cursor.close() - statement.release() } } } @@ -1026,11 +1027,11 @@ fun convertToSearchMessageItems(cursor: Cursor?): List { @SuppressLint("RestrictedApi") fun callableChatMinimal( db: MixinDatabase, - statement: RoomSQLiteQuery, + statement: RoomQuery, cancellationSignal: CancellationSignal, ): Callable> { return Callable> { - val cursor = query(db, statement, false, cancellationSignal) + val cursor = RoomDatabaseCompat.query(db, statement, cancellationSignal) try { val cursorIndexOfConversationId = 0 val cursorIndexOfGroupIconUrl = 1 @@ -1158,7 +1159,6 @@ fun callableChatMinimal( return@Callable result } finally { cursor.close() - statement.release() } } } @@ -1469,11 +1469,11 @@ fun convertChatHistoryMessageItem( @SuppressLint("RestrictedApi") fun callableSafeInscription( db: MixinDatabase, - statement: RoomSQLiteQuery, + statement: RoomQuery, cancellationSignal: CancellationSignal, ): Callable> { return Callable> { - val cursor = query(db, statement, false, cancellationSignal) + val cursor = RoomDatabaseCompat.query(db, statement, cancellationSignal) try { val cursorIndexOfCollectionHash = 0 val cursorIndexOfInscriptionHash = 1 @@ -1498,7 +1498,6 @@ fun callableSafeInscription( return@Callable result } finally { cursor.close() - statement.release() } } } @@ -1506,11 +1505,11 @@ fun callableSafeInscription( @SuppressLint("RestrictedApi") fun callableMarket( db: MixinDatabase, - statement: RoomSQLiteQuery, + statement: RoomQuery, cancellationSignal: CancellationSignal ): Callable> { return Callable> { - val cursor = query(db, statement, false, cancellationSignal) + val cursor = RoomDatabaseCompat.query(db, statement, cancellationSignal) try { val result: MutableList = ArrayList(cursor.count) while (cursor.moveToNext()) { @@ -1551,7 +1550,6 @@ fun callableMarket( result } finally { cursor.close() - statement.release() } } } diff --git a/app/src/main/java/one/mixin/android/db/provider/DataProvider.kt b/app/src/main/java/one/mixin/android/db/provider/DataProvider.kt index 052f55bb9b..88a71c3989 100644 --- a/app/src/main/java/one/mixin/android/db/provider/DataProvider.kt +++ b/app/src/main/java/one/mixin/android/db/provider/DataProvider.kt @@ -3,9 +3,9 @@ package one.mixin.android.db.provider import android.annotation.SuppressLint import android.os.CancellationSignal import androidx.paging.DataSource -import kotlinx.coroutines.asCoroutineDispatcher import kotlinx.coroutines.withContext import one.mixin.android.db.MixinDatabase +import one.mixin.android.db.datasource.RoomDatabaseCompat import one.mixin.android.fts.FtsDataSource import one.mixin.android.fts.FtsDatabase import one.mixin.android.fts.rawSearch @@ -86,7 +86,7 @@ class DataProvider { db: MixinDatabase, cancellationSignal: CancellationSignal, ): List = - withContext(db.queryExecutor.asCoroutineDispatcher()) { + withContext(RoomDatabaseCompat.queryContext(db)) { val result = ftsDatabase.rawSearch(query, cancellationSignal) if (result.isEmpty()) return@withContext emptyList() val ids = diff --git a/app/src/main/java/one/mixin/android/db/web3/SafeWalletsDao.kt b/app/src/main/java/one/mixin/android/db/web3/SafeWalletsDao.kt index 91dafc6554..428364f324 100644 --- a/app/src/main/java/one/mixin/android/db/web3/SafeWalletsDao.kt +++ b/app/src/main/java/one/mixin/android/db/web3/SafeWalletsDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db.web3 -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.db.BaseDao import one.mixin.android.db.web3.vo.SafeWallets diff --git a/app/src/main/java/one/mixin/android/db/web3/WalletOutputDao.kt b/app/src/main/java/one/mixin/android/db/web3/WalletOutputDao.kt index d7d3fd44ac..0c0595f83a 100644 --- a/app/src/main/java/one/mixin/android/db/web3/WalletOutputDao.kt +++ b/app/src/main/java/one/mixin/android/db/web3/WalletOutputDao.kt @@ -1,8 +1,8 @@ package one.mixin.android.db.web3 -import androidx.room.Dao -import androidx.room.Query -import androidx.room.Transaction +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.Transaction import kotlinx.coroutines.flow.Flow import one.mixin.android.api.response.web3.WalletOutput import one.mixin.android.db.BaseDao diff --git a/app/src/main/java/one/mixin/android/db/web3/Web3AddressDao.kt b/app/src/main/java/one/mixin/android/db/web3/Web3AddressDao.kt index 47286327d2..ed504effbb 100644 --- a/app/src/main/java/one/mixin/android/db/web3/Web3AddressDao.kt +++ b/app/src/main/java/one/mixin/android/db/web3/Web3AddressDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db.web3 -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.db.BaseDao import one.mixin.android.db.web3.vo.WalletItem import one.mixin.android.db.web3.vo.Web3Address diff --git a/app/src/main/java/one/mixin/android/db/web3/Web3ChainDao.kt b/app/src/main/java/one/mixin/android/db/web3/Web3ChainDao.kt index 0d9227e3a3..328c90962f 100644 --- a/app/src/main/java/one/mixin/android/db/web3/Web3ChainDao.kt +++ b/app/src/main/java/one/mixin/android/db/web3/Web3ChainDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db.web3 -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.db.BaseDao import one.mixin.android.db.web3.vo.Web3Chain diff --git a/app/src/main/java/one/mixin/android/db/web3/Web3PropertyDao.kt b/app/src/main/java/one/mixin/android/db/web3/Web3PropertyDao.kt index a545fa47ca..82e56bb9d2 100644 --- a/app/src/main/java/one/mixin/android/db/web3/Web3PropertyDao.kt +++ b/app/src/main/java/one/mixin/android/db/web3/Web3PropertyDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.extension.nowInUtc import one.mixin.android.vo.Property diff --git a/app/src/main/java/one/mixin/android/db/web3/Web3RawTransactionDao.kt b/app/src/main/java/one/mixin/android/db/web3/Web3RawTransactionDao.kt index d10feb7085..f436aadf1a 100644 --- a/app/src/main/java/one/mixin/android/db/web3/Web3RawTransactionDao.kt +++ b/app/src/main/java/one/mixin/android/db/web3/Web3RawTransactionDao.kt @@ -1,8 +1,8 @@ package one.mixin.android.db.web3 import androidx.lifecycle.LiveData -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.db.BaseDao import one.mixin.android.db.web3.vo.Web3RawTransaction diff --git a/app/src/main/java/one/mixin/android/db/web3/Web3TokenDao.kt b/app/src/main/java/one/mixin/android/db/web3/Web3TokenDao.kt index 570f1a14a2..ac7adca1a5 100644 --- a/app/src/main/java/one/mixin/android/db/web3/Web3TokenDao.kt +++ b/app/src/main/java/one/mixin/android/db/web3/Web3TokenDao.kt @@ -1,11 +1,11 @@ package one.mixin.android.db.web3 import androidx.lifecycle.LiveData -import androidx.room.Dao -import androidx.room.Query -import androidx.room.RawQuery -import androidx.room.RoomRawQuery -import androidx.room.RoomWarnings +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.RawQuery +import androidx.room3.RoomRawQuery +import androidx.room3.RoomWarnings import kotlinx.coroutines.flow.Flow import one.mixin.android.Constants import one.mixin.android.db.BaseDao diff --git a/app/src/main/java/one/mixin/android/db/web3/Web3TokensExtraDao.kt b/app/src/main/java/one/mixin/android/db/web3/Web3TokensExtraDao.kt index 71d18bc8a3..d4a4c1cc67 100644 --- a/app/src/main/java/one/mixin/android/db/web3/Web3TokensExtraDao.kt +++ b/app/src/main/java/one/mixin/android/db/web3/Web3TokensExtraDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db.web3 -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.db.BaseDao import one.mixin.android.db.web3.vo.Web3TokensExtra diff --git a/app/src/main/java/one/mixin/android/db/web3/Web3TransactionDao.kt b/app/src/main/java/one/mixin/android/db/web3/Web3TransactionDao.kt index c0b60a50d9..b2aaebd32d 100644 --- a/app/src/main/java/one/mixin/android/db/web3/Web3TransactionDao.kt +++ b/app/src/main/java/one/mixin/android/db/web3/Web3TransactionDao.kt @@ -2,10 +2,10 @@ package one.mixin.android.db.web3 import androidx.lifecycle.LiveData import androidx.paging.PagingSource -import androidx.room.Dao -import androidx.room.Query -import androidx.room.RawQuery -import androidx.sqlite.db.SupportSQLiteQuery +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.RawQuery +import androidx.room3.RoomRawQuery import one.mixin.android.db.BaseDao import one.mixin.android.db.web3.vo.Web3Transaction import one.mixin.android.db.web3.vo.Web3TransactionItem @@ -51,7 +51,7 @@ interface Web3TransactionDao : BaseDao { fun recentWeb3Transactions(walletId: String): LiveData> @RawQuery(observedEntities = [Web3Transaction::class]) - fun allTransactions(query: SupportSQLiteQuery): PagingSource + fun allTransactions(query: RoomRawQuery): PagingSource @Query("SELECT DISTINCT transaction_hash, * FROM transactions WHERE transaction_hash = :hash AND chain_id = :chainId LIMIT 1") suspend fun getLatestTransaction(hash: String, chainId: String): Web3Transaction? diff --git a/app/src/main/java/one/mixin/android/db/web3/Web3WalletDao.kt b/app/src/main/java/one/mixin/android/db/web3/Web3WalletDao.kt index c6a5aff4c8..f5a1cb82d3 100644 --- a/app/src/main/java/one/mixin/android/db/web3/Web3WalletDao.kt +++ b/app/src/main/java/one/mixin/android/db/web3/Web3WalletDao.kt @@ -1,10 +1,10 @@ package one.mixin.android.db.web3 import android.content.Context -import androidx.room.Dao -import androidx.room.Query -import androidx.room.RoomWarnings -import androidx.room.Transaction +import androidx.room3.Dao +import androidx.room3.Query +import androidx.room3.RoomWarnings +import androidx.room3.Transaction import kotlinx.coroutines.flow.Flow import one.mixin.android.crypto.CryptoWalletHelper import one.mixin.android.db.BaseDao diff --git a/app/src/main/java/one/mixin/android/db/web3/vo/SafeWallets.kt b/app/src/main/java/one/mixin/android/db/web3/vo/SafeWallets.kt index 756450575d..dd39ce6c20 100644 --- a/app/src/main/java/one/mixin/android/db/web3/vo/SafeWallets.kt +++ b/app/src/main/java/one/mixin/android/db/web3/vo/SafeWallets.kt @@ -1,9 +1,9 @@ package one.mixin.android.db.web3.vo import android.os.Parcelable -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/one/mixin/android/db/web3/vo/WalletItem.kt b/app/src/main/java/one/mixin/android/db/web3/vo/WalletItem.kt index 4573e6cb13..b8753122ff 100644 --- a/app/src/main/java/one/mixin/android/db/web3/vo/WalletItem.kt +++ b/app/src/main/java/one/mixin/android/db/web3/vo/WalletItem.kt @@ -1,7 +1,7 @@ package one.mixin.android.db.web3.vo import android.os.Parcelable -import androidx.room.Ignore +import androidx.room3.Ignore import kotlinx.parcelize.Parcelize import one.mixin.android.extension.equalsIgnoreCase import one.mixin.android.vo.WalletCategory diff --git a/app/src/main/java/one/mixin/android/db/web3/vo/Web3Address.kt b/app/src/main/java/one/mixin/android/db/web3/vo/Web3Address.kt index 181b81a088..d9e7d1a964 100644 --- a/app/src/main/java/one/mixin/android/db/web3/vo/Web3Address.kt +++ b/app/src/main/java/one/mixin/android/db/web3/vo/Web3Address.kt @@ -1,9 +1,9 @@ package one.mixin.android.db.web3.vo import android.os.Parcelable -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/one/mixin/android/db/web3/vo/Web3Chain.kt b/app/src/main/java/one/mixin/android/db/web3/vo/Web3Chain.kt index 03f8f6a1fb..a1ef914c6c 100644 --- a/app/src/main/java/one/mixin/android/db/web3/vo/Web3Chain.kt +++ b/app/src/main/java/one/mixin/android/db/web3/vo/Web3Chain.kt @@ -1,8 +1,8 @@ package one.mixin.android.db.web3.vo -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName @Entity(tableName = "chains") diff --git a/app/src/main/java/one/mixin/android/db/web3/vo/Web3RawTransaction.kt b/app/src/main/java/one/mixin/android/db/web3/vo/Web3RawTransaction.kt index 89af7722a1..fa78f01262 100644 --- a/app/src/main/java/one/mixin/android/db/web3/vo/Web3RawTransaction.kt +++ b/app/src/main/java/one/mixin/android/db/web3/vo/Web3RawTransaction.kt @@ -1,10 +1,10 @@ package one.mixin.android.db.web3.vo -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.Ignore -import androidx.room.Index -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.Ignore +import androidx.room3.Index +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import one.mixin.android.api.response.web3.ParsedTx diff --git a/app/src/main/java/one/mixin/android/db/web3/vo/Web3Token.kt b/app/src/main/java/one/mixin/android/db/web3/vo/Web3Token.kt index 69394bcb71..8c95639b7b 100644 --- a/app/src/main/java/one/mixin/android/db/web3/vo/Web3Token.kt +++ b/app/src/main/java/one/mixin/android/db/web3/vo/Web3Token.kt @@ -1,8 +1,8 @@ package one.mixin.android.db.web3.vo import android.os.Parcelable -import androidx.room.ColumnInfo -import androidx.room.Entity +import androidx.room3.ColumnInfo +import androidx.room3.Entity import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize import one.mixin.android.Constants diff --git a/app/src/main/java/one/mixin/android/db/web3/vo/Web3TokenItem.kt b/app/src/main/java/one/mixin/android/db/web3/vo/Web3TokenItem.kt index f0111ca5e0..ade63c1ce9 100644 --- a/app/src/main/java/one/mixin/android/db/web3/vo/Web3TokenItem.kt +++ b/app/src/main/java/one/mixin/android/db/web3/vo/Web3TokenItem.kt @@ -1,7 +1,7 @@ package one.mixin.android.db.web3.vo import android.os.Parcelable -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/one/mixin/android/db/web3/vo/Web3TokensExtra.kt b/app/src/main/java/one/mixin/android/db/web3/vo/Web3TokensExtra.kt index 81f0a3d822..fac5392f13 100644 --- a/app/src/main/java/one/mixin/android/db/web3/vo/Web3TokensExtra.kt +++ b/app/src/main/java/one/mixin/android/db/web3/vo/Web3TokensExtra.kt @@ -1,7 +1,7 @@ package one.mixin.android.db.web3.vo -import androidx.room.ColumnInfo -import androidx.room.Entity +import androidx.room3.ColumnInfo +import androidx.room3.Entity @Entity( tableName = "tokens_extra", primaryKeys = ["wallet_id", "asset_id"] diff --git a/app/src/main/java/one/mixin/android/db/web3/vo/Web3Transaction.kt b/app/src/main/java/one/mixin/android/db/web3/vo/Web3Transaction.kt index e4d7a6bc56..4894c743c1 100644 --- a/app/src/main/java/one/mixin/android/db/web3/vo/Web3Transaction.kt +++ b/app/src/main/java/one/mixin/android/db/web3/vo/Web3Transaction.kt @@ -1,11 +1,11 @@ package one.mixin.android.db.web3.vo import android.os.Parcelable -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.Ignore -import androidx.room.Index -import androidx.room.TypeConverters +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.Ignore +import androidx.room3.Index +import androidx.room3.ColumnTypeConverters import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize import one.mixin.android.Constants @@ -49,17 +49,17 @@ data class Web3Transaction( @SerializedName("fee") val fee: String, - @TypeConverters(AssetChangeListConverter::class) + @ColumnTypeConverters(AssetChangeListConverter::class) @ColumnInfo(name = "senders") @SerializedName("senders") val senders: List?, - @TypeConverters(AssetChangeListConverter::class) + @ColumnTypeConverters(AssetChangeListConverter::class) @ColumnInfo(name = "receivers") @SerializedName("receivers") val receivers: List?, - @TypeConverters(AssetChangeListConverter::class) + @ColumnTypeConverters(AssetChangeListConverter::class) @ColumnInfo(name = "approvals") @SerializedName("approvals") val approvals: List? = null, diff --git a/app/src/main/java/one/mixin/android/db/web3/vo/Web3TransactionItem.kt b/app/src/main/java/one/mixin/android/db/web3/vo/Web3TransactionItem.kt index be2f205d9a..f22bb05919 100644 --- a/app/src/main/java/one/mixin/android/db/web3/vo/Web3TransactionItem.kt +++ b/app/src/main/java/one/mixin/android/db/web3/vo/Web3TransactionItem.kt @@ -2,8 +2,8 @@ package one.mixin.android.db.web3.vo import android.os.Parcelable import androidx.recyclerview.widget.DiffUtil -import androidx.room.ColumnInfo -import androidx.room.TypeConverters +import androidx.room3.ColumnInfo +import androidx.room3.ColumnTypeConverters import kotlinx.parcelize.Parcelize import one.mixin.android.Constants import one.mixin.android.db.converter.AssetChangeListConverter @@ -33,15 +33,15 @@ data class Web3TransactionItem( @ColumnInfo(name = "fee") val fee: String, - @TypeConverters(AssetChangeListConverter::class) + @ColumnTypeConverters(AssetChangeListConverter::class) @ColumnInfo(name = "senders") val senders: List, - @TypeConverters(AssetChangeListConverter::class) + @ColumnTypeConverters(AssetChangeListConverter::class) @ColumnInfo(name = "receivers") val receivers: List, - @TypeConverters(AssetChangeListConverter::class) + @ColumnTypeConverters(AssetChangeListConverter::class) @ColumnInfo(name = "approvals") val approvals: List? = null, diff --git a/app/src/main/java/one/mixin/android/db/web3/vo/Web3Wallet.kt b/app/src/main/java/one/mixin/android/db/web3/vo/Web3Wallet.kt index f0720f021e..7ce5dfa287 100644 --- a/app/src/main/java/one/mixin/android/db/web3/vo/Web3Wallet.kt +++ b/app/src/main/java/one/mixin/android/db/web3/vo/Web3Wallet.kt @@ -1,11 +1,11 @@ package one.mixin.android.db.web3.vo import android.os.Parcelable -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.Ignore -import androidx.room.PrimaryKey -import androidx.room.TypeConverters +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.Ignore +import androidx.room3.PrimaryKey +import androidx.room3.ColumnTypeConverters import com.google.gson.annotations.SerializedName import kotlinx.parcelize.IgnoredOnParcel import kotlinx.parcelize.Parcelize @@ -27,7 +27,7 @@ enum class SafeChain(val value: String, val chainId: String) { } } -@TypeConverters(ListConverter::class) +@ColumnTypeConverters(ListConverter::class) @Entity(tableName = "wallets") @Parcelize data class Web3Wallet( diff --git a/app/src/main/java/one/mixin/android/di/BaseDbModule.kt b/app/src/main/java/one/mixin/android/di/BaseDbModule.kt index 12b1abec4b..adcdc3561e 100644 --- a/app/src/main/java/one/mixin/android/di/BaseDbModule.kt +++ b/app/src/main/java/one/mixin/android/di/BaseDbModule.kt @@ -7,8 +7,19 @@ import dagger.hilt.InstallIn import dagger.hilt.components.SingletonComponent import one.mixin.android.crypto.db.SignalDatabase import one.mixin.android.db.MixinDatabase +import one.mixin.android.db.OrderDao +import one.mixin.android.db.Web3PropertyDao import one.mixin.android.db.WalletDatabase import one.mixin.android.db.pending.PendingDatabase +import one.mixin.android.db.web3.SafeWalletsDao +import one.mixin.android.db.web3.WalletOutputDao +import one.mixin.android.db.web3.Web3AddressDao +import one.mixin.android.db.web3.Web3ChainDao +import one.mixin.android.db.web3.Web3RawTransactionDao +import one.mixin.android.db.web3.Web3TokenDao +import one.mixin.android.db.web3.Web3TokensExtraDao +import one.mixin.android.db.web3.Web3TransactionDao +import one.mixin.android.db.web3.Web3WalletDao import one.mixin.android.session.CurrentUserScopeManager import javax.inject.Provider @@ -20,7 +31,7 @@ internal object BaseDbModule { @Provides fun provideFtsDb(scopeManagerProvider: Provider) = scopeManagerProvider.get().getFtsDatabase() @Provides - fun provideWalletDatabase(scopeManagerProvider: Provider) = scopeManagerProvider.get().getWalletDatabase() + fun provideWalletDatabase(scopeManagerProvider: Provider): WalletDatabase = scopeManagerProvider.get().getWalletDatabase() @Provides fun provideRatchetSenderKeyDao(db: SignalDatabase) = db.ratchetSenderKeyDao() @Provides @@ -123,25 +134,25 @@ internal object BaseDbModule { @Provides fun provideMemberOrderDao(db: MixinDatabase) = db.memberOrderDao() @Provides - fun provideWeb3TokenDao(db: WalletDatabase) = db.web3TokenDao() + fun provideWeb3TokenDao(db: WalletDatabase): Web3TokenDao = db.web3TokenDao() @Provides - fun provideWeb3TransactionDao(db: WalletDatabase) = db.web3TransactionDao() + fun provideWeb3TransactionDao(db: WalletDatabase): Web3TransactionDao = db.web3TransactionDao() @Provides - fun provideWeb3WalletDao(db: WalletDatabase) = db.web3WalletDao() + fun provideWeb3WalletDao(db: WalletDatabase): Web3WalletDao = db.web3WalletDao() @Provides - fun provideWeb3AddressDao(db: WalletDatabase) = db.web3AddressDao() + fun provideWeb3AddressDao(db: WalletDatabase): Web3AddressDao = db.web3AddressDao() @Provides - fun provideWeb3TokensExtraDao(db: WalletDatabase) = db.web3TokensExtraDao() + fun provideWeb3TokensExtraDao(db: WalletDatabase): Web3TokensExtraDao = db.web3TokensExtraDao() @Provides - fun provideWeb3ChainDao(db: WalletDatabase) = db.web3ChainDao() + fun provideWeb3ChainDao(db: WalletDatabase): Web3ChainDao = db.web3ChainDao() @Provides - fun provideWeb3PropertyDao(db: WalletDatabase) = db.web3PropertyDao() + fun provideWeb3PropertyDao(db: WalletDatabase): Web3PropertyDao = db.web3PropertyDao() @Provides - fun provideWeb3RawTransactionDao(db: WalletDatabase) = db.web3RawTransactionDao() + fun provideWeb3RawTransactionDao(db: WalletDatabase): Web3RawTransactionDao = db.web3RawTransactionDao() @Provides - fun provideOrderDao(db: WalletDatabase) = db.orderDao() + fun provideOrderDao(db: WalletDatabase): OrderDao = db.orderDao() @Provides - fun provideSafeWalletsDao(db: WalletDatabase) = db.safeWalletsDao() + fun provideSafeWalletsDao(db: WalletDatabase): SafeWalletsDao = db.safeWalletsDao() @Provides - fun provideWalletOutputDao(db: WalletDatabase) = db.walletOutputDao() + fun provideWalletOutputDao(db: WalletDatabase): WalletOutputDao = db.walletOutputDao() } diff --git a/app/src/main/java/one/mixin/android/fts/FtsDataSource.kt b/app/src/main/java/one/mixin/android/fts/FtsDataSource.kt index 6ce25305ec..95be3a6c71 100644 --- a/app/src/main/java/one/mixin/android/fts/FtsDataSource.kt +++ b/app/src/main/java/one/mixin/android/fts/FtsDataSource.kt @@ -5,6 +5,7 @@ import android.util.ArrayMap import androidx.core.database.getStringOrNull import androidx.paging.ItemKeyedDataSource import one.mixin.android.db.MixinDatabase +import one.mixin.android.db.datasource.query import one.mixin.android.vo.SearchMessageDetailItem import timber.log.Timber diff --git a/app/src/main/java/one/mixin/android/fts/FtsDatabase.kt b/app/src/main/java/one/mixin/android/fts/FtsDatabase.kt index cfdeb89573..7167729566 100644 --- a/app/src/main/java/one/mixin/android/fts/FtsDatabase.kt +++ b/app/src/main/java/one/mixin/android/fts/FtsDatabase.kt @@ -1,11 +1,14 @@ package one.mixin.android.fts import android.content.Context -import androidx.room.Database -import androidx.room.Room -import androidx.room.RoomDatabase -import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room3.Database +import androidx.room3.Room +import androidx.room3.RoomDatabase +import androidx.sqlite.SQLiteConnection +import androidx.sqlite.driver.AndroidSQLiteDriver import one.mixin.android.Constants.DataBase.FTS_DB_NAME +import one.mixin.android.db.datasource.RoomDatabaseCompat +import one.mixin.android.db.datasource.execSQL import one.mixin.android.util.database.dbDir import java.io.File @@ -23,8 +26,6 @@ abstract class FtsDatabase : RoomDatabase() { private val lock = Any() private var currentIdentityNumber: String? = null - private var supportSQLiteDatabase: SupportSQLiteDatabase? = null - fun destroy(close: Boolean = false) { synchronized(lock) { if (close) { @@ -32,7 +33,6 @@ abstract class FtsDatabase : RoomDatabase() { } INSTANCE = null currentIdentityNumber = null - supportSQLiteDatabase = null } } @@ -46,7 +46,6 @@ abstract class FtsDatabase : RoomDatabase() { if (INSTANCE != null && currentIdentityNumber != scopedIdentity) { INSTANCE?.close() INSTANCE = null - supportSQLiteDatabase = null } if (INSTANCE == null) { val dbPath = File(dbDir(context, scopedIdentity), FTS_DB_NAME).absolutePath @@ -55,16 +54,17 @@ abstract class FtsDatabase : RoomDatabase() { context, FtsDatabase::class.java, dbPath, - ).addCallback( + ).setDriver(AndroidSQLiteDriver()) + .addCallback( object : Callback() { - override fun onOpen(db: SupportSQLiteDatabase) { + override suspend fun onOpen(db: SQLiteConnection) { super.onOpen(db) db.execSQL("PRAGMA synchronous = NORMAL") - supportSQLiteDatabase = db } }, ) - INSTANCE = builder.build() + val database = builder.build() + INSTANCE = database currentIdentityNumber = scopedIdentity } } @@ -82,7 +82,6 @@ abstract class FtsDatabase : RoomDatabase() { if (INSTANCE === this) { INSTANCE = null currentIdentityNumber = null - supportSQLiteDatabase = null } } } diff --git a/app/src/main/java/one/mixin/android/fts/FtsDatabaseExtension.kt b/app/src/main/java/one/mixin/android/fts/FtsDatabaseExtension.kt index 76d24b67ab..ef8293fab2 100644 --- a/app/src/main/java/one/mixin/android/fts/FtsDatabaseExtension.kt +++ b/app/src/main/java/one/mixin/android/fts/FtsDatabaseExtension.kt @@ -4,6 +4,7 @@ import android.os.CancellationSignal import androidx.core.database.getStringOrNull import kotlinx.coroutines.runBlocking import kotlinx.coroutines.withContext +import one.mixin.android.db.datasource.query import one.mixin.android.extension.createAtToLong import one.mixin.android.extension.joinWhiteSpace import one.mixin.android.util.FTS_THREAD diff --git a/app/src/main/java/one/mixin/android/fts/FtsQuerySpec.kt b/app/src/main/java/one/mixin/android/fts/FtsQuerySpec.kt index 8148c36139..a0206eceec 100644 --- a/app/src/main/java/one/mixin/android/fts/FtsQuerySpec.kt +++ b/app/src/main/java/one/mixin/android/fts/FtsQuerySpec.kt @@ -1,12 +1,12 @@ package one.mixin.android.fts -import androidx.sqlite.db.SimpleSQLiteQuery +import androidx.room3.RoomRawQuery import one.mixin.android.codegen.annotation.GeneratedQueryProvider -import one.mixin.android.codegen.annotation.GeneratedSimpleSQLiteQuery +import one.mixin.android.codegen.annotation.GeneratedRoomRawQuery @GeneratedQueryProvider(generatedName = "FtsQueryGenerated") interface FtsQuerySpec { - @GeneratedSimpleSQLiteQuery( + @GeneratedRoomRawQuery( sql = """ SELECT message_id, conversation_id, user_id, count(message_id) FROM messages_metas @@ -16,9 +16,9 @@ interface FtsQuerySpec { LIMIT 999 """, ) - fun rawSearch(content: String): SimpleSQLiteQuery + fun rawSearch(content: String): RoomRawQuery - @GeneratedSimpleSQLiteQuery( + @GeneratedRoomRawQuery( sql = """ SELECT message_id FROM messages_metas @@ -30,5 +30,5 @@ interface FtsQuerySpec { fun messageIdsByConversation( conversationId: String, query: String, - ): SimpleSQLiteQuery + ): RoomRawQuery } diff --git a/app/src/main/java/one/mixin/android/fts/MessageFts.kt b/app/src/main/java/one/mixin/android/fts/MessageFts.kt index 7b6c83f483..e3f3fbfacf 100644 --- a/app/src/main/java/one/mixin/android/fts/MessageFts.kt +++ b/app/src/main/java/one/mixin/android/fts/MessageFts.kt @@ -1,9 +1,9 @@ package one.mixin.android.fts -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.Fts4 -import androidx.room.FtsOptions +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.Fts4 +import androidx.room3.FtsOptions @Entity(tableName = "messages_fts") @Fts4(tokenizer = FtsOptions.TOKENIZER_UNICODE61) diff --git a/app/src/main/java/one/mixin/android/fts/MessageFtsDao.kt b/app/src/main/java/one/mixin/android/fts/MessageFtsDao.kt index 16e09504d5..f2eb60ef2d 100644 --- a/app/src/main/java/one/mixin/android/fts/MessageFtsDao.kt +++ b/app/src/main/java/one/mixin/android/fts/MessageFtsDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.fts -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.db.BaseDao @Dao diff --git a/app/src/main/java/one/mixin/android/fts/MessageMetaDao.kt b/app/src/main/java/one/mixin/android/fts/MessageMetaDao.kt index ec945ccaa1..1d116ec7bb 100644 --- a/app/src/main/java/one/mixin/android/fts/MessageMetaDao.kt +++ b/app/src/main/java/one/mixin/android/fts/MessageMetaDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.fts -import androidx.room.Dao -import androidx.room.Query +import androidx.room3.Dao +import androidx.room3.Query import one.mixin.android.db.BaseDao @Dao diff --git a/app/src/main/java/one/mixin/android/fts/MessagesMeta.kt b/app/src/main/java/one/mixin/android/fts/MessagesMeta.kt index 4d51161ca6..5afd377ae4 100644 --- a/app/src/main/java/one/mixin/android/fts/MessagesMeta.kt +++ b/app/src/main/java/one/mixin/android/fts/MessagesMeta.kt @@ -1,9 +1,9 @@ package one.mixin.android.fts -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.Index -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.Index +import androidx.room3.PrimaryKey @Entity( tableName = "messages_metas", diff --git a/app/src/main/java/one/mixin/android/job/BlazeMessageService.kt b/app/src/main/java/one/mixin/android/job/BlazeMessageService.kt index 5ca31ef1c6..57d34e9819 100644 --- a/app/src/main/java/one/mixin/android/job/BlazeMessageService.kt +++ b/app/src/main/java/one/mixin/android/job/BlazeMessageService.kt @@ -16,7 +16,6 @@ import androidx.core.content.getSystemService import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleService import androidx.lifecycle.lifecycleScope -import androidx.room.InvalidationTracker import com.birbit.android.jobqueue.network.NetworkEventProvider import com.birbit.android.jobqueue.network.NetworkUtil import com.uber.autodispose.android.lifecycle.scope @@ -40,6 +39,7 @@ import one.mixin.android.api.service.CircleService import one.mixin.android.api.service.ConversationService import one.mixin.android.api.service.MessageService import one.mixin.android.db.MixinDatabase +import one.mixin.android.db.datasource.RoomDatabaseCompat import one.mixin.android.db.deleteMessageById import one.mixin.android.db.flow.MessageFlow import one.mixin.android.db.flow.MessageFlow.ANY_ID @@ -349,26 +349,22 @@ class BlazeMessageService : LifecycleService(), NetworkEventProvider.Listener, C } } - private var ackObservedDatabase: PendingDatabase? = null + private var ackObserverJob: Job? = null private fun startObserveAck() { - val db = pendingDatabase() - ackObservedDatabase = db - db.addObserver(ackObserver) + ackObserverJob?.cancel() + ackObserverJob = + pendingDatabase().observeInvalidation(lifecycleScope, "jobs") { + runAckJob() + } } private fun stopObserveAck() { - ackObservedDatabase?.removeObserver(ackObserver) - ackObservedDatabase = null + ackObserverJob?.cancel() + ackObserverJob = null } private var ackJob: Job? = null - private val ackObserver = - object : InvalidationTracker.Observer("jobs") { - override fun onInvalidated(tables: Set) { - runAckJob() - } - } @Synchronized private fun runAckJob() { @@ -442,47 +438,41 @@ class BlazeMessageService : LifecycleService(), NetworkEventProvider.Listener, C } } - private var statusObservedDatabase: MixinDatabase? = null + private var statusObserverJob: Job? = null private fun startObserveStatus() { val db = mixinDatabase() - statusObservedDatabase = db - db.invalidationTracker.addObserver(statusObserver) + statusObserverJob?.cancel() + statusObserverJob = + RoomDatabaseCompat.observeInvalidation(lifecycleScope, db, "remote_messages_status") { + runStatusJob() + } } private fun stopObserveStatus() { - statusObservedDatabase?.invalidationTracker?.removeObserver(statusObserver) - statusObservedDatabase = null + statusObserverJob?.cancel() + statusObserverJob = null } private var statusJob: Job? = null - private val statusObserver = - object : InvalidationTracker.Observer("remote_messages_status") { - override fun onInvalidated(tables: Set) { - runStatusJob() - } - } - private var expiredObservedDatabase: MixinDatabase? = null + private var expiredObserverJob: Job? = null private fun startObserveExpired() { val db = mixinDatabase() - expiredObservedDatabase = db - db.invalidationTracker.addObserver(expiredObserver) + expiredObserverJob?.cancel() + expiredObserverJob = + RoomDatabaseCompat.observeInvalidation(lifecycleScope, db, "expired_messages") { + runExpiredJob() + } } private fun stopObserveExpired() { - expiredObservedDatabase?.invalidationTracker?.removeObserver(expiredObserver) - expiredObservedDatabase = null + expiredObserverJob?.cancel() + expiredObserverJob = null } private var expiredJob: Job? = null - private val expiredObserver = - object : InvalidationTracker.Observer("expired_messages") { - override fun onInvalidated(tables: Set) { - runExpiredJob() - } - } @Synchronized private fun runStatusJob() { diff --git a/app/src/main/java/one/mixin/android/job/CheckBalanceJob.kt b/app/src/main/java/one/mixin/android/job/CheckBalanceJob.kt index d1e992709c..9dc8c31a77 100644 --- a/app/src/main/java/one/mixin/android/job/CheckBalanceJob.kt +++ b/app/src/main/java/one/mixin/android/job/CheckBalanceJob.kt @@ -1,6 +1,6 @@ package one.mixin.android.job -import androidx.room.withTransaction +import androidx.room3.withWriteTransaction import com.birbit.android.jobqueue.Params import kotlinx.coroutines.runBlocking import one.mixin.android.extension.nowInUtc @@ -29,7 +29,7 @@ class CheckBalanceJob( for (asset in assets) { val tokensExtra = tokensExtraDao.findByAsset(asset) val token = tokenDao.findTokenByAsset(asset) ?: continue - mixinDatabase.withTransaction { + mixinDatabase.withWriteTransaction { val amount = calcBalanceByAssetId(asset) if (tokensExtra == null) { tokensExtraDao.insertSuspend(TokensExtra(token.assetId, token.asset, false, amount.toPlainString(), nowInUtc())) diff --git a/app/src/main/java/one/mixin/android/job/RefreshPerpsPositionsJob.kt b/app/src/main/java/one/mixin/android/job/RefreshPerpsPositionsJob.kt index 791337ba8b..776812ec42 100644 --- a/app/src/main/java/one/mixin/android/job/RefreshPerpsPositionsJob.kt +++ b/app/src/main/java/one/mixin/android/job/RefreshPerpsPositionsJob.kt @@ -3,6 +3,7 @@ package one.mixin.android.job import com.birbit.android.jobqueue.Params import kotlinx.coroutines.runBlocking import one.mixin.android.db.perps.PerpsPositionDao +import one.mixin.android.db.runInTransaction import one.mixin.android.db.web3.vo.isWatch import one.mixin.android.session.Session import one.mixin.android.session.resolveCurrentUserScopeManager diff --git a/app/src/main/java/one/mixin/android/job/RestoreTransactionJob.kt b/app/src/main/java/one/mixin/android/job/RestoreTransactionJob.kt index 5ccfa1fa2c..992e456506 100644 --- a/app/src/main/java/one/mixin/android/job/RestoreTransactionJob.kt +++ b/app/src/main/java/one/mixin/android/job/RestoreTransactionJob.kt @@ -8,6 +8,7 @@ import one.mixin.android.api.request.TransactionRequest import one.mixin.android.api.response.TransactionResponse import one.mixin.android.db.flow.MessageFlow import one.mixin.android.db.insertMessage +import one.mixin.android.db.runInTransaction import one.mixin.android.extension.nowInUtc import one.mixin.android.session.Session import one.mixin.android.util.reportException diff --git a/app/src/main/java/one/mixin/android/messenger/HedwigImp.kt b/app/src/main/java/one/mixin/android/messenger/HedwigImp.kt index d0376a212a..9267af4f48 100644 --- a/app/src/main/java/one/mixin/android/messenger/HedwigImp.kt +++ b/app/src/main/java/one/mixin/android/messenger/HedwigImp.kt @@ -1,7 +1,6 @@ package one.mixin.android.messenger import android.database.sqlite.SQLiteBlobTooBigException -import androidx.room.InvalidationTracker import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Job import kotlinx.coroutines.launch @@ -83,24 +82,20 @@ class HedwigImp( private fun jobDao() = pendingDatabase().jobDao() private var floodJob: Job? = null - private var floodObservedDatabase: PendingDatabase? = null - private val floodObserver = - object : InvalidationTracker.Observer("flood_messages") { - override fun onInvalidated(tables: Set) { - runFloodJob() - } - } + private var floodObserverJob: Job? = null private fun startObserveFlood() { runFloodJob() - val db = pendingDatabase() - floodObservedDatabase = db - db.addObserver(floodObserver) + floodObserverJob?.cancel() + floodObserverJob = + pendingDatabase().observeInvalidation(lifecycleScope, "flood_messages") { + runFloodJob() + } } private fun stopObserveFlood() { - floodObservedDatabase?.removeObserver(floodObserver) - floodObservedDatabase = null + floodObserverJob?.cancel() + floodObserverJob = null } @Synchronized @@ -165,24 +160,20 @@ class HedwigImp( } private var pendingJob: Job? = null - private var pendingObservedDatabase: PendingDatabase? = null - private val pendingObserver = - object : InvalidationTracker.Observer("pending_messages") { - override fun onInvalidated(tables: Set) { - runPendingJob() - } - } + private var pendingObserverJob: Job? = null private fun startObservePending() { runPendingJob() - val db = pendingDatabase() - pendingObservedDatabase = db - db.addObserver(pendingObserver) + pendingObserverJob?.cancel() + pendingObserverJob = + pendingDatabase().observeInvalidation(lifecycleScope, "pending_messages") { + runPendingJob() + } } private fun stopObservePending() { - pendingObservedDatabase?.removeObserver(pendingObserver) - pendingObservedDatabase = null + pendingObserverJob?.cancel() + pendingObserverJob = null } @Synchronized diff --git a/app/src/main/java/one/mixin/android/repository/ConversationRepository.kt b/app/src/main/java/one/mixin/android/repository/ConversationRepository.kt index a04169071a..8fa0e93f52 100644 --- a/app/src/main/java/one/mixin/android/repository/ConversationRepository.kt +++ b/app/src/main/java/one/mixin/android/repository/ConversationRepository.kt @@ -38,6 +38,7 @@ import one.mixin.android.db.TranscriptMessageDao import one.mixin.android.db.flow.MessageFlow import one.mixin.android.db.insertMessage import one.mixin.android.db.provider.DataProvider +import one.mixin.android.db.runInTransaction import one.mixin.android.event.GroupEvent import one.mixin.android.extension.joinStar import one.mixin.android.extension.putBoolean diff --git a/app/src/main/java/one/mixin/android/repository/TokenRepository.kt b/app/src/main/java/one/mixin/android/repository/TokenRepository.kt index f47e4e71bc..78531d791d 100644 --- a/app/src/main/java/one/mixin/android/repository/TokenRepository.kt +++ b/app/src/main/java/one/mixin/android/repository/TokenRepository.kt @@ -8,8 +8,8 @@ import androidx.paging.PagingConfig import androidx.paging.PagingData import androidx.paging.PagingSource import androidx.paging.liveData -import androidx.room.RoomRawQuery -import androidx.room.withTransaction +import androidx.room3.RoomRawQuery +import androidx.room3.withWriteTransaction import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.withContext @@ -478,7 +478,7 @@ class TokenRepository id: String, hidden: Boolean, ) { - appDatabase.withTransaction { + appDatabase.withWriteTransaction { val tokensExtra = tokensExtraDao.findByAssetId(id) if (tokensExtra != null) { tokensExtraDao.updateHiddenByAssetId(id, hidden) @@ -1608,7 +1608,7 @@ class TokenRepository ) { val normalizedAmount = amount.removePrefix("-") val normalizedFee = fee.toBigDecimalOrNull()?.stripTrailingZeros()?.toPlainString() ?: fee - appDatabase.withTransaction { + appDatabase.withWriteTransaction { web3RawTransactionDao.insertSuspend( Web3RawTransaction( hash = hash, @@ -1666,9 +1666,9 @@ class TokenRepository chainId: String, updatedAt: String, ) { - appDatabase.withTransaction { + appDatabase.withWriteTransaction { val pendingRaw = web3RawTransactionDao.getRawTransactionByHashAndChain(walletId, sponsorTxId, chainId) - ?: return@withTransaction + ?: return@withWriteTransaction val pendingTransaction = web3TransactionDao.getLatestTransaction(sponsorTxId, chainId) web3RawTransactionDao.insertSuspend( @@ -1699,9 +1699,9 @@ class TokenRepository status: String, updatedAt: String, ) { - appDatabase.withTransaction { + appDatabase.withWriteTransaction { val pendingRaw = web3RawTransactionDao.getRawTransactionByHashAndChain(walletId, hash, chainId) - ?: return@withTransaction + ?: return@withWriteTransaction web3RawTransactionDao.insertSuspend( pendingRaw.copy( state = status, @@ -1719,15 +1719,15 @@ class TokenRepository chainId: String, btcRawTransactionHexToDeleteOutputs: String?, ) { - appDatabase.withTransaction { + appDatabase.withWriteTransaction { web3RawTransactionDao.insertSuspend(raw) web3TransactionDao.updateTransaction(hash, status, chainId) - if (btcRawTransactionHexToDeleteOutputs.isNullOrBlank()) return@withTransaction + if (btcRawTransactionHexToDeleteOutputs.isNullOrBlank()) return@withWriteTransaction val cleanedHex: String = btcRawTransactionHexToDeleteOutputs.removePrefix("0x").trim() - if (cleanedHex.isBlank()) return@withTransaction + if (cleanedHex.isBlank()) return@withWriteTransaction val tx: Transaction = runCatching { Transaction.read(ByteBuffer.wrap(cleanedHex.hexStringToByteArray())) - }.getOrNull() ?: return@withTransaction + }.getOrNull() ?: return@withWriteTransaction val txHash: String = tx.txId.toString() walletOutputDao.deleteByTransactionHash(txHash, Constants.ChainId.BITCOIN_CHAIN_ID) diff --git a/app/src/main/java/one/mixin/android/repository/Web3Repository.kt b/app/src/main/java/one/mixin/android/repository/Web3Repository.kt index d5d3d87e9f..2a163d7b35 100644 --- a/app/src/main/java/one/mixin/android/repository/Web3Repository.kt +++ b/app/src/main/java/one/mixin/android/repository/Web3Repository.kt @@ -4,7 +4,7 @@ import android.content.Context import androidx.lifecycle.liveData import androidx.lifecycle.switchMap import androidx.paging.PagingSource -import androidx.room.RoomRawQuery +import androidx.room3.RoomRawQuery import dagger.hilt.android.qualifiers.ApplicationContext import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.Flow diff --git a/app/src/main/java/one/mixin/android/ui/common/BottomSheetViewModel.kt b/app/src/main/java/one/mixin/android/ui/common/BottomSheetViewModel.kt index 4ca2568de3..5aea1e9c47 100644 --- a/app/src/main/java/one/mixin/android/ui/common/BottomSheetViewModel.kt +++ b/app/src/main/java/one/mixin/android/ui/common/BottomSheetViewModel.kt @@ -55,6 +55,7 @@ import one.mixin.android.api.service.UtxoService import one.mixin.android.crypto.CryptoWalletHelper import one.mixin.android.crypto.PinCipher import one.mixin.android.db.MixinDatabase +import one.mixin.android.db.runInTransaction import one.mixin.android.db.web3.vo.Web3TokenItem import one.mixin.android.db.web3.vo.Web3Wallet import one.mixin.android.extension.decodeBase64 diff --git a/app/src/main/java/one/mixin/android/ui/home/MainActivity.kt b/app/src/main/java/one/mixin/android/ui/home/MainActivity.kt index fec197f6ed..f3f6757719 100644 --- a/app/src/main/java/one/mixin/android/ui/home/MainActivity.kt +++ b/app/src/main/java/one/mixin/android/ui/home/MainActivity.kt @@ -20,7 +20,7 @@ import androidx.fragment.app.FragmentManager import androidx.lifecycle.Lifecycle import androidx.lifecycle.ProcessLifecycleOwner import androidx.lifecycle.lifecycleScope -import androidx.room.util.readVersion +import one.mixin.android.db.readVersion import androidx.work.Constraints import androidx.work.ExistingPeriodicWorkPolicy import androidx.work.NetworkType diff --git a/app/src/main/java/one/mixin/android/ui/home/web3/components/InscriptionState.kt b/app/src/main/java/one/mixin/android/ui/home/web3/components/InscriptionState.kt index 7809dcfe70..1a67bb3230 100644 --- a/app/src/main/java/one/mixin/android/ui/home/web3/components/InscriptionState.kt +++ b/app/src/main/java/one/mixin/android/ui/home/web3/components/InscriptionState.kt @@ -1,6 +1,6 @@ package one.mixin.android.ui.home.web3.components -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo import one.mixin.android.extension.numberFormat2 import one.mixin.android.extension.numberFormat8 import one.mixin.android.vo.Fiats diff --git a/app/src/main/java/one/mixin/android/ui/landing/UpgradeFragment.kt b/app/src/main/java/one/mixin/android/ui/landing/UpgradeFragment.kt index fbf638415b..e6b8368670 100644 --- a/app/src/main/java/one/mixin/android/ui/landing/UpgradeFragment.kt +++ b/app/src/main/java/one/mixin/android/ui/landing/UpgradeFragment.kt @@ -14,6 +14,7 @@ import one.mixin.android.R import one.mixin.android.databinding.FragmentUpgradeBinding import one.mixin.android.db.MixinDatabase import one.mixin.android.db.property.PropertyHelper +import one.mixin.android.db.runInTransaction import one.mixin.android.extension.withArgs import one.mixin.android.ui.common.BaseFragment import one.mixin.android.ui.home.MainActivity diff --git a/app/src/main/java/one/mixin/android/ui/oldwallet/SnapshotItem.kt b/app/src/main/java/one/mixin/android/ui/oldwallet/SnapshotItem.kt index 47f2d0e9aa..c820ac4cbd 100644 --- a/app/src/main/java/one/mixin/android/ui/oldwallet/SnapshotItem.kt +++ b/app/src/main/java/one/mixin/android/ui/oldwallet/SnapshotItem.kt @@ -3,9 +3,9 @@ package one.mixin.android.ui.oldwallet import android.annotation.SuppressLint import android.os.Parcelable import androidx.recyclerview.widget.DiffUtil -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize import one.mixin.android.vo.Snapshot diff --git a/app/src/main/java/one/mixin/android/ui/search/CancellationLimitOffsetDataSource.java b/app/src/main/java/one/mixin/android/ui/search/CancellationLimitOffsetDataSource.java deleted file mode 100644 index 354d4d037a..0000000000 --- a/app/src/main/java/one/mixin/android/ui/search/CancellationLimitOffsetDataSource.java +++ /dev/null @@ -1,170 +0,0 @@ -package one.mixin.android.ui.search; - -import android.annotation.SuppressLint; -import android.database.Cursor; -import android.os.CancellationSignal; -import android.os.OperationCanceledException; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.annotation.RestrictTo; -import androidx.paging.PositionalDataSource; -import androidx.room.InvalidationTracker; -import androidx.room.RoomDatabase; -import androidx.room.RoomSQLiteQuery; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Set; - -import one.mixin.android.util.CrashExceptionReportKt; -import timber.log.Timber; - -@SuppressLint("RestrictedApi") -@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) -public abstract class CancellationLimitOffsetDataSource extends PositionalDataSource { - private final RoomSQLiteQuery mSourceQuery; - private final RoomSQLiteQuery mCountQuery; - private final String mLimitOffsetQuery; - private final RoomDatabase mDb; - @SuppressWarnings("FieldCanBeLocal") - private final InvalidationTracker.Observer mObserver; - private final boolean mInTransaction; - private final CancellationSignal mCancellationSignal; - - protected CancellationLimitOffsetDataSource(RoomDatabase db, RoomSQLiteQuery query, - RoomSQLiteQuery countQuery, - CancellationSignal cancellationSignal, - boolean inTransaction, String... tables) { - mDb = db; - mSourceQuery = query; - mInTransaction = inTransaction; - mCountQuery = countQuery; - mCancellationSignal = cancellationSignal; - mLimitOffsetQuery = mSourceQuery.getSql() + " LIMIT ? OFFSET ?"; - mObserver = new InvalidationTracker.Observer(tables) { - @Override - public void onInvalidated(@NonNull Set tables) { - invalidate(); - } - }; - db.getInvalidationTracker().addWeakObserver(mObserver); - } - - /** - * Count number of rows query can return - */ - @SuppressWarnings("WeakerAccess") - public int countItems() { - try (Cursor cursor = mDb.query(mCountQuery, mCancellationSignal)) { - if (cursor.moveToFirst()) { - return cursor.getInt(0); - } - return 0; - } catch (OperationCanceledException e) { - return 0; - } finally { - mCountQuery.release(); - } - } - - @Override - public boolean isInvalid() { - mDb.getInvalidationTracker().refreshVersionsSync(); - return super.isInvalid(); - } - - @SuppressWarnings("WeakerAccess") - protected abstract List convertRows(Cursor cursor); - - @Override - public void loadInitial(@NonNull LoadInitialParams params, - @NonNull LoadInitialCallback callback) { - int totalCount = countItems(); - if (totalCount == 0) { - callback.onResult(Collections.emptyList(), 0, 0); - return; - } - - // bound the size requested, based on known count - final int firstLoadPosition = computeInitialLoadPosition(params, totalCount); - final int firstLoadSize = computeInitialLoadSize(params, firstLoadPosition, totalCount); - - List list = loadRange(firstLoadPosition, firstLoadSize); - if (list != null) { - try { - callback.onResult(list, firstLoadPosition, totalCount); - } catch (IllegalArgumentException e) { - // workaround with paging initial load size NOT to be a multiple of page size - Timber.w(e); - try { - callback.onResult(list, firstLoadPosition, firstLoadPosition + list.size()); - } catch (IllegalArgumentException iae) { - // workaround with paging incorrect tiling - String message = "CancellationLimitOffsetDataSource " - + "firstLoadPosition: " + firstLoadPosition - + ", list size: " + list.size() - + ", count: " + totalCount; - CrashExceptionReportKt.reportException(message, iae); - Timber.w(iae); - } - } - } else { - // null list, or size doesn't match request - DB modified between count and load - invalidate(); - } - } - - @Override - public void loadRange(@NonNull LoadRangeParams params, - @NonNull LoadRangeCallback callback) { - List list = loadRange(params.startPosition, params.loadSize); - if (list != null) { - callback.onResult(list); - } else { - invalidate(); - } - } - - /** - * Return the rows from startPos to startPos + loadCount - */ - @Nullable - public List loadRange(int startPosition, int loadCount) { - final RoomSQLiteQuery sqLiteQuery = RoomSQLiteQuery.acquire(mLimitOffsetQuery, - mSourceQuery.getArgCount() + 2); - sqLiteQuery.copyArgumentsFrom(mSourceQuery); - sqLiteQuery.bindLong(sqLiteQuery.getArgCount() - 1, loadCount); - sqLiteQuery.bindLong(sqLiteQuery.getArgCount(), startPosition); - if (mInTransaction) { - mDb.beginTransaction(); - Cursor cursor = null; - try { - cursor = mDb.query(sqLiteQuery, mCancellationSignal); - List rows = convertRows(cursor); - mDb.setTransactionSuccessful(); - return rows; - } catch (OperationCanceledException e) { - return new ArrayList(); - } finally { - if (cursor != null) { - cursor.close(); - } - mDb.endTransaction(); - sqLiteQuery.release(); - } - } else { - Cursor cursor = mDb.query(sqLiteQuery, mCancellationSignal); - //noinspection TryFinallyCanBeTryWithResources - try { - return convertRows(cursor); - } catch (OperationCanceledException e) { - return new ArrayList(); - } finally { - cursor.close(); - sqLiteQuery.release(); - } - } - } -} \ No newline at end of file diff --git a/app/src/main/java/one/mixin/android/ui/setting/DatabaseDebugFragment.kt b/app/src/main/java/one/mixin/android/ui/setting/DatabaseDebugFragment.kt index 57c0d62b8d..9082ba2f90 100644 --- a/app/src/main/java/one/mixin/android/ui/setting/DatabaseDebugFragment.kt +++ b/app/src/main/java/one/mixin/android/ui/setting/DatabaseDebugFragment.kt @@ -14,6 +14,7 @@ import one.mixin.android.R import one.mixin.android.databinding.FragmentDatabaseDebugBinding import one.mixin.android.db.MixinDatabase import one.mixin.android.db.WalletDatabase +import one.mixin.android.db.datasource.RoomDatabaseCompat import one.mixin.android.db.pending.PendingDatabaseImp import one.mixin.android.extension.defaultSharedPreferences import one.mixin.android.extension.getClipboardManager @@ -94,7 +95,7 @@ class DatabaseDebugFragment : BaseFragment(R.layout.fragment_database_debug) { private fun queryWalletDatabase(sql: String): String { return try { - val cursor = walletDb.openHelper.readableDatabase.query(sql) + val cursor = RoomDatabaseCompat.query(walletDb, sql) val result = StringBuilder() val columnNames = cursor.columnNames diff --git a/app/src/main/java/one/mixin/android/ui/sticker/AlbumAdapter.kt b/app/src/main/java/one/mixin/android/ui/sticker/AlbumAdapter.kt index 73c49a3df1..57e4617681 100644 --- a/app/src/main/java/one/mixin/android/ui/sticker/AlbumAdapter.kt +++ b/app/src/main/java/one/mixin/android/ui/sticker/AlbumAdapter.kt @@ -10,8 +10,8 @@ import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.ListAdapter import androidx.recyclerview.widget.RecyclerView -import androidx.room.Embedded -import androidx.room.Relation +import androidx.room3.Embedded +import androidx.room3.Relation import one.mixin.android.R import one.mixin.android.databinding.ItemAlbumBinding import one.mixin.android.databinding.ItemStickerBinding @@ -111,7 +111,7 @@ class StickerAdapter : ListAdapter(Sticker.DIFF_CALL data class StoreAlbum( @Embedded val album: StickerAlbum, - @Relation(parentColumn = "album_id", entityColumn = "album_id") + @Relation(parentColumns = ["album_id"], entityColumns = ["album_id"]) val stickers: List, ) { companion object { diff --git a/app/src/main/java/one/mixin/android/ui/transfer/TransferInserter.kt b/app/src/main/java/one/mixin/android/ui/transfer/TransferInserter.kt index 99cccf0b98..7731d0aa7d 100644 --- a/app/src/main/java/one/mixin/android/ui/transfer/TransferInserter.kt +++ b/app/src/main/java/one/mixin/android/ui/transfer/TransferInserter.kt @@ -7,6 +7,7 @@ import one.mixin.android.db.converter.ListConverter import one.mixin.android.db.converter.SafeDepositConverter import one.mixin.android.db.converter.SafeWithdrawalConverter import one.mixin.android.db.converter.WithdrawalMemoPossibilityConverter +import one.mixin.android.db.datasource.RoomDatabaseCompat import one.mixin.android.vo.App import one.mixin.android.vo.Asset import one.mixin.android.vo.Conversation @@ -35,10 +36,10 @@ class TransferInserter(val db: MixinDatabase) { Timber.e("Insert assistanceId $value") } field = value - } + } private val writableDatabase by lazy { - db.openHelper.writableDatabase + RoomDatabaseCompat.statementDatabase(db) } fun insertMessages(messages: List) { diff --git a/app/src/main/java/one/mixin/android/ui/transfer/vo/compatible/TransferMessage.kt b/app/src/main/java/one/mixin/android/ui/transfer/vo/compatible/TransferMessage.kt index 69b4750088..50a4461af0 100644 --- a/app/src/main/java/one/mixin/android/ui/transfer/vo/compatible/TransferMessage.kt +++ b/app/src/main/java/one/mixin/android/ui/transfer/vo/compatible/TransferMessage.kt @@ -1,7 +1,7 @@ package one.mixin.android.ui.transfer.vo.compatible -import androidx.room.ColumnInfo -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/app/src/main/java/one/mixin/android/ui/transfer/vo/compatible/TransferMessageMention.kt b/app/src/main/java/one/mixin/android/ui/transfer/vo/compatible/TransferMessageMention.kt index 57cb12bfe7..a6e9a4bdfe 100644 --- a/app/src/main/java/one/mixin/android/ui/transfer/vo/compatible/TransferMessageMention.kt +++ b/app/src/main/java/one/mixin/android/ui/transfer/vo/compatible/TransferMessageMention.kt @@ -1,6 +1,6 @@ package one.mixin.android.ui.transfer.vo.compatible -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo import com.google.gson.annotations.SerializedName import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/app/src/main/java/one/mixin/android/ui/wallet/FilterParams.kt b/app/src/main/java/one/mixin/android/ui/wallet/FilterParams.kt index 99fc03fee3..e41e8ed5c5 100644 --- a/app/src/main/java/one/mixin/android/ui/wallet/FilterParams.kt +++ b/app/src/main/java/one/mixin/android/ui/wallet/FilterParams.kt @@ -1,6 +1,6 @@ package one.mixin.android.ui.wallet -import androidx.sqlite.db.SimpleSQLiteQuery +import androidx.room3.RoomRawQuery import one.mixin.android.R import one.mixin.android.tip.wc.SortOrder import one.mixin.android.vo.AddressItem @@ -47,7 +47,7 @@ class FilterParams( } } - fun buildQuery(): SimpleSQLiteQuery { + fun buildQuery(): RoomRawQuery { val filters = mutableListOf() if (type != SnapshotType.all) { diff --git a/app/src/main/java/one/mixin/android/ui/wallet/OrderFilterParams.kt b/app/src/main/java/one/mixin/android/ui/wallet/OrderFilterParams.kt index bba2374d0d..b075d4641b 100644 --- a/app/src/main/java/one/mixin/android/ui/wallet/OrderFilterParams.kt +++ b/app/src/main/java/one/mixin/android/ui/wallet/OrderFilterParams.kt @@ -1,6 +1,6 @@ package one.mixin.android.ui.wallet -import androidx.sqlite.db.SimpleSQLiteQuery +import androidx.room3.RoomRawQuery import one.mixin.android.db.web3.vo.Web3TokenItem import one.mixin.android.tip.wc.SortOrder import org.threeten.bp.Instant @@ -43,7 +43,7 @@ class OrderFilterParams( return "order:${order.name} tokens:${tokenItems?.map { it.symbol }} statuses:${statuses} fundStatuses:${fundStatuses} startTime:${startTime?.let { Instant.ofEpochMilli(it) } ?: ""} endTime:${endTime?.let { Instant.ofEpochMilli(it + 24 * 60 * 60 * 1000) } ?: ""}" } - fun buildQuery(): SimpleSQLiteQuery { + fun buildQuery(): RoomRawQuery { val parts = buildQueryParts() return WalletFilterQueryGenerated.orders(parts.whereSql, parts.orderSql) } diff --git a/app/src/main/java/one/mixin/android/ui/wallet/WalletFilterQuerySpec.kt b/app/src/main/java/one/mixin/android/ui/wallet/WalletFilterQuerySpec.kt index dd189de0a2..08a7e0f7be 100644 --- a/app/src/main/java/one/mixin/android/ui/wallet/WalletFilterQuerySpec.kt +++ b/app/src/main/java/one/mixin/android/ui/wallet/WalletFilterQuerySpec.kt @@ -1,8 +1,8 @@ package one.mixin.android.ui.wallet -import androidx.sqlite.db.SimpleSQLiteQuery +import androidx.room3.RoomRawQuery import one.mixin.android.codegen.annotation.GeneratedQueryProvider -import one.mixin.android.codegen.annotation.GeneratedSimpleSQLiteQuery +import one.mixin.android.codegen.annotation.GeneratedRoomRawQuery import one.mixin.android.db.SafeSnapshotDao.Companion.SNAPSHOT_ITEM_PREFIX private const val WEB3_TRANSACTION_QUERY_SQL = @@ -25,28 +25,28 @@ private const val WEB3_TRANSACTION_QUERY_SQL = @GeneratedQueryProvider(generatedName = "WalletFilterQueryGenerated") interface WalletFilterQuerySpec { - @GeneratedSimpleSQLiteQuery( + @GeneratedRoomRawQuery( sql = SNAPSHOT_ITEM_PREFIX + "{{whereSql}} {{orderSql}}", ) fun snapshots( whereSql: String, orderSql: String, - ): SimpleSQLiteQuery + ): RoomRawQuery - @GeneratedSimpleSQLiteQuery( + @GeneratedRoomRawQuery( sql = WEB3_TRANSACTION_QUERY_SQL, ) fun web3Transactions( whereSql: String, orderSql: String, walletId: String, - ): SimpleSQLiteQuery + ): RoomRawQuery - @GeneratedSimpleSQLiteQuery( + @GeneratedRoomRawQuery( sql = "SELECT * FROM orders o {{whereSql}} {{orderSql}}", ) fun orders( whereSql: String, orderSql: String, - ): SimpleSQLiteQuery + ): RoomRawQuery } diff --git a/app/src/main/java/one/mixin/android/ui/wallet/Web3FilterParams.kt b/app/src/main/java/one/mixin/android/ui/wallet/Web3FilterParams.kt index cf3d70f7cb..097ab656b2 100644 --- a/app/src/main/java/one/mixin/android/ui/wallet/Web3FilterParams.kt +++ b/app/src/main/java/one/mixin/android/ui/wallet/Web3FilterParams.kt @@ -1,7 +1,7 @@ package one.mixin.android.ui.wallet import android.os.Parcelable -import androidx.sqlite.db.SimpleSQLiteQuery +import androidx.room3.RoomRawQuery import kotlinx.parcelize.Parcelize import one.mixin.android.db.web3.vo.TransactionStatus import one.mixin.android.db.web3.vo.Web3TokenItem @@ -53,7 +53,7 @@ class Web3FilterParams( return formatter.format(Instant.ofEpochMilli(timestamp)) } - fun buildQuery(): SimpleSQLiteQuery { + fun buildQuery(): RoomRawQuery { val filters = mutableListOf() tokenItems?.let { diff --git a/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/Alert.kt b/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/Alert.kt index 570f7f6436..42a6ef70c1 100644 --- a/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/Alert.kt +++ b/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/Alert.kt @@ -3,10 +3,10 @@ package one.mixin.android.ui.wallet.alert.vo import androidx.compose.runtime.Composable import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.stringResource -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey -import androidx.room.TypeConverters +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey +import androidx.room3.ColumnTypeConverters import com.google.gson.annotations.SerializedName import one.mixin.android.R import one.mixin.android.compose.theme.MixinAppTheme @@ -19,7 +19,7 @@ import one.mixin.android.ui.wallet.alert.vo.AlertType.PRICE_REACHED import java.math.BigDecimal @Entity("market_alerts") -@TypeConverters(AlertFrequencyConverter::class, AlertTypeConverter::class, AlertStatusConverter::class) +@ColumnTypeConverters(AlertFrequencyConverter::class, AlertTypeConverter::class, AlertStatusConverter::class) class Alert( @PrimaryKey @ColumnInfo(name = "alert_id") diff --git a/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/AlertFrequencyConverter.kt b/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/AlertFrequencyConverter.kt index 267d081a30..2b878ec283 100644 --- a/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/AlertFrequencyConverter.kt +++ b/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/AlertFrequencyConverter.kt @@ -1,11 +1,11 @@ package one.mixin.android.ui.wallet.alert.vo -import androidx.room.TypeConverter +import androidx.room3.ColumnTypeConverter class AlertFrequencyConverter { - @TypeConverter + @ColumnTypeConverter fun toFrequency(value: String) = requireNotNull(AlertFrequency.entries.firstOrNull { it.value == value }) - @TypeConverter + @ColumnTypeConverter fun fromFrequency(value: AlertFrequency) = value.value } diff --git a/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/AlertGroup.kt b/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/AlertGroup.kt index 68a9403d55..77f8e3be0a 100644 --- a/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/AlertGroup.kt +++ b/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/AlertGroup.kt @@ -1,6 +1,6 @@ package one.mixin.android.ui.wallet.alert.vo -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo class AlertGroup( @ColumnInfo("coin_id") diff --git a/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/AlertStatusConverter.kt b/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/AlertStatusConverter.kt index 0e5ccdabcd..5fa9068fb6 100644 --- a/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/AlertStatusConverter.kt +++ b/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/AlertStatusConverter.kt @@ -1,11 +1,11 @@ package one.mixin.android.ui.wallet.alert.vo -import androidx.room.TypeConverter +import androidx.room3.ColumnTypeConverter class AlertStatusConverter { - @TypeConverter + @ColumnTypeConverter fun toFrequency(value: String) = requireNotNull(AlertStatus.entries.firstOrNull { it.value == value }) - @TypeConverter + @ColumnTypeConverter fun fromFrequency(value: AlertStatus) = value.value } diff --git a/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/AlertTypeConverter.kt b/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/AlertTypeConverter.kt index 62dbddf418..80d52f2671 100644 --- a/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/AlertTypeConverter.kt +++ b/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/AlertTypeConverter.kt @@ -1,11 +1,11 @@ package one.mixin.android.ui.wallet.alert.vo -import androidx.room.TypeConverter +import androidx.room3.ColumnTypeConverter class AlertTypeConverter { - @TypeConverter + @ColumnTypeConverter fun toType(value: String) = requireNotNull(AlertType.entries.firstOrNull { it.value == value }) - @TypeConverter + @ColumnTypeConverter fun fromType(value: AlertType) = value.value } diff --git a/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/CoinItem.kt b/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/CoinItem.kt index 1452a17e0d..1ede7c5599 100644 --- a/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/CoinItem.kt +++ b/app/src/main/java/one/mixin/android/ui/wallet/alert/vo/CoinItem.kt @@ -2,7 +2,7 @@ package one.mixin.android.ui.wallet.alert.vo import android.os.Parcelable import androidx.recyclerview.widget.DiffUtil -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo import kotlinx.parcelize.Parcelize @Parcelize diff --git a/app/src/main/java/one/mixin/android/util/Converters.kt b/app/src/main/java/one/mixin/android/util/Converters.kt index 22b8e4d8ff..ebf14bfa8a 100644 --- a/app/src/main/java/one/mixin/android/util/Converters.kt +++ b/app/src/main/java/one/mixin/android/util/Converters.kt @@ -1,18 +1,18 @@ package one.mixin.android.util -import androidx.room.TypeConverter +import androidx.room3.ColumnTypeConverter import com.google.gson.Gson import com.google.gson.reflect.TypeToken object Converters { - @TypeConverter + @ColumnTypeConverter fun fromString(value: String?): ArrayList { val listType = object : TypeToken?>() {}.type return Gson().fromJson(value, listType) } - @TypeConverter + @ColumnTypeConverter fun fromArrayList(list: ArrayList?): String { val gson = Gson() return gson.toJson(list) diff --git a/app/src/main/java/one/mixin/android/util/database/DatabaseUtil.kt b/app/src/main/java/one/mixin/android/util/database/DatabaseUtil.kt index 65e77bc639..5904fefb7f 100644 --- a/app/src/main/java/one/mixin/android/util/database/DatabaseUtil.kt +++ b/app/src/main/java/one/mixin/android/util/database/DatabaseUtil.kt @@ -5,9 +5,11 @@ import android.content.Context import android.database.Cursor import android.database.sqlite.SQLiteDatabase import android.os.Build -import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room3.Transactor.SQLiteTransactionType +import androidx.room3.useWriterConnection import one.mixin.android.Constants import one.mixin.android.db.MixinDatabase +import one.mixin.android.db.datasource.execSQL import one.mixin.android.extension.moveTo import one.mixin.android.util.reportException import one.mixin.android.vo.Account @@ -28,31 +30,28 @@ suspend fun clearJobsAndRawTransaction( return } - var db: SupportSQLiteDatabase? = null try { - // At this point, migration should have already happened via CurrentUserScopeManager.enter() - // So we can safely get the database which should be the migrated scoped database - db = MixinDatabase.getWritableDatabase() ?: return - if (!supportsDeferForeignKeys) { - db.execSQL("PRAGMA foreign_keys = FALSE") + val db = MixinDatabase.getDatabase(context, identityNumber) + db.useWriterConnection { connection -> + if (!supportsDeferForeignKeys) { + connection.execSQL("PRAGMA foreign_keys = FALSE") + } + if (supportsDeferForeignKeys) { + connection.execSQL("PRAGMA defer_foreign_keys = TRUE") + } + connection.withTransaction(SQLiteTransactionType.IMMEDIATE) { + execSQL("DELETE FROM `jobs`") + execSQL("DELETE FROM `raw_transactions`") + execSQL("DELETE FROM `outputs`") + } + if (!supportsDeferForeignKeys) { + connection.execSQL("PRAGMA foreign_keys = TRUE") + } } - if (supportsDeferForeignKeys) { - db.execSQL("PRAGMA defer_foreign_keys = TRUE") - } - db.beginTransaction() - db.execSQL("DELETE FROM `jobs`") - db.execSQL("DELETE FROM `raw_transactions`") - db.execSQL("DELETE FROM `outputs`") - db.setTransactionSuccessful() Timber.e("Clear jobs and raw transaction") } catch (e: Exception) { Timber.e(e) reportException(e) - } finally { - db?.endTransaction() - if (!supportsDeferForeignKeys) { - db?.execSQL("PRAGMA foreign_keys = TRUE") - } } } diff --git a/app/src/main/java/one/mixin/android/vo/Address.kt b/app/src/main/java/one/mixin/android/vo/Address.kt index 43efa951dd..ff9f04238c 100644 --- a/app/src/main/java/one/mixin/android/vo/Address.kt +++ b/app/src/main/java/one/mixin/android/vo/Address.kt @@ -2,10 +2,10 @@ package one.mixin.android.vo import android.annotation.SuppressLint import android.os.Parcelable -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.Index -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.Index +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/one/mixin/android/vo/App.kt b/app/src/main/java/one/mixin/android/vo/App.kt index 7add66a860..261c233ac4 100644 --- a/app/src/main/java/one/mixin/android/vo/App.kt +++ b/app/src/main/java/one/mixin/android/vo/App.kt @@ -3,10 +3,10 @@ package one.mixin.android.vo import android.annotation.SuppressLint import android.os.Parcelable import androidx.recyclerview.widget.DiffUtil -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey -import androidx.room.TypeConverters +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey +import androidx.room3.ColumnTypeConverters import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize import kotlinx.serialization.SerialName @@ -19,7 +19,7 @@ interface BotInterface { @SuppressLint("ParcelCreator") @Parcelize -@TypeConverters(ListConverter::class) +@ColumnTypeConverters(ListConverter::class) @Entity(tableName = "apps") @Serializable data class App( diff --git a/app/src/main/java/one/mixin/android/vo/AppItem.kt b/app/src/main/java/one/mixin/android/vo/AppItem.kt index f4251ef26d..f767158c43 100644 --- a/app/src/main/java/one/mixin/android/vo/AppItem.kt +++ b/app/src/main/java/one/mixin/android/vo/AppItem.kt @@ -1,8 +1,8 @@ package one.mixin.android.vo -import androidx.room.TypeConverters +import androidx.room3.ColumnTypeConverters -@TypeConverters(ArrayConverters::class) +@ColumnTypeConverters(ArrayConverters::class) class AppItem( val appId: String, val appNumber: String, diff --git a/app/src/main/java/one/mixin/android/vo/ArrayConverters.java b/app/src/main/java/one/mixin/android/vo/ArrayConverters.java index b3c91346e5..91063e8c81 100644 --- a/app/src/main/java/one/mixin/android/vo/ArrayConverters.java +++ b/app/src/main/java/one/mixin/android/vo/ArrayConverters.java @@ -1,6 +1,6 @@ package one.mixin.android.vo; -import androidx.room.TypeConverter; +import androidx.room3.ColumnTypeConverter; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; @@ -8,14 +8,14 @@ import java.util.ArrayList; public class ArrayConverters { - @TypeConverter + @ColumnTypeConverter public static ArrayList fromString(String value) { Type listType = new TypeToken>() { }.getType(); return new Gson().fromJson(value, listType); } - @TypeConverter + @ColumnTypeConverter public static String fromArrayList(ArrayList list) { Gson gson = new Gson(); return gson.toJson(list); diff --git a/app/src/main/java/one/mixin/android/vo/Asset.kt b/app/src/main/java/one/mixin/android/vo/Asset.kt index a7de039b75..33e90c54b2 100644 --- a/app/src/main/java/one/mixin/android/vo/Asset.kt +++ b/app/src/main/java/one/mixin/android/vo/Asset.kt @@ -2,9 +2,9 @@ package one.mixin.android.vo import android.annotation.SuppressLint import android.os.Parcelable -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize import kotlinx.serialization.SerialName diff --git a/app/src/main/java/one/mixin/android/vo/AssetsExtra.kt b/app/src/main/java/one/mixin/android/vo/AssetsExtra.kt index 891dacc905..a36cc41b6d 100644 --- a/app/src/main/java/one/mixin/android/vo/AssetsExtra.kt +++ b/app/src/main/java/one/mixin/android/vo/AssetsExtra.kt @@ -2,9 +2,9 @@ package one.mixin.android.vo import android.annotation.SuppressLint import android.os.Parcelable -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/one/mixin/android/vo/AttachmentMigration.kt b/app/src/main/java/one/mixin/android/vo/AttachmentMigration.kt index 9df9df8c6e..775f4a5d28 100644 --- a/app/src/main/java/one/mixin/android/vo/AttachmentMigration.kt +++ b/app/src/main/java/one/mixin/android/vo/AttachmentMigration.kt @@ -2,7 +2,7 @@ package one.mixin.android.vo import android.content.Context import androidx.core.net.toFile -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo import one.mixin.android.extension.generateConversationPath import one.mixin.android.extension.getAudioPath import one.mixin.android.extension.getDocumentPath diff --git a/app/src/main/java/one/mixin/android/vo/CallUser.kt b/app/src/main/java/one/mixin/android/vo/CallUser.kt index e01c7f9cd3..14e3cb1869 100644 --- a/app/src/main/java/one/mixin/android/vo/CallUser.kt +++ b/app/src/main/java/one/mixin/android/vo/CallUser.kt @@ -1,7 +1,7 @@ package one.mixin.android.vo import androidx.recyclerview.widget.DiffUtil -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo class CallUser( @ColumnInfo(name = "user_id") diff --git a/app/src/main/java/one/mixin/android/vo/Chain.kt b/app/src/main/java/one/mixin/android/vo/Chain.kt index 2dfa1b53f2..b44cb06a70 100644 --- a/app/src/main/java/one/mixin/android/vo/Chain.kt +++ b/app/src/main/java/one/mixin/android/vo/Chain.kt @@ -1,8 +1,8 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName @Entity(tableName = "chains") diff --git a/app/src/main/java/one/mixin/android/vo/ChainItem.kt b/app/src/main/java/one/mixin/android/vo/ChainItem.kt index b514bed897..142bf20710 100644 --- a/app/src/main/java/one/mixin/android/vo/ChainItem.kt +++ b/app/src/main/java/one/mixin/android/vo/ChainItem.kt @@ -2,7 +2,7 @@ package one.mixin.android.vo import android.os.Parcelable import androidx.recyclerview.widget.DiffUtil -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo import kotlinx.parcelize.Parcelize @Parcelize diff --git a/app/src/main/java/one/mixin/android/vo/Circle.kt b/app/src/main/java/one/mixin/android/vo/Circle.kt index d6e92fa38b..d3f865ae45 100644 --- a/app/src/main/java/one/mixin/android/vo/Circle.kt +++ b/app/src/main/java/one/mixin/android/vo/Circle.kt @@ -1,8 +1,8 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.Expose import com.google.gson.annotations.SerializedName diff --git a/app/src/main/java/one/mixin/android/vo/CircleConversation.kt b/app/src/main/java/one/mixin/android/vo/CircleConversation.kt index 799cda21ab..f1f09fe81f 100644 --- a/app/src/main/java/one/mixin/android/vo/CircleConversation.kt +++ b/app/src/main/java/one/mixin/android/vo/CircleConversation.kt @@ -1,7 +1,7 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity +import androidx.room3.ColumnInfo +import androidx.room3.Entity import com.google.gson.annotations.Expose import com.google.gson.annotations.SerializedName diff --git a/app/src/main/java/one/mixin/android/vo/Conversation.kt b/app/src/main/java/one/mixin/android/vo/Conversation.kt index a25476458e..8fb65bb81e 100644 --- a/app/src/main/java/one/mixin/android/vo/Conversation.kt +++ b/app/src/main/java/one/mixin/android/vo/Conversation.kt @@ -1,9 +1,9 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.Index -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.Index +import androidx.room3.PrimaryKey import com.google.gson.annotations.Expose import com.google.gson.annotations.SerializedName import kotlinx.serialization.SerialName diff --git a/app/src/main/java/one/mixin/android/vo/ConversationCircleItem.kt b/app/src/main/java/one/mixin/android/vo/ConversationCircleItem.kt index b0775bb1e9..5a6a01fd04 100644 --- a/app/src/main/java/one/mixin/android/vo/ConversationCircleItem.kt +++ b/app/src/main/java/one/mixin/android/vo/ConversationCircleItem.kt @@ -2,7 +2,7 @@ package one.mixin.android.vo import android.graphics.Color import android.os.Parcelable -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo import kotlinx.parcelize.Parcelize import one.mixin.android.MixinApplication import one.mixin.android.R diff --git a/app/src/main/java/one/mixin/android/vo/ConversationCircleManagerItem.kt b/app/src/main/java/one/mixin/android/vo/ConversationCircleManagerItem.kt index bcd57cea04..b41d61c202 100644 --- a/app/src/main/java/one/mixin/android/vo/ConversationCircleManagerItem.kt +++ b/app/src/main/java/one/mixin/android/vo/ConversationCircleManagerItem.kt @@ -1,7 +1,7 @@ package one.mixin.android.vo import android.os.Parcelable -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo import kotlinx.parcelize.Parcelize @Parcelize diff --git a/app/src/main/java/one/mixin/android/vo/ConversationExt.kt b/app/src/main/java/one/mixin/android/vo/ConversationExt.kt index a30bd85628..11c6e1f918 100644 --- a/app/src/main/java/one/mixin/android/vo/ConversationExt.kt +++ b/app/src/main/java/one/mixin/android/vo/ConversationExt.kt @@ -1,8 +1,8 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey @Entity(tableName = "conversation_ext") class ConversationExt( diff --git a/app/src/main/java/one/mixin/android/vo/ConversationItem.kt b/app/src/main/java/one/mixin/android/vo/ConversationItem.kt index 5b2868589a..85ab94c816 100644 --- a/app/src/main/java/one/mixin/android/vo/ConversationItem.kt +++ b/app/src/main/java/one/mixin/android/vo/ConversationItem.kt @@ -1,7 +1,7 @@ package one.mixin.android.vo import androidx.recyclerview.widget.DiffUtil -import androidx.room.Entity +import androidx.room3.Entity import one.mixin.android.websocket.SystemConversationAction import org.threeten.bp.Instant diff --git a/app/src/main/java/one/mixin/android/vo/ConversationStorageUsage.kt b/app/src/main/java/one/mixin/android/vo/ConversationStorageUsage.kt index dc74146ef9..386e116de5 100644 --- a/app/src/main/java/one/mixin/android/vo/ConversationStorageUsage.kt +++ b/app/src/main/java/one/mixin/android/vo/ConversationStorageUsage.kt @@ -1,7 +1,7 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Ignore +import androidx.room3.ColumnInfo +import androidx.room3.Ignore class ConversationStorageUsage( @ColumnInfo(name = "conversation_id") diff --git a/app/src/main/java/one/mixin/android/vo/ConversationWithStatus.kt b/app/src/main/java/one/mixin/android/vo/ConversationWithStatus.kt index c91e22dd45..fffc9391e0 100644 --- a/app/src/main/java/one/mixin/android/vo/ConversationWithStatus.kt +++ b/app/src/main/java/one/mixin/android/vo/ConversationWithStatus.kt @@ -1,6 +1,6 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo class ConversationWithStatus( @ColumnInfo(name = "conversation_id") diff --git a/app/src/main/java/one/mixin/android/vo/ExpiredMessage.kt b/app/src/main/java/one/mixin/android/vo/ExpiredMessage.kt index ce257589fb..c1af0dfb16 100644 --- a/app/src/main/java/one/mixin/android/vo/ExpiredMessage.kt +++ b/app/src/main/java/one/mixin/android/vo/ExpiredMessage.kt @@ -1,8 +1,8 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/app/src/main/java/one/mixin/android/vo/ExploreApp.kt b/app/src/main/java/one/mixin/android/vo/ExploreApp.kt index 12775cea88..f665dcc44a 100644 --- a/app/src/main/java/one/mixin/android/vo/ExploreApp.kt +++ b/app/src/main/java/one/mixin/android/vo/ExploreApp.kt @@ -1,6 +1,6 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo import com.google.gson.annotations.SerializedName import kotlinx.serialization.SerialName diff --git a/app/src/main/java/one/mixin/android/vo/FavoriteApp.kt b/app/src/main/java/one/mixin/android/vo/FavoriteApp.kt index 4f678a7335..2bf4749a60 100644 --- a/app/src/main/java/one/mixin/android/vo/FavoriteApp.kt +++ b/app/src/main/java/one/mixin/android/vo/FavoriteApp.kt @@ -1,7 +1,7 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity +import androidx.room3.ColumnInfo +import androidx.room3.Entity import com.google.gson.annotations.SerializedName @Entity( diff --git a/app/src/main/java/one/mixin/android/vo/FloodMessage.kt b/app/src/main/java/one/mixin/android/vo/FloodMessage.kt index 0e79a896b1..e668789ea6 100644 --- a/app/src/main/java/one/mixin/android/vo/FloodMessage.kt +++ b/app/src/main/java/one/mixin/android/vo/FloodMessage.kt @@ -1,8 +1,8 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName @Entity(tableName = "flood_messages") diff --git a/app/src/main/java/one/mixin/android/vo/ForwardUser.kt b/app/src/main/java/one/mixin/android/vo/ForwardUser.kt index d8dacd1ee9..2346d8a823 100644 --- a/app/src/main/java/one/mixin/android/vo/ForwardUser.kt +++ b/app/src/main/java/one/mixin/android/vo/ForwardUser.kt @@ -1,9 +1,9 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.TypeConverters +import androidx.room3.ColumnInfo +import androidx.room3.ColumnTypeConverters -@TypeConverters(ArrayConverters::class) +@ColumnTypeConverters(ArrayConverters::class) data class ForwardUser( @ColumnInfo(name = "user_id") val userId: String, diff --git a/app/src/main/java/one/mixin/android/vo/FtsSearchResult.kt b/app/src/main/java/one/mixin/android/vo/FtsSearchResult.kt index e65b007898..dc020c77f0 100644 --- a/app/src/main/java/one/mixin/android/vo/FtsSearchResult.kt +++ b/app/src/main/java/one/mixin/android/vo/FtsSearchResult.kt @@ -1,6 +1,6 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo class FtsSearchResult( @ColumnInfo(name = "message_id") diff --git a/app/src/main/java/one/mixin/android/vo/GroupInfo.kt b/app/src/main/java/one/mixin/android/vo/GroupInfo.kt index aa5b3aab32..95d9134524 100644 --- a/app/src/main/java/one/mixin/android/vo/GroupInfo.kt +++ b/app/src/main/java/one/mixin/android/vo/GroupInfo.kt @@ -1,6 +1,6 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo class GroupInfo( @ColumnInfo(name = "name") diff --git a/app/src/main/java/one/mixin/android/vo/Hyperlink.kt b/app/src/main/java/one/mixin/android/vo/Hyperlink.kt index 08adcee92b..8a9942d824 100644 --- a/app/src/main/java/one/mixin/android/vo/Hyperlink.kt +++ b/app/src/main/java/one/mixin/android/vo/Hyperlink.kt @@ -1,8 +1,8 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey @Entity(tableName = "hyperlinks") data class Hyperlink( diff --git a/app/src/main/java/one/mixin/android/vo/InscriptionCollection.kt b/app/src/main/java/one/mixin/android/vo/InscriptionCollection.kt index 1501848305..233b9bb663 100644 --- a/app/src/main/java/one/mixin/android/vo/InscriptionCollection.kt +++ b/app/src/main/java/one/mixin/android/vo/InscriptionCollection.kt @@ -1,10 +1,10 @@ package one.mixin.android.vo import android.os.Parcelable -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.Ignore -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.Ignore +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.parcelize.IgnoredOnParcel import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/one/mixin/android/vo/InscriptionItem.kt b/app/src/main/java/one/mixin/android/vo/InscriptionItem.kt index 48a1c58c80..e99eacde78 100644 --- a/app/src/main/java/one/mixin/android/vo/InscriptionItem.kt +++ b/app/src/main/java/one/mixin/android/vo/InscriptionItem.kt @@ -1,9 +1,9 @@ package one.mixin.android.vo import android.os.Parcelable -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/one/mixin/android/vo/Job.kt b/app/src/main/java/one/mixin/android/vo/Job.kt index 763c8090d4..e64a8c94ff 100644 --- a/app/src/main/java/one/mixin/android/vo/Job.kt +++ b/app/src/main/java/one/mixin/android/vo/Job.kt @@ -1,9 +1,9 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.Index -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.Index +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import one.mixin.android.extension.nowInUtc import one.mixin.android.job.BaseJob.Companion.PRIORITY_ACK_MESSAGE diff --git a/app/src/main/java/one/mixin/android/vo/MediaMessageMinimal.kt b/app/src/main/java/one/mixin/android/vo/MediaMessageMinimal.kt index dfcd21eb8c..bac559d0fc 100644 --- a/app/src/main/java/one/mixin/android/vo/MediaMessageMinimal.kt +++ b/app/src/main/java/one/mixin/android/vo/MediaMessageMinimal.kt @@ -1,6 +1,6 @@ package one.mixin.android.vo -import androidx.room.Entity +import androidx.room3.Entity @Entity data class MediaMessageMinimal( diff --git a/app/src/main/java/one/mixin/android/vo/MentionUser.kt b/app/src/main/java/one/mixin/android/vo/MentionUser.kt index 2e1527ef23..3b9b6737ee 100644 --- a/app/src/main/java/one/mixin/android/vo/MentionUser.kt +++ b/app/src/main/java/one/mixin/android/vo/MentionUser.kt @@ -1,6 +1,6 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo import com.google.gson.annotations.SerializedName data class MentionUser( diff --git a/app/src/main/java/one/mixin/android/vo/Message.kt b/app/src/main/java/one/mixin/android/vo/Message.kt index 5bf80c5f4c..b243dae487 100644 --- a/app/src/main/java/one/mixin/android/vo/Message.kt +++ b/app/src/main/java/one/mixin/android/vo/Message.kt @@ -1,12 +1,12 @@ package one.mixin.android.vo import android.content.Context -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.ForeignKey -import androidx.room.ForeignKey.Companion.CASCADE -import androidx.room.Index -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.ForeignKey +import androidx.room3.ForeignKey.Companion.CASCADE +import androidx.room3.Index +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.serialization.SerialName import one.mixin.android.MixinApplication diff --git a/app/src/main/java/one/mixin/android/vo/MessageFts4.kt b/app/src/main/java/one/mixin/android/vo/MessageFts4.kt index 7178c65978..e36458ddc9 100644 --- a/app/src/main/java/one/mixin/android/vo/MessageFts4.kt +++ b/app/src/main/java/one/mixin/android/vo/MessageFts4.kt @@ -1,10 +1,10 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.ColumnInfo.Companion.TEXT -import androidx.room.Entity -import androidx.room.Fts4 -import androidx.room.FtsOptions +import androidx.room3.ColumnInfo +import androidx.room3.ColumnInfo.Companion.TEXT +import androidx.room3.Entity +import androidx.room3.Fts4 +import androidx.room3.FtsOptions @Entity(tableName = "messages_fts4") @Fts4(notIndexed = ["message_id"], tokenizer = FtsOptions.TOKENIZER_UNICODE61) diff --git a/app/src/main/java/one/mixin/android/vo/MessageHistory.kt b/app/src/main/java/one/mixin/android/vo/MessageHistory.kt index 81d3e41fdb..b9e342cc66 100644 --- a/app/src/main/java/one/mixin/android/vo/MessageHistory.kt +++ b/app/src/main/java/one/mixin/android/vo/MessageHistory.kt @@ -1,8 +1,8 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey @Entity(tableName = "messages_history") class MessageHistory( diff --git a/app/src/main/java/one/mixin/android/vo/MessageItem.kt b/app/src/main/java/one/mixin/android/vo/MessageItem.kt index 6a517a420b..915185767b 100644 --- a/app/src/main/java/one/mixin/android/vo/MessageItem.kt +++ b/app/src/main/java/one/mixin/android/vo/MessageItem.kt @@ -16,9 +16,9 @@ import androidx.media3.common.MimeTypes import androidx.media3.common.util.UnstableApi import androidx.paging.PositionalDataSource import androidx.recyclerview.widget.DiffUtil -import androidx.room.Entity -import androidx.room.Ignore -import androidx.room.PrimaryKey +import androidx.room3.Entity +import androidx.room3.Ignore +import androidx.room3.PrimaryKey import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import kotlinx.parcelize.IgnoredOnParcel diff --git a/app/src/main/java/one/mixin/android/vo/MessageMedia.kt b/app/src/main/java/one/mixin/android/vo/MessageMedia.kt index 37ebf83808..7266569255 100644 --- a/app/src/main/java/one/mixin/android/vo/MessageMedia.kt +++ b/app/src/main/java/one/mixin/android/vo/MessageMedia.kt @@ -1,6 +1,6 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo class MessageMedia( @ColumnInfo(name = "category") diff --git a/app/src/main/java/one/mixin/android/vo/MessageMention.kt b/app/src/main/java/one/mixin/android/vo/MessageMention.kt index 4b843bd755..b3365287b3 100644 --- a/app/src/main/java/one/mixin/android/vo/MessageMention.kt +++ b/app/src/main/java/one/mixin/android/vo/MessageMention.kt @@ -1,9 +1,9 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.Index -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.Index +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName @Entity( diff --git a/app/src/main/java/one/mixin/android/vo/MessageMinimal.kt b/app/src/main/java/one/mixin/android/vo/MessageMinimal.kt index 9e9896d6e3..2f23192e9b 100644 --- a/app/src/main/java/one/mixin/android/vo/MessageMinimal.kt +++ b/app/src/main/java/one/mixin/android/vo/MessageMinimal.kt @@ -1,7 +1,7 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity +import androidx.room3.ColumnInfo +import androidx.room3.Entity @Entity data class MessageMinimal( diff --git a/app/src/main/java/one/mixin/android/vo/Offset.kt b/app/src/main/java/one/mixin/android/vo/Offset.kt index e4dcabd378..c2c6ffd368 100644 --- a/app/src/main/java/one/mixin/android/vo/Offset.kt +++ b/app/src/main/java/one/mixin/android/vo/Offset.kt @@ -1,8 +1,8 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey @Entity(tableName = "offsets") data class Offset( diff --git a/app/src/main/java/one/mixin/android/vo/OldDepositEntry.kt b/app/src/main/java/one/mixin/android/vo/OldDepositEntry.kt index 96d4f6ca52..7c20617f93 100644 --- a/app/src/main/java/one/mixin/android/vo/OldDepositEntry.kt +++ b/app/src/main/java/one/mixin/android/vo/OldDepositEntry.kt @@ -1,7 +1,7 @@ package one.mixin.android.vo import android.os.Parcelable -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize import kotlinx.serialization.SerialName diff --git a/app/src/main/java/one/mixin/android/vo/Participant.kt b/app/src/main/java/one/mixin/android/vo/Participant.kt index 6f0eff66de..abb2a8721b 100644 --- a/app/src/main/java/one/mixin/android/vo/Participant.kt +++ b/app/src/main/java/one/mixin/android/vo/Participant.kt @@ -1,9 +1,9 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.ForeignKey -import androidx.room.ForeignKey.Companion.CASCADE +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.ForeignKey +import androidx.room3.ForeignKey.Companion.CASCADE import com.google.gson.annotations.SerializedName import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/app/src/main/java/one/mixin/android/vo/ParticipantSession.kt b/app/src/main/java/one/mixin/android/vo/ParticipantSession.kt index ed30f52243..ffb03ecfff 100644 --- a/app/src/main/java/one/mixin/android/vo/ParticipantSession.kt +++ b/app/src/main/java/one/mixin/android/vo/ParticipantSession.kt @@ -1,7 +1,7 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity +import androidx.room3.ColumnInfo +import androidx.room3.Entity import one.mixin.android.extension.md5 import one.mixin.android.extension.nowInUtc diff --git a/app/src/main/java/one/mixin/android/vo/ParticipantSessionMinimal.kt b/app/src/main/java/one/mixin/android/vo/ParticipantSessionMinimal.kt index 9088f7b5e0..76a5c041f6 100644 --- a/app/src/main/java/one/mixin/android/vo/ParticipantSessionMinimal.kt +++ b/app/src/main/java/one/mixin/android/vo/ParticipantSessionMinimal.kt @@ -1,10 +1,10 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.TypeConverters +import androidx.room3.ColumnInfo +import androidx.room3.ColumnTypeConverters import one.mixin.android.db.converter.ListConverter -@TypeConverters(ListConverter::class) +@ColumnTypeConverters(ListConverter::class) class ParticipantSessionMinimal( @ColumnInfo(name = "conversation_id") val conversationId: String, diff --git a/app/src/main/java/one/mixin/android/vo/PendingDisplay.kt b/app/src/main/java/one/mixin/android/vo/PendingDisplay.kt index 164072f9e4..3f987f399d 100644 --- a/app/src/main/java/one/mixin/android/vo/PendingDisplay.kt +++ b/app/src/main/java/one/mixin/android/vo/PendingDisplay.kt @@ -1,6 +1,6 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo class PendingDisplay( @ColumnInfo(name = "symbol") diff --git a/app/src/main/java/one/mixin/android/vo/PinMessage.kt b/app/src/main/java/one/mixin/android/vo/PinMessage.kt index 567937480e..3f122b71ed 100644 --- a/app/src/main/java/one/mixin/android/vo/PinMessage.kt +++ b/app/src/main/java/one/mixin/android/vo/PinMessage.kt @@ -1,9 +1,9 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.Index -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.Index +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/app/src/main/java/one/mixin/android/vo/PinMessageItem.kt b/app/src/main/java/one/mixin/android/vo/PinMessageItem.kt index 69debdaea9..e0e51c8f45 100644 --- a/app/src/main/java/one/mixin/android/vo/PinMessageItem.kt +++ b/app/src/main/java/one/mixin/android/vo/PinMessageItem.kt @@ -1,7 +1,7 @@ package one.mixin.android.vo import android.content.Context -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo import one.mixin.android.R class PinMessageItem( diff --git a/app/src/main/java/one/mixin/android/vo/Property.kt b/app/src/main/java/one/mixin/android/vo/Property.kt index 8c8d7af512..581b2a0ed7 100644 --- a/app/src/main/java/one/mixin/android/vo/Property.kt +++ b/app/src/main/java/one/mixin/android/vo/Property.kt @@ -1,8 +1,8 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey @Entity(tableName = "properties") data class Property( diff --git a/app/src/main/java/one/mixin/android/vo/QuoteMessageItem.kt b/app/src/main/java/one/mixin/android/vo/QuoteMessageItem.kt index 8a7727256b..1ee4ddc5a6 100644 --- a/app/src/main/java/one/mixin/android/vo/QuoteMessageItem.kt +++ b/app/src/main/java/one/mixin/android/vo/QuoteMessageItem.kt @@ -2,7 +2,7 @@ package one.mixin.android.vo import android.annotation.SuppressLint import android.os.Parcelable -import androidx.room.Entity +import androidx.room3.Entity import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize import one.mixin.android.Constants.DEFAULT_THUMB_IMAGE diff --git a/app/src/main/java/one/mixin/android/vo/QuoteMinimal.kt b/app/src/main/java/one/mixin/android/vo/QuoteMinimal.kt index 85650f6fec..918dc9f39d 100644 --- a/app/src/main/java/one/mixin/android/vo/QuoteMinimal.kt +++ b/app/src/main/java/one/mixin/android/vo/QuoteMinimal.kt @@ -1,7 +1,7 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity +import androidx.room3.ColumnInfo +import androidx.room3.Entity @Entity data class QuoteMinimal( diff --git a/app/src/main/java/one/mixin/android/vo/RecentUsedApp.kt b/app/src/main/java/one/mixin/android/vo/RecentUsedApp.kt index 9345b3857b..673318ba35 100644 --- a/app/src/main/java/one/mixin/android/vo/RecentUsedApp.kt +++ b/app/src/main/java/one/mixin/android/vo/RecentUsedApp.kt @@ -1,7 +1,7 @@ package one.mixin.android.vo import androidx.recyclerview.widget.DiffUtil -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo data class RecentUsedApp( @ColumnInfo(name = "full_name") diff --git a/app/src/main/java/one/mixin/android/vo/Recipient.kt b/app/src/main/java/one/mixin/android/vo/Recipient.kt index 5d487bb6d0..d95863680d 100644 --- a/app/src/main/java/one/mixin/android/vo/Recipient.kt +++ b/app/src/main/java/one/mixin/android/vo/Recipient.kt @@ -2,7 +2,7 @@ package one.mixin.android.vo import android.os.Parcelable import androidx.recyclerview.widget.DiffUtil -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/one/mixin/android/vo/RemoteMessageStatus.kt b/app/src/main/java/one/mixin/android/vo/RemoteMessageStatus.kt index e8c4edab7a..5dabb08dc0 100644 --- a/app/src/main/java/one/mixin/android/vo/RemoteMessageStatus.kt +++ b/app/src/main/java/one/mixin/android/vo/RemoteMessageStatus.kt @@ -1,9 +1,9 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.Index -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.Index +import androidx.room3.PrimaryKey @Entity( tableName = "remote_messages_status", diff --git a/app/src/main/java/one/mixin/android/vo/ResendMessage.kt b/app/src/main/java/one/mixin/android/vo/ResendMessage.kt index 659100b3e2..89b4c4841a 100644 --- a/app/src/main/java/one/mixin/android/vo/ResendMessage.kt +++ b/app/src/main/java/one/mixin/android/vo/ResendMessage.kt @@ -1,7 +1,7 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity +import androidx.room3.ColumnInfo +import androidx.room3.Entity @Entity(tableName = "resend_messages", primaryKeys = ["message_id", "user_id"]) class ResendMessage( diff --git a/app/src/main/java/one/mixin/android/vo/ResendSessionMessage.kt b/app/src/main/java/one/mixin/android/vo/ResendSessionMessage.kt index 0b8344ce10..2282a791df 100644 --- a/app/src/main/java/one/mixin/android/vo/ResendSessionMessage.kt +++ b/app/src/main/java/one/mixin/android/vo/ResendSessionMessage.kt @@ -1,7 +1,7 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity +import androidx.room3.ColumnInfo +import androidx.room3.Entity @Entity(tableName = "resend_session_messages", primaryKeys = ["message_id", "user_id", "session_id"]) class ResendSessionMessage( diff --git a/app/src/main/java/one/mixin/android/vo/SearchBot.kt b/app/src/main/java/one/mixin/android/vo/SearchBot.kt index a3b0d97478..121e284df0 100644 --- a/app/src/main/java/one/mixin/android/vo/SearchBot.kt +++ b/app/src/main/java/one/mixin/android/vo/SearchBot.kt @@ -1,7 +1,7 @@ package one.mixin.android.vo import android.os.Parcelable -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize import kotlinx.serialization.SerialName diff --git a/app/src/main/java/one/mixin/android/vo/SentSenderKey.kt b/app/src/main/java/one/mixin/android/vo/SentSenderKey.kt index d874a8f418..1587276243 100644 --- a/app/src/main/java/one/mixin/android/vo/SentSenderKey.kt +++ b/app/src/main/java/one/mixin/android/vo/SentSenderKey.kt @@ -1,7 +1,7 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity +import androidx.room3.ColumnInfo +import androidx.room3.Entity import one.mixin.android.extension.nowInUtc @Entity(tableName = "sent_sender_keys", primaryKeys = ["conversation_id", "user_id"]) diff --git a/app/src/main/java/one/mixin/android/vo/Snapshot.kt b/app/src/main/java/one/mixin/android/vo/Snapshot.kt index df7927b008..179154872c 100644 --- a/app/src/main/java/one/mixin/android/vo/Snapshot.kt +++ b/app/src/main/java/one/mixin/android/vo/Snapshot.kt @@ -1,8 +1,8 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/app/src/main/java/one/mixin/android/vo/SnapshotItem.kt b/app/src/main/java/one/mixin/android/vo/SnapshotItem.kt index f7a6dcc371..60d0c62308 100644 --- a/app/src/main/java/one/mixin/android/vo/SnapshotItem.kt +++ b/app/src/main/java/one/mixin/android/vo/SnapshotItem.kt @@ -3,9 +3,9 @@ package one.mixin.android.vo import android.annotation.SuppressLint import android.os.Parcelable import androidx.recyclerview.widget.DiffUtil -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize import kotlinx.serialization.SerialName diff --git a/app/src/main/java/one/mixin/android/vo/StatusMessage.kt b/app/src/main/java/one/mixin/android/vo/StatusMessage.kt index 8610c6ebe7..144c5d0148 100644 --- a/app/src/main/java/one/mixin/android/vo/StatusMessage.kt +++ b/app/src/main/java/one/mixin/android/vo/StatusMessage.kt @@ -1,6 +1,6 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo class StatusMessage( @ColumnInfo(name = "message_id") diff --git a/app/src/main/java/one/mixin/android/vo/Sticker.kt b/app/src/main/java/one/mixin/android/vo/Sticker.kt index 2ae5aa20d8..61a32e1743 100644 --- a/app/src/main/java/one/mixin/android/vo/Sticker.kt +++ b/app/src/main/java/one/mixin/android/vo/Sticker.kt @@ -1,9 +1,9 @@ package one.mixin.android.vo import androidx.recyclerview.widget.DiffUtil -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/app/src/main/java/one/mixin/android/vo/StickerAlbum.kt b/app/src/main/java/one/mixin/android/vo/StickerAlbum.kt index 3c4f854ee2..ffb991977d 100644 --- a/app/src/main/java/one/mixin/android/vo/StickerAlbum.kt +++ b/app/src/main/java/one/mixin/android/vo/StickerAlbum.kt @@ -1,9 +1,9 @@ package one.mixin.android.vo import androidx.recyclerview.widget.DiffUtil -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.Expose import com.google.gson.annotations.SerializedName diff --git a/app/src/main/java/one/mixin/android/vo/StickerRelationship.kt b/app/src/main/java/one/mixin/android/vo/StickerRelationship.kt index 7166e922eb..0ad9f27a09 100644 --- a/app/src/main/java/one/mixin/android/vo/StickerRelationship.kt +++ b/app/src/main/java/one/mixin/android/vo/StickerRelationship.kt @@ -1,7 +1,7 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo -import androidx.room.Entity +import androidx.room3.ColumnInfo +import androidx.room3.Entity import com.google.gson.annotations.SerializedName @Entity( diff --git a/app/src/main/java/one/mixin/android/vo/TokenEntry.kt b/app/src/main/java/one/mixin/android/vo/TokenEntry.kt index d42e91da81..e916cf5544 100644 --- a/app/src/main/java/one/mixin/android/vo/TokenEntry.kt +++ b/app/src/main/java/one/mixin/android/vo/TokenEntry.kt @@ -1,6 +1,6 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo import com.google.gson.annotations.SerializedName data class TokenEntry( diff --git a/app/src/main/java/one/mixin/android/vo/TopAsset.kt b/app/src/main/java/one/mixin/android/vo/TopAsset.kt index 34e32a9055..6e40623b29 100644 --- a/app/src/main/java/one/mixin/android/vo/TopAsset.kt +++ b/app/src/main/java/one/mixin/android/vo/TopAsset.kt @@ -2,9 +2,9 @@ package one.mixin.android.vo import android.annotation.SuppressLint import android.os.Parcelable -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/one/mixin/android/vo/TopAssetItem.kt b/app/src/main/java/one/mixin/android/vo/TopAssetItem.kt index c7f233d67f..46bf961af3 100644 --- a/app/src/main/java/one/mixin/android/vo/TopAssetItem.kt +++ b/app/src/main/java/one/mixin/android/vo/TopAssetItem.kt @@ -3,8 +3,8 @@ package one.mixin.android.vo import android.annotation.SuppressLint import android.os.Parcelable import androidx.recyclerview.widget.DiffUtil -import androidx.room.ColumnInfo -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize import java.math.BigDecimal diff --git a/app/src/main/java/one/mixin/android/vo/Trace.kt b/app/src/main/java/one/mixin/android/vo/Trace.kt index 72f2ac4232..6217ddd9b4 100644 --- a/app/src/main/java/one/mixin/android/vo/Trace.kt +++ b/app/src/main/java/one/mixin/android/vo/Trace.kt @@ -1,9 +1,9 @@ package one.mixin.android.vo import android.os.Parcelable -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/one/mixin/android/vo/TranscriptAttachmentMigration.kt b/app/src/main/java/one/mixin/android/vo/TranscriptAttachmentMigration.kt index 11f892e9b8..7a89c93d24 100644 --- a/app/src/main/java/one/mixin/android/vo/TranscriptAttachmentMigration.kt +++ b/app/src/main/java/one/mixin/android/vo/TranscriptAttachmentMigration.kt @@ -1,6 +1,6 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo class TranscriptAttachmentMigration( @ColumnInfo(name = "rowid") diff --git a/app/src/main/java/one/mixin/android/vo/TranscriptMessage.kt b/app/src/main/java/one/mixin/android/vo/TranscriptMessage.kt index 2b47ba7d78..34bcf60124 100644 --- a/app/src/main/java/one/mixin/android/vo/TranscriptMessage.kt +++ b/app/src/main/java/one/mixin/android/vo/TranscriptMessage.kt @@ -4,8 +4,8 @@ import android.annotation.SuppressLint import android.content.Context import android.os.Parcelable import androidx.core.net.toUri -import androidx.room.ColumnInfo -import androidx.room.Entity +import androidx.room3.ColumnInfo +import androidx.room3.Entity import com.google.gson.annotations.SerializedName import kotlinx.android.parcel.Parcelize import kotlinx.serialization.SerialName diff --git a/app/src/main/java/one/mixin/android/vo/User.kt b/app/src/main/java/one/mixin/android/vo/User.kt index 5cdbfcad0a..4347504b21 100644 --- a/app/src/main/java/one/mixin/android/vo/User.kt +++ b/app/src/main/java/one/mixin/android/vo/User.kt @@ -3,11 +3,11 @@ package one.mixin.android.vo import android.annotation.SuppressLint import android.os.Parcelable import androidx.recyclerview.widget.DiffUtil -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.Ignore -import androidx.room.Index -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.Ignore +import androidx.room3.Index +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.parcelize.IgnoredOnParcel import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/one/mixin/android/vo/UtxoItem.kt b/app/src/main/java/one/mixin/android/vo/UtxoItem.kt index 0849b12a16..c613176775 100644 --- a/app/src/main/java/one/mixin/android/vo/UtxoItem.kt +++ b/app/src/main/java/one/mixin/android/vo/UtxoItem.kt @@ -1,6 +1,6 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo data class UtxoItem( @ColumnInfo("output_id") diff --git a/app/src/main/java/one/mixin/android/vo/WalletHomeTokenSummary.kt b/app/src/main/java/one/mixin/android/vo/WalletHomeTokenSummary.kt index d8baf49667..196d2b9c3a 100644 --- a/app/src/main/java/one/mixin/android/vo/WalletHomeTokenSummary.kt +++ b/app/src/main/java/one/mixin/android/vo/WalletHomeTokenSummary.kt @@ -1,6 +1,6 @@ package one.mixin.android.vo -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo data class WalletHomeTokenSummary( @ColumnInfo(name = "token_count") diff --git a/app/src/main/java/one/mixin/android/vo/market/HistoryPrice.kt b/app/src/main/java/one/mixin/android/vo/market/HistoryPrice.kt index 4158a07644..b0a35b6742 100644 --- a/app/src/main/java/one/mixin/android/vo/market/HistoryPrice.kt +++ b/app/src/main/java/one/mixin/android/vo/market/HistoryPrice.kt @@ -1,7 +1,7 @@ package one.mixin.android.vo.market -import androidx.room.ColumnInfo -import androidx.room.Entity +import androidx.room3.ColumnInfo +import androidx.room3.Entity import com.google.gson.annotations.SerializedName @Entity(tableName = "history_prices", primaryKeys = ["coin_id", "type"]) diff --git a/app/src/main/java/one/mixin/android/vo/market/Market.kt b/app/src/main/java/one/mixin/android/vo/market/Market.kt index 69cd90dd13..97b069af60 100644 --- a/app/src/main/java/one/mixin/android/vo/market/Market.kt +++ b/app/src/main/java/one/mixin/android/vo/market/Market.kt @@ -1,10 +1,10 @@ package one.mixin.android.vo.market import android.os.Parcelable -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey -import androidx.room.TypeConverters +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey +import androidx.room3.ColumnTypeConverters import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize import one.mixin.android.db.converter.DescriptionsConverter @@ -13,7 +13,7 @@ import one.mixin.android.db.converter.OptionalListConverter @Entity( tableName = "markets", ) -@TypeConverters(OptionalListConverter::class, DescriptionsConverter::class) +@ColumnTypeConverters(OptionalListConverter::class, DescriptionsConverter::class) @Parcelize data class Market( @PrimaryKey diff --git a/app/src/main/java/one/mixin/android/vo/market/MarketCapRank.kt b/app/src/main/java/one/mixin/android/vo/market/MarketCapRank.kt index 7516337e7d..63418bb867 100644 --- a/app/src/main/java/one/mixin/android/vo/market/MarketCapRank.kt +++ b/app/src/main/java/one/mixin/android/vo/market/MarketCapRank.kt @@ -1,8 +1,8 @@ package one.mixin.android.vo.market -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey @Entity( tableName = "market_cap_ranks", diff --git a/app/src/main/java/one/mixin/android/vo/market/MarketCoin.kt b/app/src/main/java/one/mixin/android/vo/market/MarketCoin.kt index d69e3623e9..e7b2312f2c 100644 --- a/app/src/main/java/one/mixin/android/vo/market/MarketCoin.kt +++ b/app/src/main/java/one/mixin/android/vo/market/MarketCoin.kt @@ -1,8 +1,8 @@ package one.mixin.android.vo.market -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName @Entity(tableName = "market_coins") diff --git a/app/src/main/java/one/mixin/android/vo/market/MarketFavored.kt b/app/src/main/java/one/mixin/android/vo/market/MarketFavored.kt index b208b4d276..d766394fda 100644 --- a/app/src/main/java/one/mixin/android/vo/market/MarketFavored.kt +++ b/app/src/main/java/one/mixin/android/vo/market/MarketFavored.kt @@ -1,8 +1,8 @@ package one.mixin.android.vo.market -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName @Entity(tableName = "market_favored") diff --git a/app/src/main/java/one/mixin/android/vo/market/MarketItem.kt b/app/src/main/java/one/mixin/android/vo/market/MarketItem.kt index 36edd3c4e0..4538071dae 100644 --- a/app/src/main/java/one/mixin/android/vo/market/MarketItem.kt +++ b/app/src/main/java/one/mixin/android/vo/market/MarketItem.kt @@ -1,14 +1,14 @@ package one.mixin.android.vo.market import android.os.Parcelable -import androidx.room.ColumnInfo -import androidx.room.TypeConverters +import androidx.room3.ColumnInfo +import androidx.room3.ColumnTypeConverters import kotlinx.parcelize.Parcelize import one.mixin.android.db.converter.DescriptionsConverter import one.mixin.android.db.converter.OptionalListConverter @Parcelize -@TypeConverters(OptionalListConverter::class, DescriptionsConverter::class) +@ColumnTypeConverters(OptionalListConverter::class, DescriptionsConverter::class) data class MarketItem( @ColumnInfo(name = "coin_id") val coinId: String, diff --git a/app/src/main/java/one/mixin/android/vo/route/Order.kt b/app/src/main/java/one/mixin/android/vo/route/Order.kt index e175a3adfb..afa97b6363 100644 --- a/app/src/main/java/one/mixin/android/vo/route/Order.kt +++ b/app/src/main/java/one/mixin/android/vo/route/Order.kt @@ -1,10 +1,10 @@ package one.mixin.android.vo.route import android.os.Parcelable -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.Index -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.Index +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/one/mixin/android/vo/route/OrderItem.kt b/app/src/main/java/one/mixin/android/vo/route/OrderItem.kt index 21211b031d..6791d8c846 100644 --- a/app/src/main/java/one/mixin/android/vo/route/OrderItem.kt +++ b/app/src/main/java/one/mixin/android/vo/route/OrderItem.kt @@ -1,7 +1,7 @@ package one.mixin.android.vo.route import android.os.Parcelable -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/one/mixin/android/vo/safe/DepositEntry.kt b/app/src/main/java/one/mixin/android/vo/safe/DepositEntry.kt index 9459774138..62b9a81831 100644 --- a/app/src/main/java/one/mixin/android/vo/safe/DepositEntry.kt +++ b/app/src/main/java/one/mixin/android/vo/safe/DepositEntry.kt @@ -1,16 +1,16 @@ package one.mixin.android.vo.safe import android.os.Parcelable -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.PrimaryKey -import androidx.room.TypeConverters +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.PrimaryKey +import androidx.room3.ColumnTypeConverters import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize import one.mixin.android.db.converter.ListConverter @Entity(tableName = "deposit_entries") -@TypeConverters(ListConverter::class) +@ColumnTypeConverters(ListConverter::class) @Parcelize data class DepositEntry( @PrimaryKey diff --git a/app/src/main/java/one/mixin/android/vo/safe/Output.kt b/app/src/main/java/one/mixin/android/vo/safe/Output.kt index df73efbdac..b4e6bb231d 100644 --- a/app/src/main/java/one/mixin/android/vo/safe/Output.kt +++ b/app/src/main/java/one/mixin/android/vo/safe/Output.kt @@ -1,14 +1,14 @@ package one.mixin.android.vo.safe -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.Index -import androidx.room.PrimaryKey -import androidx.room.TypeConverters +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.Index +import androidx.room3.PrimaryKey +import androidx.room3.ColumnTypeConverters import com.google.gson.annotations.SerializedName import one.mixin.android.db.converter.ListConverter -@TypeConverters(ListConverter::class) +@ColumnTypeConverters(ListConverter::class) @Entity( tableName = "outputs", indices = [ diff --git a/app/src/main/java/one/mixin/android/vo/safe/RawTransaction.kt b/app/src/main/java/one/mixin/android/vo/safe/RawTransaction.kt index 8410c2d80e..8eba035865 100644 --- a/app/src/main/java/one/mixin/android/vo/safe/RawTransaction.kt +++ b/app/src/main/java/one/mixin/android/vo/safe/RawTransaction.kt @@ -1,9 +1,9 @@ package one.mixin.android.vo.safe -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.Index -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.Index +import androidx.room3.PrimaryKey @Entity( tableName = "raw_transactions", diff --git a/app/src/main/java/one/mixin/android/vo/safe/SafeCollectible.kt b/app/src/main/java/one/mixin/android/vo/safe/SafeCollectible.kt index ee343c96f6..ab6b7e198a 100644 --- a/app/src/main/java/one/mixin/android/vo/safe/SafeCollectible.kt +++ b/app/src/main/java/one/mixin/android/vo/safe/SafeCollectible.kt @@ -1,6 +1,6 @@ package one.mixin.android.vo.safe -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo import com.google.gson.annotations.SerializedName class SafeCollectible( diff --git a/app/src/main/java/one/mixin/android/vo/safe/SafeColletion.kt b/app/src/main/java/one/mixin/android/vo/safe/SafeColletion.kt index 35cc877190..a3c46c2ca8 100644 --- a/app/src/main/java/one/mixin/android/vo/safe/SafeColletion.kt +++ b/app/src/main/java/one/mixin/android/vo/safe/SafeColletion.kt @@ -1,7 +1,7 @@ package one.mixin.android.vo.safe import android.os.Parcelable -import androidx.room.ColumnInfo +import androidx.room3.ColumnInfo import kotlinx.parcelize.Parcelize @Parcelize diff --git a/app/src/main/java/one/mixin/android/vo/safe/SafeSnapshot.kt b/app/src/main/java/one/mixin/android/vo/safe/SafeSnapshot.kt index b9847e75af..23b635b6af 100644 --- a/app/src/main/java/one/mixin/android/vo/safe/SafeSnapshot.kt +++ b/app/src/main/java/one/mixin/android/vo/safe/SafeSnapshot.kt @@ -1,10 +1,10 @@ package one.mixin.android.vo.safe -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.Ignore -import androidx.room.Index -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.Ignore +import androidx.room3.Index +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.parcelize.IgnoredOnParcel import kotlinx.serialization.SerialName diff --git a/app/src/main/java/one/mixin/android/vo/safe/Token.kt b/app/src/main/java/one/mixin/android/vo/safe/Token.kt index 7469a07865..681ad198f5 100644 --- a/app/src/main/java/one/mixin/android/vo/safe/Token.kt +++ b/app/src/main/java/one/mixin/android/vo/safe/Token.kt @@ -2,10 +2,10 @@ package one.mixin.android.vo.safe import android.annotation.SuppressLint import android.os.Parcelable -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.Index -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.Index +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize import kotlinx.serialization.SerialName diff --git a/app/src/main/java/one/mixin/android/vo/safe/TokensExtra.kt b/app/src/main/java/one/mixin/android/vo/safe/TokensExtra.kt index c723767b44..81457b9784 100644 --- a/app/src/main/java/one/mixin/android/vo/safe/TokensExtra.kt +++ b/app/src/main/java/one/mixin/android/vo/safe/TokensExtra.kt @@ -2,10 +2,10 @@ package one.mixin.android.vo.safe import android.annotation.SuppressLint import android.os.Parcelable -import androidx.room.ColumnInfo -import androidx.room.Entity -import androidx.room.Index -import androidx.room.PrimaryKey +import androidx.room3.ColumnInfo +import androidx.room3.Entity +import androidx.room3.Index +import androidx.room3.PrimaryKey import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize diff --git a/app/src/test/java/one/mixin/android/db/MessageDaoTest.kt b/app/src/test/java/one/mixin/android/db/MessageDaoTest.kt index 22e9ac1743..af6ae10113 100644 --- a/app/src/test/java/one/mixin/android/db/MessageDaoTest.kt +++ b/app/src/test/java/one/mixin/android/db/MessageDaoTest.kt @@ -1,7 +1,8 @@ package one.mixin.android.db import android.content.Context -import androidx.room.Room +import androidx.room3.Room +import androidx.sqlite.driver.AndroidSQLiteDriver import androidx.test.core.app.ApplicationProvider import kotlin.test.AfterTest import kotlin.test.BeforeTest @@ -30,6 +31,7 @@ class MessageDaoTest { fun setUp() { val context = ApplicationProvider.getApplicationContext() database = Room.inMemoryDatabaseBuilder(context, MixinDatabase::class.java) + .setDriver(AndroidSQLiteDriver()) .allowMainThreadQueries() .build() messageDao = database.messageDao() diff --git a/app/src/test/java/one/mixin/android/db/fetcher/MessageFetcherAnchorTest.kt b/app/src/test/java/one/mixin/android/db/fetcher/MessageFetcherAnchorTest.kt index 28caa21d0f..bd6c9eeb5c 100644 --- a/app/src/test/java/one/mixin/android/db/fetcher/MessageFetcherAnchorTest.kt +++ b/app/src/test/java/one/mixin/android/db/fetcher/MessageFetcherAnchorTest.kt @@ -1,10 +1,12 @@ package one.mixin.android.db.fetcher import android.content.Context -import androidx.room.Room +import androidx.room3.Room +import androidx.sqlite.driver.AndroidSQLiteDriver import androidx.test.core.app.ApplicationProvider import kotlinx.coroutines.runBlocking import one.mixin.android.db.MixinDatabase +import one.mixin.android.db.datasource.RoomDatabaseCompat import org.junit.After import org.junit.Assert.assertEquals import org.junit.Assert.assertTrue @@ -22,6 +24,7 @@ class MessageFetcherAnchorTest { fun setUp() { val context = ApplicationProvider.getApplicationContext() db = Room.inMemoryDatabaseBuilder(context, MixinDatabase::class.java) + .setDriver(AndroidSQLiteDriver()) .allowMainThreadQueries() .build() fetcher = MessageFetcher(db) @@ -113,7 +116,8 @@ class MessageFetcherAnchorTest { } private fun insertUser() { - db.openHelper.writableDatabase.execSQL( + RoomDatabaseCompat.execute( + db, """ INSERT INTO users(user_id, identity_number, relationship, biography, full_name) VALUES (?, ?, ?, ?, ?) @@ -123,7 +127,8 @@ class MessageFetcherAnchorTest { } private fun insertConversation() { - db.openHelper.writableDatabase.execSQL( + RoomDatabaseCompat.execute( + db, """ INSERT INTO conversations(conversation_id, owner_id, category, name, created_at, status) VALUES (?, ?, ?, ?, ?, ?) @@ -137,7 +142,8 @@ class MessageFetcherAnchorTest { messageId: String, createdAt: String, ) { - db.openHelper.writableDatabase.execSQL( + RoomDatabaseCompat.execute( + db, """ INSERT INTO messages(rowid, id, conversation_id, user_id, category, content, status, created_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?) @@ -147,7 +153,8 @@ class MessageFetcherAnchorTest { } private fun insertRemoteStatus(messageId: String) { - db.openHelper.writableDatabase.execSQL( + RoomDatabaseCompat.execute( + db, """ INSERT INTO remote_messages_status(message_id, conversation_id, status) VALUES (?, ?, ?) diff --git a/build.gradle.kts b/build.gradle.kts index a2cb5f5a00..7c425dfda7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,6 +25,7 @@ plugins { id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") version "2.0.1" apply false id("org.jetbrains.kotlin.plugin.serialization") version "2.4.0" apply false id("com.google.devtools.ksp") version "2.3.9" apply false + id("androidx.room3") version "3.0.0" apply false id("org.jetbrains.kotlin.plugin.compose") version "2.4.0" apply false id("org.jetbrains.kotlin.jvm") version "2.4.0" apply false id("com.google.firebase.firebase-perf") version "2.0.2" apply false @@ -38,7 +39,8 @@ val appcompatVersion by extra("1.7.1") val pagingVersion by extra("3.5.0") val coilVersion by extra("3.5.0") val collectionx by extra("1.6.0") -val roomVersion by extra("2.8.4") +val roomVersion by extra("3.0.0") +val sqliteVersion by extra("2.7.0") val navigationVersion by extra("2.9.8") val workManagerVersion by extra("2.11.2") val constraintLayoutVersion by extra("2.2.1") diff --git a/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedSimpleSQLiteQuery.kt b/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedSimpleSQLiteQuery.kt deleted file mode 100644 index 199cd9f23f..0000000000 --- a/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedSimpleSQLiteQuery.kt +++ /dev/null @@ -1,7 +0,0 @@ -package one.mixin.android.codegen.annotation - -@Target(AnnotationTarget.FUNCTION) -@Retention(AnnotationRetention.SOURCE) -annotation class GeneratedSimpleSQLiteQuery( - val sql: String, -) diff --git a/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryFileRenderer.kt b/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryFileRenderer.kt index f8a61d103c..2a3dd52fef 100644 --- a/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryFileRenderer.kt +++ b/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryFileRenderer.kt @@ -7,7 +7,7 @@ data class QueryProviderModel( val limitOffsetFunctions: List = emptyList(), val noCountFunctions: List = emptyList(), val rawCursorFunctions: List = emptyList(), - val simpleQueryFunctions: List = emptyList(), + val simpleQueryFunctions: List = emptyList(), val pagingSourceFunctions: List = emptyList(), ) @@ -69,7 +69,7 @@ data class RawCursorQueryFunctionModel( val converterName: String, ) -data class SimpleSQLiteQueryFunctionModel( +data class RoomRawQueryFunctionModel( val name: String, val returnType: String, val returnTypeImports: List, @@ -99,7 +99,8 @@ class QueryFileRenderer { listOf( "android.annotation.SuppressLint", ) + - model.roomSQLiteQueryImports() + + model.roomQueryImports() + + model.roomDatabaseCompatImports() + model.coroutinesImports() + model.functions.flatMap { it.parameterImports + it.returnTypeImports } + model.limitOffsetFunctions.flatMap { it.parameterImports + it.returnTypeImports } + @@ -107,6 +108,7 @@ class QueryFileRenderer { model.rawCursorFunctions.flatMap { it.parameterImports + it.returnTypeImports + it.converterImport() } + model.simpleQueryFunctions.flatMap { it.parameterImports + it.returnTypeImports } + model.pagingSourceFunctions.flatMap { it.parameterImports + it.returnTypeImports + it.converterImport() } + + model.queryExtensionImports() + model.limitOffsetImports() + model.noCountImports() + model.pagingSourceImports() @@ -174,7 +176,7 @@ class QueryFileRenderer { lines += " $sqlLine" } lines += " \"\"\".trimIndent()" - lines += " val _statement = RoomSQLiteQuery.acquire(_sql, ${function.bindParameters.size})" + lines += " val _statement = RoomQuery.acquire(_sql, ${function.bindParameters.size})" function.bindParameters.forEachIndexed { index, bindParameter -> val argIndex = index + 1 if (index == 0) { @@ -184,7 +186,7 @@ class QueryFileRenderer { } renderBind(lines, function, bindParameter) } - lines += " return withContext(${function.databaseParameter}.queryExecutor.asCoroutineDispatcher()) {" + lines += " return withContext(RoomDatabaseCompat.queryContext(${function.databaseParameter})) {" lines += " ${function.callableName}(${function.databaseParameter}, _statement, ${function.cancellationSignalParameter}).call()" lines += " }" lines += " }" @@ -204,8 +206,8 @@ class QueryFileRenderer { lines += " override fun create(): DataSource {" renderRoomQueryAcquire(lines, "countStatement", function.countSql, 0, " ") renderRoomQueryAcquire(lines, "offsetStatement", function.offsetSql, 2, " ") - lines += " val querySqlGenerator = fun(ids: String): RoomSQLiteQuery {" - lines += " return RoomSQLiteQuery.acquire(" + lines += " val querySqlGenerator = fun(ids: String): RoomQuery {" + lines += " return RoomQuery.acquire(" renderSqlLiteral(lines, function.querySql.renderSqlTemplate(function.parameters.map { it.name } + "ids"), " ") lines += " 0," lines += " )" @@ -245,14 +247,14 @@ class QueryFileRenderer { private fun renderSimpleQueryFunction( lines: MutableList, - function: SimpleSQLiteQueryFunctionModel, + function: RoomRawQueryFunctionModel, ) { lines += " fun ${function.name}(" function.parameters.forEach { parameter -> lines += " ${parameter.name}: ${parameter.type}," } lines += " ): ${function.returnType} =" - lines += " SimpleSQLiteQuery(" + lines += " RoomRawQuery(" renderSqlLiteral(lines, function.sql.renderSqlTemplate(function.parameters.map { it.name }), " ") lines += " )" } @@ -270,30 +272,23 @@ class QueryFileRenderer { lines += " object : PagingSource() {" lines += " private val itemCount = AtomicInteger(INITIAL_ITEM_COUNT)" lines += "" - lines += " private val observer = object : InvalidationTracker.Observer(arrayOf(${function.tables.joinToString { "\"$it\"" }})) {" - lines += " override fun onInvalidated(tables: Set) {" - lines += " invalidate()" - lines += " }" - lines += " }" - lines += "" lines += " init {" - lines += " ${function.databaseParameter}.invalidationTracker.addWeakObserver(observer)" + lines += " RoomDatabaseCompat.observeInvalidation(${function.databaseParameter}, this, ${function.tables.joinToString { "\"$it\"" }})" lines += " }" lines += "" lines += " override suspend fun load(params: LoadParams): LoadResult {" - lines += " return withContext(${function.databaseParameter}.queryExecutor.asCoroutineDispatcher()) {" + lines += " return withContext(RoomDatabaseCompat.queryContext(${function.databaseParameter})) {" lines += " val tempCount = itemCount.get()" lines += " if (tempCount == INITIAL_ITEM_COUNT) {" - lines += " ${function.databaseParameter}.withTransaction {" + lines += " ${function.databaseParameter}.withReadTransaction {" lines += " val count = countItems()" lines += " itemCount.set(count)" lines += " queryData(params, count)" lines += " }" lines += " } else {" lines += " val loadResult = queryData(params, tempCount)" - lines += " ${function.databaseParameter}.invalidationTracker.refreshVersionsSync()" lines += " @Suppress(\"UNCHECKED_CAST\")" - lines += " if (invalid) INVALID as LoadResult.Invalid else loadResult" + lines += " if (invalid) LoadResult.Invalid() else loadResult" lines += " }" lines += " }" lines += " }" @@ -350,8 +345,8 @@ class QueryFileRenderer { lines += " )" lines += " }" lines += "" - lines += " private fun querySqlGenerator(ids: String): RoomSQLiteQuery {" - lines += " return RoomSQLiteQuery.acquire(" + lines += " private fun querySqlGenerator(ids: String): RoomQuery {" + lines += " return RoomQuery.acquire(" renderSqlLiteral(lines, function.querySql.renderSqlTemplate(function.parameters.map { it.name } + "ids"), " ") lines += " 0," lines += " )" @@ -410,7 +405,7 @@ class QueryFileRenderer { argCount: Int, indent: String, ) { - lines += "${indent}val $variableName = RoomSQLiteQuery.acquire(" + lines += "${indent}val $variableName = RoomQuery.acquire(" renderSqlLiteral(lines, sql, "$indent ") lines += "$indent $argCount," lines += "$indent)" @@ -514,11 +509,25 @@ class QueryFileRenderer { ) } - private fun QueryProviderModel.roomSQLiteQueryImports(): List = + private fun QueryProviderModel.roomQueryImports(): List = if (functions.isEmpty() && limitOffsetFunctions.isEmpty() && noCountFunctions.isEmpty() && pagingSourceFunctions.isEmpty()) { emptyList() } else { - listOf("androidx.room.RoomSQLiteQuery") + listOf("one.mixin.android.db.datasource.RoomQuery") + } + + private fun QueryProviderModel.queryExtensionImports(): List = + if (limitOffsetFunctions.isEmpty() && noCountFunctions.isEmpty() && rawCursorFunctions.isEmpty() && pagingSourceFunctions.isEmpty()) { + emptyList() + } else { + listOf("one.mixin.android.db.datasource.query") + } + + private fun QueryProviderModel.roomDatabaseCompatImports(): List = + if (functions.isEmpty() && pagingSourceFunctions.isEmpty()) { + emptyList() + } else { + listOf("one.mixin.android.db.datasource.RoomDatabaseCompat") } private fun QueryProviderModel.coroutinesImports(): List = @@ -526,7 +535,6 @@ class QueryFileRenderer { emptyList() } else { listOf( - "kotlinx.coroutines.asCoroutineDispatcher", "kotlinx.coroutines.withContext", ) } @@ -537,13 +545,12 @@ class QueryFileRenderer { } else { listOf( "androidx.paging.PagingState", - "androidx.room.InvalidationTracker", - "androidx.room.paging.util.INITIAL_ITEM_COUNT", - "androidx.room.paging.util.INVALID", - "androidx.room.paging.util.getClippedRefreshKey", - "androidx.room.paging.util.getLimit", - "androidx.room.paging.util.getOffset", - "androidx.room.withTransaction", + "androidx.room3.paging.util.INITIAL_ITEM_COUNT", + "androidx.room3.paging.util.getClippedRefreshKey", + "androidx.room3.paging.util.getLimit", + "androidx.room3.paging.util.getOffset", + "androidx.room3.withReadTransaction", + "one.mixin.android.db.datasource.RoomDatabaseCompat", "java.util.concurrent.atomic.AtomicInteger", ) } diff --git a/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryProcessor.kt b/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryProcessor.kt index 296ebc15d9..f805939c24 100644 --- a/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryProcessor.kt +++ b/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryProcessor.kt @@ -24,7 +24,7 @@ import one.mixin.android.codegen.annotation.GeneratedLimitOffsetDataSourceQuery import one.mixin.android.codegen.annotation.GeneratedNoCountDataSourceQuery import one.mixin.android.codegen.annotation.GeneratedPagingSourceQuery import one.mixin.android.codegen.annotation.GeneratedRawCursorQuery -import one.mixin.android.codegen.annotation.GeneratedSimpleSQLiteQuery +import one.mixin.android.codegen.annotation.GeneratedRoomRawQuery class QueryProcessor( environment: SymbolProcessorEnvironment, @@ -50,7 +50,7 @@ class QueryProcessor( val limitOffsetFunctions = allFunctions.filter { it.hasAnnotation() } val noCountFunctions = allFunctions.filter { it.hasAnnotation() } val rawCursorFunctions = allFunctions.filter { it.hasAnnotation() } - val simpleQueryFunctions = allFunctions.filter { it.hasAnnotation() } + val simpleQueryFunctions = allFunctions.filter { it.hasAnnotation() } val pagingSourceFunctions = allFunctions.filter { it.hasAnnotation() } if (queryFunctions.isEmpty() && limitOffsetFunctions.isEmpty() && noCountFunctions.isEmpty() && rawCursorFunctions.isEmpty() && simpleQueryFunctions.isEmpty() && pagingSourceFunctions.isEmpty()) return @@ -170,15 +170,15 @@ class QueryProcessor( ) } - private fun simpleQueryFunctionModel(function: KSFunctionDeclaration): SimpleSQLiteQueryFunctionModel { - val annotation = function.annotation() + private fun simpleQueryFunctionModel(function: KSFunctionDeclaration): RoomRawQueryFunctionModel { + val annotation = function.annotation() val importCollector = TypeImportCollector() val parameters = function.parameters(importCollector) val returnType = function.returnType?.resolve() if (returnType == null) { - logger.error("GeneratedSimpleSQLiteQuery functions must declare a return type", function) + logger.error("GeneratedRoomRawQuery functions must declare a return type", function) } - return SimpleSQLiteQueryFunctionModel( + return RoomRawQueryFunctionModel( name = function.simpleName.asString(), returnType = returnType?.let { importCollector.render(it) } ?: "Unit", returnTypeImports = importCollector.imports, diff --git a/query-codegen/src/test/kotlin/one/mixin/android/codegen/processor/QueryFileRendererTest.kt b/query-codegen/src/test/kotlin/one/mixin/android/codegen/processor/QueryFileRendererTest.kt index 4f46062b6c..6f336b24f3 100644 --- a/query-codegen/src/test/kotlin/one/mixin/android/codegen/processor/QueryFileRendererTest.kt +++ b/query-codegen/src/test/kotlin/one/mixin/android/codegen/processor/QueryFileRendererTest.kt @@ -50,10 +50,10 @@ class QueryFileRendererTest { import android.annotation.SuppressLint import android.os.CancellationSignal - import androidx.room.RoomSQLiteQuery - import kotlinx.coroutines.asCoroutineDispatcher import kotlinx.coroutines.withContext import one.mixin.android.db.MixinDatabase + import one.mixin.android.db.datasource.RoomDatabaseCompat + import one.mixin.android.db.datasource.RoomQuery import one.mixin.android.vo.safe.TokenItem @SuppressLint("RestrictedApi") @@ -70,7 +70,7 @@ class QueryFileRendererTest { FROM tokens WHERE symbol LIKE '%' || ? || '%' ""${'"'}.trimIndent() - val _statement = RoomSQLiteQuery.acquire(_sql, 4) + val _statement = RoomQuery.acquire(_sql, 4) var _argIndex = 1 if (symbol == null) { _statement.bindNull(_argIndex) @@ -95,7 +95,7 @@ class QueryFileRendererTest { } else { _statement.bindString(_argIndex, name) } - return withContext(db.queryExecutor.asCoroutineDispatcher()) { + return withContext(RoomDatabaseCompat.queryContext(db)) { callableTokenItem(db, _statement, cancellationSignal).call() } } @@ -143,9 +143,10 @@ class QueryFileRendererTest { import android.annotation.SuppressLint import android.database.Cursor import androidx.paging.DataSource - import androidx.room.RoomSQLiteQuery import one.mixin.android.db.MixinDatabase import one.mixin.android.db.datasource.MixinLimitOffsetDataSource + import one.mixin.android.db.datasource.RoomQuery + import one.mixin.android.db.datasource.query import one.mixin.android.vo.ConversationItem @SuppressLint("RestrictedApi") @@ -155,20 +156,20 @@ class QueryFileRendererTest { ): DataSource.Factory = object : DataSource.Factory() { override fun create(): DataSource { - val countStatement = RoomSQLiteQuery.acquire( + val countStatement = RoomQuery.acquire( ""${'"'} SELECT count(1) FROM conversations ""${'"'}.trimIndent(), 0, ) - val offsetStatement = RoomSQLiteQuery.acquire( + val offsetStatement = RoomQuery.acquire( ""${'"'} SELECT c.rowid FROM conversations c LIMIT ? OFFSET ? ""${'"'}.trimIndent(), 2, ) - val querySqlGenerator = fun(ids: String): RoomSQLiteQuery { - return RoomSQLiteQuery.acquire( + val querySqlGenerator = fun(ids: String): RoomQuery { + return RoomQuery.acquire( ""${'"'} SELECT * FROM conversations c WHERE c.rowid IN (${'$'}ids) ""${'"'}.trimIndent(), @@ -236,9 +237,10 @@ class QueryFileRendererTest { import android.annotation.SuppressLint import android.database.Cursor import androidx.paging.DataSource - import androidx.room.RoomSQLiteQuery import one.mixin.android.db.MixinDatabase import one.mixin.android.db.datasource.NoCountLimitOffsetDataSource + import one.mixin.android.db.datasource.RoomQuery + import one.mixin.android.db.datasource.query import one.mixin.android.vo.ChatHistoryMessageItem @SuppressLint("RestrictedApi") @@ -250,7 +252,7 @@ class QueryFileRendererTest { ): DataSource.Factory = object : DataSource.Factory() { override fun create(): DataSource { - val _statement = RoomSQLiteQuery.acquire( + val _statement = RoomQuery.acquire( ""${'"'} SELECT * FROM messages WHERE conversation_id = ? ""${'"'}.trimIndent(), @@ -312,6 +314,7 @@ class QueryFileRendererTest { import android.annotation.SuppressLint import one.mixin.android.db.MixinDatabase + import one.mixin.android.db.datasource.query import one.mixin.android.db.provider.convertToMessageItems import one.mixin.android.vo.MessageItem @@ -339,7 +342,7 @@ class QueryFileRendererTest { } @Test - fun rendersSimpleSQLiteQueryBuilder() { + fun rendersRoomRawQueryBuilder() { val source = QueryFileRenderer().render( QueryProviderModel( @@ -348,10 +351,10 @@ class QueryFileRendererTest { functions = emptyList(), simpleQueryFunctions = listOf( - SimpleSQLiteQueryFunctionModel( + RoomRawQueryFunctionModel( name = "snapshotsQuery", - returnType = "SimpleSQLiteQuery", - returnTypeImports = listOf("androidx.sqlite.db.SimpleSQLiteQuery"), + returnType = "RoomRawQuery", + returnTypeImports = listOf("androidx.room3.RoomRawQuery"), parameters = listOf( QueryParameterModel("whereSql", "String"), @@ -369,15 +372,15 @@ class QueryFileRendererTest { package one.mixin.android.ui.wallet import android.annotation.SuppressLint - import androidx.sqlite.db.SimpleSQLiteQuery + import androidx.room3.RoomRawQuery @SuppressLint("RestrictedApi") object WalletFilterQueryGenerated { fun snapshotsQuery( whereSql: String, orderSql: String, - ): SimpleSQLiteQuery = - SimpleSQLiteQuery( + ): RoomRawQuery = + RoomRawQuery( ""${'"'} SELECT * FROM snapshots ${'$'}whereSql ${'$'}orderSql ""${'"'}.trimIndent(), @@ -432,18 +435,17 @@ class QueryFileRendererTest { import android.annotation.SuppressLint import androidx.paging.PagingSource import androidx.paging.PagingState - import androidx.room.InvalidationTracker - import androidx.room.RoomSQLiteQuery - import androidx.room.paging.util.INITIAL_ITEM_COUNT - import androidx.room.paging.util.INVALID - import androidx.room.paging.util.getClippedRefreshKey - import androidx.room.paging.util.getLimit - import androidx.room.paging.util.getOffset - import androidx.room.withTransaction + import androidx.room3.paging.util.INITIAL_ITEM_COUNT + import androidx.room3.paging.util.getClippedRefreshKey + import androidx.room3.paging.util.getLimit + import androidx.room3.paging.util.getOffset + import androidx.room3.withReadTransaction import java.util.concurrent.atomic.AtomicInteger - import kotlinx.coroutines.asCoroutineDispatcher import kotlinx.coroutines.withContext import one.mixin.android.db.WalletDatabase + import one.mixin.android.db.datasource.RoomDatabaseCompat + import one.mixin.android.db.datasource.RoomQuery + import one.mixin.android.db.datasource.query import one.mixin.android.vo.route.OrderItem @SuppressLint("RestrictedApi") @@ -457,36 +459,29 @@ class QueryFileRendererTest { object : PagingSource() { private val itemCount = AtomicInteger(INITIAL_ITEM_COUNT) - private val observer = object : InvalidationTracker.Observer(arrayOf("orders")) { - override fun onInvalidated(tables: Set) { - invalidate() - } - } - init { - database.invalidationTracker.addWeakObserver(observer) + RoomDatabaseCompat.observeInvalidation(database, this, "orders") } override suspend fun load(params: LoadParams): LoadResult { - return withContext(database.queryExecutor.asCoroutineDispatcher()) { + return withContext(RoomDatabaseCompat.queryContext(database)) { val tempCount = itemCount.get() if (tempCount == INITIAL_ITEM_COUNT) { - database.withTransaction { + database.withReadTransaction { val count = countItems() itemCount.set(count) queryData(params, count) } } else { val loadResult = queryData(params, tempCount) - database.invalidationTracker.refreshVersionsSync() @Suppress("UNCHECKED_CAST") - if (invalid) INVALID as LoadResult.Invalid else loadResult + if (invalid) LoadResult.Invalid() else loadResult } } } private fun countItems(): Int { - val countStatement = RoomSQLiteQuery.acquire( + val countStatement = RoomQuery.acquire( ""${'"'} SELECT COUNT(DISTINCT o.rowid) FROM orders o ${'$'}whereSql ""${'"'}.trimIndent(), @@ -505,7 +500,7 @@ class QueryFileRendererTest { val key = params.key ?: 0 val limit = getLimit(params, key) val offset = getOffset(params, key, itemCount) - val offsetStatement = RoomSQLiteQuery.acquire( + val offsetStatement = RoomQuery.acquire( ""${'"'} SELECT DISTINCT o.rowid FROM orders o ${'$'}whereSql LIMIT ? OFFSET ? ""${'"'}.trimIndent(), @@ -547,8 +542,8 @@ class QueryFileRendererTest { ) } - private fun querySqlGenerator(ids: String): RoomSQLiteQuery { - return RoomSQLiteQuery.acquire( + private fun querySqlGenerator(ids: String): RoomQuery { + return RoomQuery.acquire( ""${'"'} SELECT * FROM orders o WHERE o.rowid IN (${'$'}ids) ${'$'}whereClauseSql ORDER BY ${'$'}orderBySql ""${'"'}.trimIndent(), From 00e23d45a0e84b3c4560d0c2a09afabe62bd4534 Mon Sep 17 00:00:00 2001 From: SeniorZhai Date: Fri, 3 Jul 2026 10:28:28 +0800 Subject: [PATCH 3/3] refactor(db): migrate remaining paging2 usages to paging3 --- app/proguard-rules.pro | 2 - .../one/mixin/android/db/ConversationDao.kt | 4 +- .../java/one/mixin/android/db/MessageDao.kt | 37 +++- .../one/mixin/android/db/MixinDatabase.kt | 2 - .../one/mixin/android/db/SafeSnapshotDao.kt | 17 +- .../java/one/mixin/android/db/SnapshotDao.kt | 19 +- .../mixin/android/db/TranscriptMessageDao.kt | 4 +- ...DataSourceFactoryDaoReturnTypeConverter.kt | 94 ---------- .../db/datasource/FastComputableLiveData.kt | 91 --------- .../datasource/FastLivePagedListBuilder.java | 176 ------------------ .../MixinCountLimitOffsetDataSource.kt | 12 +- .../datasource/MixinLimitOffsetDataSource.kt | 114 ------------ .../NoCountLimitOffsetDataSource.java | 80 -------- .../db/datasource/RoomDatabaseCompat.kt | 11 -- .../mixin/android/db/provider/DataProvider.kt | 16 +- .../db/provider/DataProviderQuerySpec.kt | 18 +- .../one/mixin/android/fts/FtsDataSource.kt | 128 ++++--------- .../one/mixin/android/fts/FtsQuerySpec.kt | 17 ++ .../repository/ConversationRepository.kt | 37 +--- .../common/recyclerview/PagedHeaderAdapter.kt | 103 ---------- .../recyclerview/PagingHeaderAdapter.kt | 4 +- ....kt => PagingHeaderAdapterDataObserver.kt} | 5 +- .../recyclerview/SafePagedListAdapter.kt | 68 ------- .../recyclerview/SafePagingDataAdapter.kt | 9 + .../chathistory/ChatHistoryActivity.kt | 38 ++-- .../chathistory/ChatHistoryAdapter.kt | 4 +- .../ui/home/ConversationListFragment.kt | 98 ++++++---- .../ui/home/ConversationListViewModel.kt | 28 +-- .../mixin/android/ui/media/AudioFragment.kt | 18 +- .../mixin/android/ui/media/FileFragment.kt | 18 +- .../one/mixin/android/ui/media/LinkAdapter.kt | 4 +- .../mixin/android/ui/media/LinkFragment.kt | 18 +- .../mixin/android/ui/media/MediaFragment.kt | 18 +- .../android/ui/media/PagedListPagerAdapter.kt | 119 ------------ .../mixin/android/ui/media/PostFragment.kt | 18 +- .../ui/media/SharedMediaHeaderAdapter.kt | 4 +- .../android/ui/media/SharedMediaViewModel.kt | 125 ++++--------- .../ui/media/pager/MediaPagerActivity.kt | 76 +++----- .../ui/media/pager/MediaPagerAdapter.kt | 4 +- .../android/ui/player/MediaItemAdapter.kt | 4 +- .../player/MusicBottomSheetDialogFragment.kt | 49 +---- .../mixin/android/ui/player/MusicService.kt | 26 +-- .../ui/player/internal/ConversationLoader.kt | 23 ++- .../android/ui/search/SearchMessageAdapter.kt | 4 +- .../ui/search/SearchMessageFragment.kt | 10 +- .../android/ui/search/SearchViewModel.kt | 35 ++-- .../ui/wallet/adapter/TransactionsAdapter.kt | 4 +- .../java/one/mixin/android/vo/MessageItem.kt | 18 -- ... GeneratedLimitOffsetPagingSourceQuery.kt} | 2 +- ...t => GeneratedNoCountPagingSourceQuery.kt} | 2 +- .../annotation/GeneratedRoomRawQuery.kt | 7 + .../codegen/processor/QueryFileRenderer.kt | 102 +++++----- .../codegen/processor/QueryProcessor.kt | 24 +-- .../processor/QueryFileRendererTest.kt | 132 +++++++------ 54 files changed, 578 insertions(+), 1522 deletions(-) delete mode 100644 app/src/main/java/one/mixin/android/db/datasource/DataSourceFactoryDaoReturnTypeConverter.kt delete mode 100644 app/src/main/java/one/mixin/android/db/datasource/FastComputableLiveData.kt delete mode 100644 app/src/main/java/one/mixin/android/db/datasource/FastLivePagedListBuilder.java delete mode 100644 app/src/main/java/one/mixin/android/db/datasource/MixinLimitOffsetDataSource.kt delete mode 100644 app/src/main/java/one/mixin/android/db/datasource/NoCountLimitOffsetDataSource.java delete mode 100644 app/src/main/java/one/mixin/android/ui/common/recyclerview/PagedHeaderAdapter.kt rename app/src/main/java/one/mixin/android/ui/common/recyclerview/{PagedHeaderAdapterDataObserver.kt => PagingHeaderAdapterDataObserver.kt} (92%) delete mode 100644 app/src/main/java/one/mixin/android/ui/common/recyclerview/SafePagedListAdapter.kt create mode 100644 app/src/main/java/one/mixin/android/ui/common/recyclerview/SafePagingDataAdapter.kt delete mode 100644 app/src/main/java/one/mixin/android/ui/media/PagedListPagerAdapter.kt rename query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/{GeneratedLimitOffsetDataSourceQuery.kt => GeneratedLimitOffsetPagingSourceQuery.kt} (84%) rename query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/{GeneratedNoCountDataSourceQuery.kt => GeneratedNoCountPagingSourceQuery.kt} (84%) create mode 100644 query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedRoomRawQuery.kt diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 42f6c925a7..2678a2f783 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -20,8 +20,6 @@ -dontwarn org.jni_zero.** # androidx paging --keep class androidx.paging.PagedListAdapter.** { *; } --keep class androidx.paging.AsyncPagedListDiffer.** { *; } # ServiceLoader support -keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {} diff --git a/app/src/main/java/one/mixin/android/db/ConversationDao.kt b/app/src/main/java/one/mixin/android/db/ConversationDao.kt index 38d3d02bd0..8732244757 100644 --- a/app/src/main/java/one/mixin/android/db/ConversationDao.kt +++ b/app/src/main/java/one/mixin/android/db/ConversationDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db import androidx.lifecycle.LiveData -import androidx.paging.DataSource +import androidx.paging.PagingSource import androidx.room3.Dao import androidx.room3.Query import androidx.room3.RoomWarnings @@ -46,7 +46,7 @@ interface ConversationDao : BaseDao { ORDER BY c.pin_time DESC, c.last_message_created_at DESC """, ) - fun conversationList(): DataSource.Factory + fun conversationList(): PagingSource @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( diff --git a/app/src/main/java/one/mixin/android/db/MessageDao.kt b/app/src/main/java/one/mixin/android/db/MessageDao.kt index 8000563807..f122862198 100644 --- a/app/src/main/java/one/mixin/android/db/MessageDao.kt +++ b/app/src/main/java/one/mixin/android/db/MessageDao.kt @@ -1,7 +1,7 @@ package one.mixin.android.db import androidx.lifecycle.LiveData -import androidx.paging.DataSource +import androidx.paging.PagingSource import androidx.room3.Dao import androidx.room3.Query import androidx.room3.RawQuery @@ -102,7 +102,7 @@ interface MessageDao : BaseDao { ORDER BY m.created_at ASC, m.rowid ASC """, ) - fun getMediaMessages(conversationId: String): DataSource.Factory + fun getMediaMessages(conversationId: String): PagingSource @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( @@ -197,7 +197,7 @@ interface MessageDao : BaseDao { ORDER BY m.created_at DESC, m.rowid DESC """, ) - fun getMediaMessagesExcludeLive(conversationId: String): DataSource.Factory + fun getMediaMessagesExcludeLive(conversationId: String): PagingSource @Query( """ @@ -228,13 +228,13 @@ interface MessageDao : BaseDao { m.content AS content, m.created_at AS createdAt, m.status AS status, m.media_status AS mediaStatus, m.media_width AS mediaWidth, m.media_height AS mediaHeight, m.thumb_image AS thumbImage, m.thumb_url AS thumbUrl, m.media_url AS mediaUrl, m.media_mime_type AS mediaMimeType, m.media_duration AS mediaDuration, m.media_waveform AS mediaWaveform - FROM messages m INNER JOIN users u ON m.user_id = u.user_id + FROM messages m INNER JOIN users u ON m.user_id = u.user_id WHERE m.conversation_id = :conversationId AND m.category IN ($AUDIOS) ORDER BY m.created_at DESC """, ) - fun getAudioMessages(conversationId: String): DataSource.Factory + fun getAudioMessages(conversationId: String): PagingSource @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( @@ -250,7 +250,7 @@ interface MessageDao : BaseDao { ORDER BY m.created_at DESC """, ) - fun getPostMessages(conversationId: String): DataSource.Factory + fun getPostMessages(conversationId: String): PagingSource @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( @@ -279,7 +279,7 @@ interface MessageDao : BaseDao { ORDER BY m.created_at DESC """, ) - fun getLinkMessages(conversationId: String): DataSource.Factory + fun getLinkMessages(conversationId: String): PagingSource @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( @@ -294,7 +294,7 @@ interface MessageDao : BaseDao { ORDER BY m.created_at DESC """, ) - fun getFileMessages(conversationId: String): DataSource.Factory + fun getFileMessages(conversationId: String): PagingSource @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( @@ -652,13 +652,30 @@ interface MessageDao : BaseDao { m.media_url AS mediaUrl, m.media_mime_type AS mediaMimeType, m.name AS mediaName, m.media_size AS mediaSize FROM messages m INNER JOIN users u ON m.user_id = u.user_id WHERE m.conversation_id = :conversationId - AND (m.category IN ($DATA)) + AND (m.category IN ($DATA)) + AND m.media_mime_type LIKE 'audio%' + AND m.media_status != 'EXPIRED' + ORDER BY m.created_at ASC, m.rowid ASC + """, + ) + fun findAudiosByConversationId(conversationId: String): PagingSource + + @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) + @Query( + """ + SELECT m.id AS messageId, m.conversation_id AS conversationId, u.user_id AS userId, + u.full_name AS userFullName, u.identity_number AS userIdentityNumber, m.category AS type, + m.content AS content, m.created_at AS createdAt, m.status AS status, m.media_status AS mediaStatus, + m.media_url AS mediaUrl, m.media_mime_type AS mediaMimeType, m.name AS mediaName, m.media_size AS mediaSize + FROM messages m INNER JOIN users u ON m.user_id = u.user_id + WHERE m.conversation_id = :conversationId + AND (m.category IN ($DATA)) AND m.media_mime_type LIKE 'audio%' AND m.media_status != 'EXPIRED' ORDER BY m.created_at ASC, m.rowid ASC """, ) - fun findAudiosByConversationId(conversationId: String): DataSource.Factory + suspend fun findAudiosByConversationIdList(conversationId: String): List @SuppressWarnings(RoomWarnings.QUERY_MISMATCH) @Query( diff --git a/app/src/main/java/one/mixin/android/db/MixinDatabase.kt b/app/src/main/java/one/mixin/android/db/MixinDatabase.kt index dce812e682..9f6fb9c955 100644 --- a/app/src/main/java/one/mixin/android/db/MixinDatabase.kt +++ b/app/src/main/java/one/mixin/android/db/MixinDatabase.kt @@ -73,7 +73,6 @@ import one.mixin.android.db.MixinDatabaseMigrations.Companion.MIGRATION_68_69 import one.mixin.android.db.MixinDatabaseMigrations.Companion.MIGRATION_69_70 import one.mixin.android.db.converter.DepositEntryListConverter import one.mixin.android.db.converter.FiatOrderConverter -import one.mixin.android.db.datasource.DataSourceFactoryDaoReturnTypeConverter import one.mixin.android.db.datasource.RoomDatabaseCompat import one.mixin.android.db.datasource.execSQL import one.mixin.android.db.converter.MembershipConverter @@ -217,7 +216,6 @@ import kotlin.math.min FiatOrderConverter::class ) @DaoReturnTypeConverters( - DataSourceFactoryDaoReturnTypeConverter::class, LiveDataDaoReturnTypeConverter::class, PagingSourceDaoReturnTypeConverter::class, ) diff --git a/app/src/main/java/one/mixin/android/db/SafeSnapshotDao.kt b/app/src/main/java/one/mixin/android/db/SafeSnapshotDao.kt index 865763c115..653f2d04ae 100644 --- a/app/src/main/java/one/mixin/android/db/SafeSnapshotDao.kt +++ b/app/src/main/java/one/mixin/android/db/SafeSnapshotDao.kt @@ -1,7 +1,6 @@ package one.mixin.android.db import androidx.lifecycle.LiveData -import androidx.paging.DataSource import androidx.paging.PagingSource import androidx.room3.Dao import androidx.room3.Query @@ -43,7 +42,7 @@ interface SafeSnapshotDao : BaseDao { } @Query("$SNAPSHOT_ITEM_PREFIX WHERE s.asset_id = :assetId ORDER BY s.created_at DESC, s.snapshot_id DESC") - fun snapshots(assetId: String): DataSource.Factory + fun snapshots(assetId: String): PagingSource @Query("$SNAPSHOT_ITEM_PREFIX WHERE s.asset_id = :assetId ORDER BY s.created_at DESC, s.snapshot_id DESC LIMIT 21") fun snapshotsLimit(assetId: String): LiveData> @@ -52,21 +51,21 @@ interface SafeSnapshotDao : BaseDao { fun recentSnapshotsLimit(): LiveData> @Query("$SNAPSHOT_ITEM_PREFIX WHERE s.asset_id = :assetId ORDER BY abs(s.amount) DESC, s.snapshot_id DESC") - fun snapshotsOrderByAmount(assetId: String): DataSource.Factory + fun snapshotsOrderByAmount(assetId: String): PagingSource @Query("$SNAPSHOT_ITEM_PREFIX WHERE s.asset_id = :assetId AND s.type IN (:type, :otherType) ORDER BY s.created_at DESC, s.snapshot_id DESC") fun snapshotsByType( assetId: String, type: String, otherType: String? = null, - ): DataSource.Factory + ): PagingSource @Query("$SNAPSHOT_ITEM_PREFIX WHERE s.asset_id = :assetId AND s.type IN (:type, :otherType) ORDER BY abs(s.amount) DESC, s.snapshot_id DESC") fun snapshotsByTypeOrderByAmount( assetId: String, type: String, otherType: String? = null, - ): DataSource.Factory + ): PagingSource @Query("$SNAPSHOT_ITEM_PREFIX WHERE s.asset_id = :assetId ORDER BY s.created_at DESC, s.snapshot_id DESC") fun snapshotsPaging(assetId: String): PagingSource @@ -107,22 +106,22 @@ interface SafeSnapshotDao : BaseDao { fun getSnapshots(query: RoomRawQuery): PagingSource @Query("$SNAPSHOT_ITEM_PREFIX ORDER BY abs(s.amount * t.price_usd) DESC") - fun allSnapshotsOrderByAmount(): DataSource.Factory + fun allSnapshotsOrderByAmount(): PagingSource @Query("$SNAPSHOT_ITEM_PREFIX WHERE s.type IN (:type, :otherType) ORDER BY s.created_at DESC") fun allSnapshotsByType( type: String, otherType: String? = null, - ): DataSource.Factory + ): PagingSource @Query("$SNAPSHOT_ITEM_PREFIX WHERE s.type IN (:type, :otherType) ORDER BY abs(s.amount * t.price_usd) DESC") fun allSnapshotsByTypeOrderByAmount( type: String, otherType: String? = null, - ): DataSource.Factory + ): PagingSource @Query("$SNAPSHOT_ITEM_PREFIX WHERE s.opponent_id = :opponentId AND s.type != 'pending' ORDER BY s.created_at DESC, s.snapshot_id DESC") - fun snapshotsByUserId(opponentId: String): DataSource.Factory + fun snapshotsByUserId(opponentId: String): PagingSource @Query("SELECT t.symbol, t.icon_url, s.amount, t.asset_id FROM safe_snapshots s LEFT JOIN tokens t ON t.asset_id = s.asset_id WHERE s.type = 'pending' AND t.symbol IS NOT NULL") fun getPendingDisplays(): LiveData> diff --git a/app/src/main/java/one/mixin/android/db/SnapshotDao.kt b/app/src/main/java/one/mixin/android/db/SnapshotDao.kt index d77e3222d1..18ca06223a 100644 --- a/app/src/main/java/one/mixin/android/db/SnapshotDao.kt +++ b/app/src/main/java/one/mixin/android/db/SnapshotDao.kt @@ -1,6 +1,5 @@ package one.mixin.android.db -import androidx.paging.DataSource import androidx.paging.PagingSource import androidx.room3.Dao import androidx.room3.Query @@ -19,24 +18,24 @@ interface SnapshotDao : BaseDao { } @Query("$SNAPSHOT_ITEM_PREFIX WHERE s.asset_id = :assetId ORDER BY s.created_at DESC, s.snapshot_id DESC") - fun snapshots(assetId: String): DataSource.Factory + fun snapshots(assetId: String): PagingSource @Query("$SNAPSHOT_ITEM_PREFIX WHERE s.asset_id = :assetId ORDER BY abs(s.amount) DESC, s.snapshot_id DESC") - fun snapshotsOrderByAmount(assetId: String): DataSource.Factory + fun snapshotsOrderByAmount(assetId: String): PagingSource @Query("$SNAPSHOT_ITEM_PREFIX WHERE s.asset_id = :assetId AND s.type IN (:type, :otherType) ORDER BY s.created_at DESC, s.snapshot_id DESC") fun snapshotsByType( assetId: String, type: String, otherType: String? = null, - ): DataSource.Factory + ): PagingSource @Query("$SNAPSHOT_ITEM_PREFIX WHERE s.asset_id = :assetId AND s.type IN (:type, :otherType) ORDER BY abs(s.amount) DESC, s.snapshot_id DESC") fun snapshotsByTypeOrderByAmount( assetId: String, type: String, otherType: String? = null, - ): DataSource.Factory + ): PagingSource @Query("$SNAPSHOT_ITEM_PREFIX WHERE s.asset_id = :assetId ORDER BY s.created_at DESC, s.snapshot_id DESC") fun snapshotsPaging(assetId: String): PagingSource @@ -71,25 +70,25 @@ interface SnapshotDao : BaseDao { suspend fun findSnapshotByTraceId(traceId: String): SnapshotItem? @Query("$SNAPSHOT_ITEM_PREFIX ORDER BY s.created_at DESC") - fun allSnapshots(): DataSource.Factory + fun allSnapshots(): PagingSource @Query("$SNAPSHOT_ITEM_PREFIX ORDER BY abs(s.amount * a.price_usd) DESC") - fun allSnapshotsOrderByAmount(): DataSource.Factory + fun allSnapshotsOrderByAmount(): PagingSource @Query("$SNAPSHOT_ITEM_PREFIX WHERE s.type IN (:type, :otherType) ORDER BY s.created_at DESC") fun allSnapshotsByType( type: String, otherType: String? = null, - ): DataSource.Factory + ): PagingSource @Query("$SNAPSHOT_ITEM_PREFIX WHERE s.type IN (:type, :otherType) ORDER BY abs(s.amount * a.price_usd) DESC") fun allSnapshotsByTypeOrderByAmount( type: String, otherType: String? = null, - ): DataSource.Factory + ): PagingSource @Query("$SNAPSHOT_ITEM_PREFIX WHERE s.opponent_id = :opponentId AND s.type != 'pending' ORDER BY s.created_at DESC, s.snapshot_id DESC") - fun snapshotsByUserId(opponentId: String): DataSource.Factory + fun snapshotsByUserId(opponentId: String): PagingSource @Query("DELETE FROM snapshots WHERE asset_id = :assetId AND type = 'pending'") suspend fun clearPendingDepositsByAssetId(assetId: String) diff --git a/app/src/main/java/one/mixin/android/db/TranscriptMessageDao.kt b/app/src/main/java/one/mixin/android/db/TranscriptMessageDao.kt index 2d0d1682f9..89b2f94b46 100644 --- a/app/src/main/java/one/mixin/android/db/TranscriptMessageDao.kt +++ b/app/src/main/java/one/mixin/android/db/TranscriptMessageDao.kt @@ -1,6 +1,6 @@ package one.mixin.android.db -import androidx.paging.DataSource +import androidx.paging.PagingSource import androidx.room3.Dao import androidx.room3.Query import androidx.room3.RoomWarnings @@ -80,7 +80,7 @@ interface TranscriptMessageDao : BaseDao { ORDER BY t.created_at ASC, t.rowid ASC """, ) - fun getTranscriptMessages(transcriptId: String): DataSource.Factory + fun getTranscriptMessages(transcriptId: String): PagingSource @Query("SELECT count(1) FROM transcript_messages WHERE created_at < (SELECT created_at FROM transcript_messages WHERE transcript_id = :transcriptId AND message_id = :messageId) AND transcript_id = :transcriptId") suspend fun findTranscriptMessageIndex( diff --git a/app/src/main/java/one/mixin/android/db/datasource/DataSourceFactoryDaoReturnTypeConverter.kt b/app/src/main/java/one/mixin/android/db/datasource/DataSourceFactoryDaoReturnTypeConverter.kt deleted file mode 100644 index 9653f3c3a0..0000000000 --- a/app/src/main/java/one/mixin/android/db/datasource/DataSourceFactoryDaoReturnTypeConverter.kt +++ /dev/null @@ -1,94 +0,0 @@ -package one.mixin.android.db.datasource - -import androidx.paging.DataSource -import androidx.paging.PositionalDataSource -import androidx.room3.DaoReturnTypeConverter -import androidx.room3.OperationType -import androidx.room3.RoomDatabase -import androidx.room3.RoomRawQuery -import androidx.room3.useReaderConnection -import kotlinx.coroutines.runBlocking -import timber.log.Timber - -object DataSourceFactoryDaoReturnTypeConverter { - @DaoReturnTypeConverter(operations = [OperationType.READ]) - fun convert( - db: RoomDatabase, - tableNames: Array, - rawQuery: RoomRawQuery, - executeAndConvert: suspend (RoomRawQuery) -> List, - ): DataSource.Factory { - return object : DataSource.Factory() { - override fun create(): DataSource { - return RoomRawQueryDataSource(db, tableNames, rawQuery, executeAndConvert) - } - } - } -} - -private class RoomRawQueryDataSource( - private val db: RoomDatabase, - private val tableNames: Array, - private val rawQuery: RoomRawQuery, - private val executeAndConvert: suspend (RoomRawQuery) -> List, -) : PositionalDataSource() { - init { - RoomDatabaseCompat.observeInvalidation(db, this, *tableNames) - } - - override fun loadInitial( - params: LoadInitialParams, - callback: LoadInitialCallback, - ) { - val totalCount = countItems() - if (totalCount == 0) { - callback.onResult(emptyList(), 0, 0) - return - } - val firstLoadPosition = computeInitialLoadPosition(params, totalCount) - val firstLoadSize = computeInitialLoadSize(params, firstLoadPosition, totalCount) - val list = loadRange(firstLoadPosition, firstLoadSize) - try { - callback.onResult(list, firstLoadPosition, totalCount) - } catch (e: IllegalArgumentException) { - Timber.w(e) - try { - callback.onResult(list, firstLoadPosition, firstLoadPosition + list.size) - } catch (iae: IllegalArgumentException) { - Timber.w(iae) - } - } - } - - override fun loadRange( - params: LoadRangeParams, - callback: LoadRangeCallback, - ) { - callback.onResult(loadRange(params.startPosition, params.loadSize)) - } - - private fun countItems(): Int { - val countSql = "SELECT COUNT(*) FROM (${rawQuery.sql})" - return runBlocking(RoomDatabaseCompat.queryContext(db)) { - db.useReaderConnection { connection -> - connection.usePrepared(countSql) { statement -> - RoomRawQueryCompat.bind(rawQuery, statement) - if (statement.step()) statement.getLong(0).toInt() else 0 - } - } - } - } - - private fun loadRange( - startPosition: Int, - loadCount: Int, - ): List { - val limitOffsetQuery = - RoomRawQuery("${rawQuery.sql} LIMIT $loadCount OFFSET $startPosition") { statement -> - RoomRawQueryCompat.bind(rawQuery, statement) - } - return runBlocking(RoomDatabaseCompat.queryContext(db)) { - executeAndConvert(limitOffsetQuery) - } - } -} diff --git a/app/src/main/java/one/mixin/android/db/datasource/FastComputableLiveData.kt b/app/src/main/java/one/mixin/android/db/datasource/FastComputableLiveData.kt deleted file mode 100644 index 541c3610ca..0000000000 --- a/app/src/main/java/one/mixin/android/db/datasource/FastComputableLiveData.kt +++ /dev/null @@ -1,91 +0,0 @@ -package one.mixin.android.db.datasource - -import android.annotation.SuppressLint -import androidx.annotation.VisibleForTesting -import androidx.annotation.WorkerThread -import androidx.arch.core.executor.ArchTaskExecutor -import androidx.lifecycle.LiveData -import java.util.concurrent.Executor -import java.util.concurrent.atomic.AtomicBoolean - -@SuppressLint("RestrictedApi") -abstract class FastComputableLiveData - @JvmOverloads - constructor( - // synthetic access - val mExecutor: Executor = ArchTaskExecutor.getIOThreadExecutor(), - ) { - val liveData: InnerLiveData = - object : InnerLiveData() { - override fun onActive() { - mExecutor.execute(mRefreshRunnable) - } - } - val mInvalid = AtomicBoolean(true) - val mComputing = AtomicBoolean(false) - - @VisibleForTesting - val mRefreshRunnable = - Runnable { - var computed: Boolean - do { - computed = false - // compute can happen only in 1 thread but no reason to lock others. - if (mComputing.compareAndSet(false, true)) { - // as long as it is invalid, keep computing. - try { - var value: T? = null - while (mInvalid.compareAndSet(true, false)) { - computed = true - value = compute() - } - if (computed && value != null) { - liveData.post(value) - } - } finally { - // release compute lock - mComputing.set(false) - } - } - // check invalid after releasing compute lock to avoid the following scenario. - // Thread A runs compute() - // Thread A checks invalid, it is false - // Main thread sets invalid to true - // Thread B runs, fails to acquire compute lock and skips - // Thread A releases compute lock - // We've left invalid in set state. The check below recovers. - } while (computed && mInvalid.get()) - } - - // invalidation check always happens on the main thread - @VisibleForTesting - val mInvalidationRunnable = - Runnable { - val isActive = liveData.hasActiveObservers() - if (mInvalid.compareAndSet(false, true)) { - if (isActive) { - mExecutor.execute(mRefreshRunnable) - } - } - } - - /** - * Invalidates the LiveData. - * - * - * When there are active observers, this will trigger a call to [.compute]. - */ - fun invalidate() { - ArchTaskExecutor.getInstance().executeOnMainThread(mInvalidationRunnable) - } - - // TODO https://issuetracker.google.com/issues/112197238 - @WorkerThread - protected abstract fun compute(): T - - open class InnerLiveData : LiveData() { - fun post(value: T) { - postValue(value) - } - } - } diff --git a/app/src/main/java/one/mixin/android/db/datasource/FastLivePagedListBuilder.java b/app/src/main/java/one/mixin/android/db/datasource/FastLivePagedListBuilder.java deleted file mode 100644 index 78b4618089..0000000000 --- a/app/src/main/java/one/mixin/android/db/datasource/FastLivePagedListBuilder.java +++ /dev/null @@ -1,176 +0,0 @@ -package one.mixin.android.db.datasource; - -import android.annotation.SuppressLint; - -import androidx.annotation.AnyThread; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.arch.core.executor.ArchTaskExecutor; -import androidx.paging.DataSource; -import androidx.paging.PagedList; - -import java.util.concurrent.Executor; - -public final class FastLivePagedListBuilder { - private Key mInitialLoadKey; - private PagedList.Config mConfig; - private DataSource.Factory mDataSourceFactory; - private PagedList.BoundaryCallback mBoundaryCallback; - @SuppressLint("RestrictedApi") - private Executor mFetchExecutor = ArchTaskExecutor.getIOThreadExecutor(); - - /** - * Creates a LivePagedListBuilder with required parameters. - * - * @param dataSourceFactory DataSource factory providing DataSource generations. - * @param config Paging configuration. - */ - public FastLivePagedListBuilder(@NonNull DataSource.Factory dataSourceFactory, - @NonNull PagedList.Config config) { - //noinspection ConstantConditions - if (config == null) { - throw new IllegalArgumentException("PagedList.Config must be provided"); - } - //noinspection ConstantConditions - if (dataSourceFactory == null) { - throw new IllegalArgumentException("DataSource.Factory must be provided"); - } - - mDataSourceFactory = dataSourceFactory; - mConfig = config; - } - - /** - * Creates a LivePagedListBuilder with required parameters. - *

- * This method is a convenience for: - *

-     * LivePagedListBuilder(dataSourceFactory,
-     *         new PagedList.Config.Builder().setPageSize(pageSize).build())
-     * 
- * - * @param dataSourceFactory DataSource.Factory providing DataSource generations. - * @param pageSize Size of pages to load. - */ - public FastLivePagedListBuilder(@NonNull DataSource.Factory dataSourceFactory, - int pageSize) { - this(dataSourceFactory, new PagedList.Config.Builder().setPageSize(pageSize).build()); - } - - /** - * First loading key passed to the first PagedList/DataSource. - *

- * When a new PagedList/DataSource pair is created after the first, it acquires a load key from - * the previous generation so that data is loaded around the position already being observed. - * - * @param key Initial load key passed to the first PagedList/DataSource. - * @return this - */ - @NonNull - public FastLivePagedListBuilder setInitialLoadKey(@Nullable Key key) { - mInitialLoadKey = key; - return this; - } - - /** - * Sets a {@link PagedList.BoundaryCallback} on each PagedList created, typically used to load - * additional data from network when paging from local storage. - *

- * Pass a BoundaryCallback to listen to when the PagedList runs out of data to load. If this - * method is not called, or {@code null} is passed, you will not be notified when each - * DataSource runs out of data to provide to its PagedList. - *

- * If you are paging from a DataSource.Factory backed by local storage, you can set a - * BoundaryCallback to know when there is no more information to page from local storage. - * This is useful to page from the network when local storage is a cache of network data. - *

- * Note that when using a BoundaryCallback with a {@code LiveData}, method calls - * on the callback may be dispatched multiple times - one for each PagedList/DataSource - * pair. If loading network data from a BoundaryCallback, you should prevent multiple - * dispatches of the same method from triggering multiple simultaneous network loads. - * - * @param boundaryCallback The boundary callback for listening to PagedList load state. - * @return this - */ - @SuppressWarnings("unused") - @NonNull - public FastLivePagedListBuilder setBoundaryCallback( - @Nullable PagedList.BoundaryCallback boundaryCallback) { - mBoundaryCallback = boundaryCallback; - return this; - } - - /** - * Sets executor used for background fetching of PagedLists, and the pages within. - *

- * If not set, defaults to the Arch components I/O thread pool. - * - * @param fetchExecutor Executor for fetching data from DataSources. - * @return this - */ - @SuppressWarnings("unused") - @NonNull - public FastLivePagedListBuilder setFetchExecutor( - @NonNull Executor fetchExecutor) { - mFetchExecutor = fetchExecutor; - return this; - } - - /** - * Constructs the {@code LiveData}. - *

- * No work (such as loading) is done immediately, the creation of the first PagedList is is - * deferred until the LiveData is observed. - * - * @return The LiveData of PagedLists - */ - @NonNull - @SuppressLint("RestrictedApi") - public FastComputableLiveData> build() { - return create(mInitialLoadKey, mConfig, mBoundaryCallback, mDataSourceFactory, - ArchTaskExecutor.getMainThreadExecutor(), mFetchExecutor); - } - - @AnyThread - @NonNull - @SuppressLint("RestrictedApi") - private static FastComputableLiveData> create( - @Nullable final Key initialLoadKey, - @NonNull final PagedList.Config config, - @Nullable final PagedList.BoundaryCallback boundaryCallback, - @NonNull final DataSource.Factory dataSourceFactory, - @NonNull final Executor notifyExecutor, - @NonNull final Executor fetchExecutor) { - return new FastComputableLiveData>(fetchExecutor) { - @Nullable - private PagedList mList; - @Nullable - private DataSource mDataSource; - private final DataSource.InvalidatedCallback mCallback = this::invalidate; - - @SuppressWarnings("unchecked") // for casting getLastKey to Key - @Override - protected PagedList compute() { - @Nullable Key initializeKey = initialLoadKey; - if (mList != null) { - initializeKey = (Key) mList.getLastKey(); - } - - do { - if (mDataSource != null) { - mDataSource.removeInvalidatedCallback(mCallback); - } - mDataSource = dataSourceFactory.create(); - mDataSource.addInvalidatedCallback(mCallback); - mList = new PagedList.Builder<>(mDataSource, config) - .setNotifyExecutor(notifyExecutor) - .setFetchExecutor(fetchExecutor) - .setBoundaryCallback(boundaryCallback) - .setInitialKey(initializeKey) - .build(); - } while (mList.isDetached()); - return mList; - } - }; - } -} \ No newline at end of file diff --git a/app/src/main/java/one/mixin/android/db/datasource/MixinCountLimitOffsetDataSource.kt b/app/src/main/java/one/mixin/android/db/datasource/MixinCountLimitOffsetDataSource.kt index 383ac13abe..3bdf277c48 100644 --- a/app/src/main/java/one/mixin/android/db/datasource/MixinCountLimitOffsetDataSource.kt +++ b/app/src/main/java/one/mixin/android/db/datasource/MixinCountLimitOffsetDataSource.kt @@ -20,9 +20,14 @@ abstract class MixinCountLimitOffsetDataSource( private val fastCountCallback: () -> Int, private val querySqlGenerator: (ids: String) -> RoomQuery, private val db: RoomDatabase, + vararg tables: String, ) : PagingSource() { internal val itemCount: AtomicInteger = AtomicInteger(INITIAL_ITEM_COUNT) + init { + RoomDatabaseCompat.observeInvalidation(db, this, *tables) + } + override suspend fun load(params: LoadParams): LoadResult { return withContext(RoomDatabaseCompat.queryContext(db)) { val tempCount = itemCount.get() @@ -80,7 +85,12 @@ abstract class MixinCountLimitOffsetDataSource( offsetQuery.bindLong(argCount, offset.toLong()) val cursor = db.query(offsetQuery) val ids: List = convertRowsToIds(cursor) - val data = convertRows(db.query(querySqlGenerator(ids.joinToString()))) + val data = + if (ids.isEmpty()) { + emptyList() + } else { + convertRows(db.query(querySqlGenerator(ids.joinToString()))) + } val nextPosToLoad = offset + data.size val nextKey = if (ids.isEmpty() || ids.size < limit || nextPosToLoad >= itemCount) { diff --git a/app/src/main/java/one/mixin/android/db/datasource/MixinLimitOffsetDataSource.kt b/app/src/main/java/one/mixin/android/db/datasource/MixinLimitOffsetDataSource.kt deleted file mode 100644 index 1686f8042b..0000000000 --- a/app/src/main/java/one/mixin/android/db/datasource/MixinLimitOffsetDataSource.kt +++ /dev/null @@ -1,114 +0,0 @@ -package one.mixin.android.db.datasource - -import android.annotation.SuppressLint -import android.database.Cursor -import androidx.annotation.RestrictTo -import androidx.paging.PositionalDataSource -import androidx.room3.RoomDatabase -import timber.log.Timber - -@SuppressLint("RestrictedApi") -@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) -abstract class MixinLimitOffsetDataSource protected constructor( - private val db: RoomDatabase, - private val countQuery: RoomQuery, - private val offsetStatement: RoomQuery, - private val querySqlGenerator: (String) -> RoomQuery, - private val tables: Array, -) : PositionalDataSource() { - /** - * Count number of rows query can return - */ - private fun countItems(): Int { - val cursor = db.query(countQuery) - return try { - if (cursor.moveToFirst()) { - cursor.getInt(0) - } else { - 0 - } - } finally { - cursor.close() - } - } - - protected abstract fun convertRows(cursor: Cursor?): List - - override fun loadInitial( - params: LoadInitialParams, - callback: LoadInitialCallback, - ) { - val totalCount = countItems() - if (totalCount == 0) { - callback.onResult(emptyList(), 0, 0) - return - } - - // bound the size requested, based on known count - val firstLoadPosition = computeInitialLoadPosition(params, totalCount) - val firstLoadSize = computeInitialLoadSize(params, firstLoadPosition, totalCount) - val list = loadRange(firstLoadPosition, firstLoadSize) - try { - callback.onResult(list, firstLoadPosition, totalCount) - } catch (e: IllegalArgumentException) { - // workaround with paging initial load size NOT to be a multiple of page size - Timber.w(e) - try { - callback.onResult(list, firstLoadPosition, firstLoadPosition + list.size) - } catch (iae: IllegalArgumentException) { - // workaround with paging incorrect tiling - Timber.w(iae) - } - } - } - - override fun loadRange( - params: LoadRangeParams, - callback: LoadRangeCallback, - ) { - val list = loadRange(params.startPosition, params.loadSize) - callback.onResult(list) - } - - /** - * Return the rows from startPos to startPos + loadCount - */ - private fun loadRange( - startPosition: Int, - loadCount: Int, - ): List { - val ids = itemIds(startPosition, loadCount) - val sqLiteQuery = querySqlGenerator(ids) - val cursor = db.query(sqLiteQuery) - try { - return convertRows(cursor) - } finally { - cursor.close() - } - } - - private fun itemIds( - startPosition: Int, - loadCount: Int, - ): String { - val offsetQuery = RoomQuery.copyFrom(offsetStatement) - val argCount = offsetStatement.argCount - offsetQuery.bindLong(argCount - 1, loadCount.toLong()) - offsetQuery.bindLong(argCount, startPosition.toLong()) - val cursor = db.query(offsetQuery) - val ids = mutableListOf() - try { - while (cursor.moveToNext()) { - val rowid = cursor.getLong(0) - ids.add("'$rowid'") - } - return ids.joinToString() - } finally { - cursor.close() - } - } - - init { - RoomDatabaseCompat.observeInvalidation(db, this, *tables) - } -} diff --git a/app/src/main/java/one/mixin/android/db/datasource/NoCountLimitOffsetDataSource.java b/app/src/main/java/one/mixin/android/db/datasource/NoCountLimitOffsetDataSource.java deleted file mode 100644 index 87a1797fe3..0000000000 --- a/app/src/main/java/one/mixin/android/db/datasource/NoCountLimitOffsetDataSource.java +++ /dev/null @@ -1,80 +0,0 @@ -package one.mixin.android.db.datasource; - -import android.annotation.SuppressLint; -import android.database.Cursor; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.annotation.RestrictTo; -import androidx.paging.PositionalDataSource; -import androidx.room3.RoomDatabase; - -import java.util.List; - -import timber.log.Timber; - -@SuppressLint("RestrictedApi") -@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) -public abstract class NoCountLimitOffsetDataSource extends PositionalDataSource { - private final RoomQuery mSourceQuery; - private final int mTotalCount; - private final RoomDatabase mDb; - - protected NoCountLimitOffsetDataSource(RoomDatabase db, RoomQuery query, int count, String... tables) { - mDb = db; - mTotalCount = count; - mSourceQuery = query; - RoomDatabaseCompat.observeInvalidation(db, this, tables); - } - - @Override - public boolean isInvalid() { - return super.isInvalid(); - } - - @SuppressWarnings("WeakerAccess") - protected abstract List convertRows(Cursor cursor); - - @Override - public void loadInitial(@NonNull LoadInitialParams params, - @NonNull LoadInitialCallback callback) { - final int firstLoadPosition = computeInitialLoadPosition(params, mTotalCount); - final int firstLoadSize = computeInitialLoadSize(params, firstLoadPosition, mTotalCount); - List initialList = loadRange(firstLoadPosition, firstLoadSize); - if (initialList != null) { - try { - callback.onResult(initialList, firstLoadPosition, mTotalCount); - } catch (IllegalArgumentException e) { - // workaround with paging initial load size NOT to be a multiple of page size - Timber.w(e); - try { - callback.onResult(initialList, firstLoadPosition, firstLoadPosition + initialList.size()); - } catch (IllegalArgumentException iae) { - // workaround with paging incorrect tiling - Timber.w(iae); - } - } - } else { - // null list, or size doesn't match request - DB modified between count and load - invalidate(); - } - } - - @Override - public void loadRange(@NonNull LoadRangeParams params, - @NonNull LoadRangeCallback callback) { - callback.onResult(loadRange(params.startPosition, params.loadSize)); - } - - @Nullable - public List loadRange(int startPosition, int loadCount) { - final RoomQuery sqLiteQuery = mSourceQuery.withLimitOffset(loadCount, startPosition); - Cursor cursor = RoomDatabaseCompat.query(mDb, sqLiteQuery); - //noinspection TryFinallyCanBeTryWithResources - try { - return convertRows(cursor); - } finally { - cursor.close(); - } - } -} diff --git a/app/src/main/java/one/mixin/android/db/datasource/RoomDatabaseCompat.kt b/app/src/main/java/one/mixin/android/db/datasource/RoomDatabaseCompat.kt index 8bff223af3..c3fb128d6a 100644 --- a/app/src/main/java/one/mixin/android/db/datasource/RoomDatabaseCompat.kt +++ b/app/src/main/java/one/mixin/android/db/datasource/RoomDatabaseCompat.kt @@ -2,7 +2,6 @@ package one.mixin.android.db.datasource import android.database.Cursor import android.os.CancellationSignal -import androidx.paging.DataSource import androidx.paging.PagingSource import androidx.room3.PooledConnection import androidx.room3.RoomDatabase @@ -100,16 +99,6 @@ object RoomDatabaseCompat { } } - @JvmStatic - fun observeInvalidation( - db: RoomDatabase, - dataSource: DataSource<*, *>, - vararg tables: String, - ) { - val job = observeInvalidationForTables(db.getCoroutineScope(), db, tables) { dataSource.invalidate() } - dataSource.addInvalidatedCallback { job.cancel() } - } - @JvmStatic fun observeInvalidation( db: RoomDatabase, diff --git a/app/src/main/java/one/mixin/android/db/provider/DataProvider.kt b/app/src/main/java/one/mixin/android/db/provider/DataProvider.kt index 88a71c3989..fc977f43c6 100644 --- a/app/src/main/java/one/mixin/android/db/provider/DataProvider.kt +++ b/app/src/main/java/one/mixin/android/db/provider/DataProvider.kt @@ -2,7 +2,7 @@ package one.mixin.android.db.provider import android.annotation.SuppressLint import android.os.CancellationSignal -import androidx.paging.DataSource +import androidx.paging.PagingSource import kotlinx.coroutines.withContext import one.mixin.android.db.MixinDatabase import one.mixin.android.db.datasource.RoomDatabaseCompat @@ -23,13 +23,13 @@ import one.mixin.android.vo.safe.TokenItem @SuppressLint("RestrictedApi") class DataProvider { companion object { - fun observeConversations(database: MixinDatabase): DataSource.Factory = + fun observeConversations(database: MixinDatabase): PagingSource = DataProviderGenerated.observeConversations(database) fun observeConversationsByCircleId( circleId: String, database: MixinDatabase, - ): DataSource.Factory = + ): PagingSource = DataProviderGenerated.observeConversationsByCircleId(circleId, database) suspend fun fuzzySearchToken( @@ -110,18 +110,14 @@ class DataProvider { conversationId: String, database: MixinDatabase, cancellationSignal: CancellationSignal, - ) = - object : DataSource.Factory() { - override fun create(): DataSource { - return FtsDataSource(ftsDatabase, database, query, conversationId, cancellationSignal) - } - } + ): PagingSource = + FtsDataSource(ftsDatabase, database, query, conversationId, cancellationSignal) fun getPinMessages( database: MixinDatabase, conversationId: String, count: Int, - ): DataSource.Factory = + ): PagingSource = DataProviderGenerated.getPinMessages(database, conversationId, count) } } diff --git a/app/src/main/java/one/mixin/android/db/provider/DataProviderQuerySpec.kt b/app/src/main/java/one/mixin/android/db/provider/DataProviderQuerySpec.kt index 2d262a7ed9..173a355c0d 100644 --- a/app/src/main/java/one/mixin/android/db/provider/DataProviderQuerySpec.kt +++ b/app/src/main/java/one/mixin/android/db/provider/DataProviderQuerySpec.kt @@ -1,14 +1,14 @@ package one.mixin.android.db.provider import android.os.CancellationSignal -import androidx.paging.DataSource +import androidx.paging.PagingSource +import one.mixin.android.codegen.annotation.GeneratedLimitOffsetPagingSourceQuery +import one.mixin.android.codegen.annotation.GeneratedNoCountPagingSourceQuery import one.mixin.android.db.ConversationDao import one.mixin.android.db.MixinDatabase import one.mixin.android.db.TokenDao.Companion.PREFIX_ASSET_ITEM import one.mixin.android.codegen.annotation.GeneratedQuery import one.mixin.android.codegen.annotation.GeneratedQueryProvider -import one.mixin.android.codegen.annotation.GeneratedLimitOffsetDataSourceQuery -import one.mixin.android.codegen.annotation.GeneratedNoCountDataSourceQuery import one.mixin.android.codegen.annotation.GeneratedRawCursorQuery import one.mixin.android.vo.ChatHistoryMessageItem import one.mixin.android.vo.ChatMinimal @@ -215,16 +215,16 @@ private const val PIN_MESSAGES_SQL = @GeneratedQueryProvider(generatedName = "DataProviderGenerated") interface DataProviderQuerySpec { - @GeneratedLimitOffsetDataSourceQuery( + @GeneratedLimitOffsetPagingSourceQuery( countSql = OBSERVE_CONVERSATIONS_COUNT_SQL, offsetSql = OBSERVE_CONVERSATIONS_OFFSET_SQL, querySql = OBSERVE_CONVERSATIONS_QUERY_SQL, tables = ["message_mentions", "conversations", "users"], converter = "convertToConversationItems", ) - fun observeConversations(database: MixinDatabase): DataSource.Factory + fun observeConversations(database: MixinDatabase): PagingSource - @GeneratedLimitOffsetDataSourceQuery( + @GeneratedLimitOffsetPagingSourceQuery( countSql = OBSERVE_CONVERSATIONS_BY_CIRCLE_COUNT_SQL, offsetSql = OBSERVE_CONVERSATIONS_BY_CIRCLE_OFFSET_SQL, querySql = OBSERVE_CONVERSATIONS_BY_CIRCLE_QUERY_SQL, @@ -234,9 +234,9 @@ interface DataProviderQuerySpec { fun observeConversationsByCircleId( circleId: String, database: MixinDatabase, - ): DataSource.Factory + ): PagingSource - @GeneratedNoCountDataSourceQuery( + @GeneratedNoCountPagingSourceQuery( sql = PIN_MESSAGES_SQL, binds = ["conversationId"], count = "count", @@ -247,7 +247,7 @@ interface DataProviderQuerySpec { database: MixinDatabase, conversationId: String, count: Int, - ): DataSource.Factory + ): PagingSource @GeneratedQuery( sql = FUZZY_SEARCH_TOKEN_SQL, diff --git a/app/src/main/java/one/mixin/android/fts/FtsDataSource.kt b/app/src/main/java/one/mixin/android/fts/FtsDataSource.kt index 95be3a6c71..4c2ebecffb 100644 --- a/app/src/main/java/one/mixin/android/fts/FtsDataSource.kt +++ b/app/src/main/java/one/mixin/android/fts/FtsDataSource.kt @@ -1,113 +1,67 @@ package one.mixin.android.fts import android.os.CancellationSignal -import android.util.ArrayMap import androidx.core.database.getStringOrNull -import androidx.paging.ItemKeyedDataSource +import androidx.paging.PagingSource +import androidx.paging.PagingState import one.mixin.android.db.MixinDatabase +import one.mixin.android.db.datasource.RoomDatabaseCompat import one.mixin.android.db.datasource.query import one.mixin.android.vo.SearchMessageDetailItem +import kotlinx.coroutines.withContext import timber.log.Timber class FtsDataSource( - val ftsDatabase: FtsDatabase, - val mixinDatabase: MixinDatabase, - val query: String, - val conversationId: String, - val cancellationSignal: CancellationSignal, -) : - ItemKeyedDataSource() { - override fun loadInitial( - params: LoadInitialParams, - callback: LoadInitialCallback, - ) { - callback.onResult(getData(params.requestedLoadSize, -1, false)) - } - - override fun loadAfter( - params: LoadParams, - callback: LoadCallback, - ) { - callback.onResult(getData(params.requestedLoadSize, params.key)) - } - - override fun loadBefore( - params: LoadParams, - callback: LoadCallback, - ) { - callback.onResult(getData(params.requestedLoadSize, params.key, true)) - } - - override fun getKey(item: SearchMessageDetailItem): Int { - return fastKeyMap.values.indexOf(item.messageId) - } - - private fun getData( - size: Int, - key: Int, - reverse: Boolean = false, - ): List { - if (reverse) { - if (key > 1) { - repeat(key - 1) { - val ids = mutableListOf() - repeat(size) { - fastKeyMap[key - 1 - it]?.let { it1 -> ids.add(it1) } - } - return getData(ids.reversed()) - } - } else { - return emptyList() - } - } else if (fastKeyMap[key + size + 1] != null) { - val ids = mutableListOf() - repeat(size) { - fastKeyMap[key + 1 + it]?.let { it1 -> ids.add(it1) } + private val ftsDatabase: FtsDatabase, + private val mixinDatabase: MixinDatabase, + private val query: String, + private val conversationId: String, + private val cancellationSignal: CancellationSignal, +) : PagingSource() { + override suspend fun load(params: LoadParams): LoadResult { + return try { + withContext(RoomDatabaseCompat.queryContext(mixinDatabase)) { + val offset = params.key ?: 0 + val loadSize = params.loadSize + val ids = messageIds(loadSize, offset) + val data = getData(ids) + LoadResult.Page( + data = data, + prevKey = if (offset == 0) null else maxOf(0, offset - loadSize), + nextKey = if (data.size < loadSize) null else offset + data.size, + ) } - return getData(ids) + } catch (e: Exception) { + Timber.e(e) + LoadResult.Error(e) } - - return getNewData(size, key + 1) } - private val newFtsCursor by lazy { - ftsDatabase.query( - FtsQueryGenerated.messageIdsByConversation(conversationId, query), - cancellationSignal, - ) + override fun getRefreshKey(state: PagingState): Int? { + val anchorPosition = state.anchorPosition ?: return null + return state.closestPageToPosition(anchorPosition)?.prevKey + ?: state.closestPageToPosition(anchorPosition)?.nextKey?.minus(state.config.pageSize) } - private fun getNewData( + private fun messageIds( size: Int, - startKey: Int, - ): List { - val ids = mutableListOf() - var index = 0 - return try { - while (newFtsCursor.moveToNext() && index < size) { - val messageId = newFtsCursor.getStringOrNull(0) ?: continue - ids.add(messageId) - index++ + offset: Int, + ): List { + return ftsDatabase.query( + FtsQueryGenerated.messageIdsByConversationPage(conversationId, query, size, offset), + cancellationSignal, + ).use { cursor -> + val ids = mutableListOf() + while (cursor.moveToNext()) { + cursor.getStringOrNull(0)?.let(ids::add) } - getData(ids, startKey) - } catch (e: Exception) { - Timber.e(e) - emptyList() + ids } } private fun getData( ids: List, - startKey: Int? = null, ): List { - val result = mixinDatabase.messageDao().getSearchMessageDetailItemsByIds(ids) - if (startKey != null) { - result.forEachIndexed { itemIndex, item -> - fastKeyMap[itemIndex + startKey] = item.messageId - } - } - return result + return mixinDatabase.messageDao().getSearchMessageDetailItemsByIds(ids) } - - private val fastKeyMap = ArrayMap() // Cache id and index } diff --git a/app/src/main/java/one/mixin/android/fts/FtsQuerySpec.kt b/app/src/main/java/one/mixin/android/fts/FtsQuerySpec.kt index a0206eceec..9886b5bcb1 100644 --- a/app/src/main/java/one/mixin/android/fts/FtsQuerySpec.kt +++ b/app/src/main/java/one/mixin/android/fts/FtsQuerySpec.kt @@ -31,4 +31,21 @@ interface FtsQuerySpec { conversationId: String, query: String, ): RoomRawQuery + + @GeneratedRoomRawQuery( + sql = """ + SELECT message_id + FROM messages_metas + WHERE conversation_id = '{{conversationId}}' + AND doc_id IN (SELECT docid FROM messages_fts WHERE content MATCH '{{query}}') + ORDER BY created_at DESC, rowid DESC + LIMIT {{limit}} OFFSET {{offset}} + """, + ) + fun messageIdsByConversationPage( + conversationId: String, + query: String, + limit: Int, + offset: Int, + ): RoomRawQuery } diff --git a/app/src/main/java/one/mixin/android/repository/ConversationRepository.kt b/app/src/main/java/one/mixin/android/repository/ConversationRepository.kt index 8fa0e93f52..e5b75d8b57 100644 --- a/app/src/main/java/one/mixin/android/repository/ConversationRepository.kt +++ b/app/src/main/java/one/mixin/android/repository/ConversationRepository.kt @@ -3,9 +3,7 @@ package one.mixin.android.repository import android.os.CancellationSignal import androidx.lifecycle.LiveData import androidx.lifecycle.map -import androidx.paging.DataSource -import androidx.paging.LivePagedListBuilder -import androidx.paging.PagedList +import androidx.paging.PagingSource import io.reactivex.Observable import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext @@ -50,7 +48,6 @@ import one.mixin.android.job.MixinJobManager import one.mixin.android.job.RefreshConversationJob import one.mixin.android.job.RefreshUserJob import one.mixin.android.session.Session -import one.mixin.android.ui.media.pager.MediaPagerActivity import one.mixin.android.util.SINGLE_DB_THREAD import one.mixin.android.vo.ChatMinimal import one.mixin.android.vo.CircleConversation @@ -108,7 +105,7 @@ class ConversationRepository limit: Int, ): List = messageDao.getChatMessages(conversationId, offset, limit) - fun observeConversations(circleId: String?): DataSource.Factory = + fun observeConversations(circleId: String?): PagingSource = if (circleId.isNullOrBlank()) { DataProvider.observeConversations(MixinDatabase.getDatabase(MixinApplication.appContext, identityNumber())) } else { @@ -179,7 +176,7 @@ class ConversationRepository query: String, conversationId: String, cancellationSignal: CancellationSignal, - ): DataSource.Factory { + ): PagingSource { val queryString = query.joinStar().replaceQuotationMark() return DataProvider.fuzzySearchMessageDetail(ftsDbHelper, queryString, conversationId, appDatabase, cancellationSignal) } @@ -214,10 +211,10 @@ class ConversationRepository messageDao.countIndexMediaMessages(conversationId) } - fun getMediaMessagesDataSource( + fun getMediaMessagesPagingSource( conversationId: String, excludeLive: Boolean, - ): DataSource.Factory { + ): PagingSource { return if (excludeLive) { messageDao.getMediaMessagesExcludeLive(conversationId) } else { @@ -225,28 +222,6 @@ class ConversationRepository } } - fun getMediaMessages( - conversationId: String, - index: Int, - excludeLive: Boolean, - ): LiveData> { - val dataSource = - if (excludeLive) { - messageDao.getMediaMessagesExcludeLive(conversationId) - } else { - messageDao.getMediaMessages(conversationId) - } - val config = - PagedList.Config.Builder() - .setPrefetchDistance(MediaPagerActivity.PAGE_SIZE) - .setPageSize(MediaPagerActivity.PAGE_SIZE) - .setEnablePlaceholders(true) - .build() - return LivePagedListBuilder(dataSource, config) - .setInitialLoadKey(index) - .build() - } - suspend fun getMediaMessage( conversationId: String, messageId: String, @@ -744,7 +719,7 @@ class ConversationRepository suspend fun exists(messageId: String) = messageDao.exists(messageId) - fun findAudiosByConversationId(conversationId: String): DataSource.Factory = + fun findAudiosByConversationId(conversationId: String): PagingSource = messageDao.findAudiosByConversationId(conversationId) suspend fun indexAudioByConversationId( diff --git a/app/src/main/java/one/mixin/android/ui/common/recyclerview/PagedHeaderAdapter.kt b/app/src/main/java/one/mixin/android/ui/common/recyclerview/PagedHeaderAdapter.kt deleted file mode 100644 index 10c1756cf5..0000000000 --- a/app/src/main/java/one/mixin/android/ui/common/recyclerview/PagedHeaderAdapter.kt +++ /dev/null @@ -1,103 +0,0 @@ -package one.mixin.android.ui.common.recyclerview - -import android.annotation.SuppressLint -import android.content.Context -import android.view.View -import android.view.ViewGroup -import androidx.recyclerview.widget.DiffUtil -import androidx.recyclerview.widget.RecyclerView - -abstract class PagedHeaderAdapter(diffCallback: DiffUtil.ItemCallback) : - SafePagedListAdapter(diffCallback) { - companion object { - const val TYPE_HEADER = 0 - const val TYPE_NORMAL = 1 - } - - var headerView: View? = null - - private var showHeader: Boolean = false - - var onItemListener: OnItemListener? = null - - override fun getItemViewType(position: Int): Int { - return if (position == TYPE_HEADER && isShowHeader()) { - TYPE_HEADER - } else { - TYPE_NORMAL - } - } - - override fun getItemCount() = - if (isShowHeader()) super.getItemCount() + 1 else super.getItemCount() - - protected fun getPos(position: Int): Int { - var pos = - if (isShowHeader()) { - position - 1 - } else { - position - } - if (pos < 0) { - pos = 0 - } - return pos - } - - protected fun isShowHeader() = headerView != null && showHeader - - @SuppressLint("NotifyDataSetChanged") - fun setShowHeader( - show: Boolean, - rv: RecyclerView, - ) { - if (show != showHeader) { - showHeader = show - rv.swapAdapter(this, false) - notifyDataSetChanged() - } - } - - private var headerObserver: PagedHeaderAdapterDataObserver? = null - - override fun registerAdapterDataObserver(observer: RecyclerView.AdapterDataObserver) { - headerObserver = PagedHeaderAdapterDataObserver(observer, if (isShowHeader()) 1 else 0) - super.registerAdapterDataObserver(headerObserver!!) - } - - override fun unregisterAdapterDataObserver(observer: RecyclerView.AdapterDataObserver) { - super.unregisterAdapterDataObserver(headerObserver!!) - } - - @Suppress("UNCHECKED_CAST") - override fun onCreateViewHolder( - parent: ViewGroup, - viewType: Int, - ): RecyclerView.ViewHolder { - return ( - if (viewType == TYPE_HEADER) { - getHeaderViewHolder(parent.context, parent) - } else { - getNormalViewHolder(parent.context, parent) - } - ) - } - - open fun getHeaderViewHolder( - context: Context, - parent: ViewGroup, - ) = HeadHolder(headerView!!) - - abstract fun getNormalViewHolder( - context: Context, - parent: ViewGroup, - ): NormalHolder - - open class HeadHolder(itemView: View) : RecyclerView.ViewHolder(itemView) - - interface OnItemListener { - fun onNormalItemClick(item: T) - - fun onNormalLongClick(item: T): Boolean - } -} diff --git a/app/src/main/java/one/mixin/android/ui/common/recyclerview/PagingHeaderAdapter.kt b/app/src/main/java/one/mixin/android/ui/common/recyclerview/PagingHeaderAdapter.kt index 46e6c9a53f..0c90680bf4 100644 --- a/app/src/main/java/one/mixin/android/ui/common/recyclerview/PagingHeaderAdapter.kt +++ b/app/src/main/java/one/mixin/android/ui/common/recyclerview/PagingHeaderAdapter.kt @@ -60,10 +60,10 @@ abstract class PagingHeaderAdapter(diffCallback: DiffUtil.ItemCallback< } } - private var headerObserver: PagedHeaderAdapterDataObserver? = null + private var headerObserver: PagingHeaderAdapterDataObserver? = null override fun registerAdapterDataObserver(observer: RecyclerView.AdapterDataObserver) { - headerObserver = PagedHeaderAdapterDataObserver(observer, if (isShowHeader()) 1 else 0) + headerObserver = PagingHeaderAdapterDataObserver(observer, if (isShowHeader()) 1 else 0) try { super.registerAdapterDataObserver(headerObserver!!) } catch (e: Exception) { diff --git a/app/src/main/java/one/mixin/android/ui/common/recyclerview/PagedHeaderAdapterDataObserver.kt b/app/src/main/java/one/mixin/android/ui/common/recyclerview/PagingHeaderAdapterDataObserver.kt similarity index 92% rename from app/src/main/java/one/mixin/android/ui/common/recyclerview/PagedHeaderAdapterDataObserver.kt rename to app/src/main/java/one/mixin/android/ui/common/recyclerview/PagingHeaderAdapterDataObserver.kt index ea4d75aa07..4e8d35055a 100644 --- a/app/src/main/java/one/mixin/android/ui/common/recyclerview/PagedHeaderAdapterDataObserver.kt +++ b/app/src/main/java/one/mixin/android/ui/common/recyclerview/PagingHeaderAdapterDataObserver.kt @@ -2,10 +2,7 @@ package one.mixin.android.ui.common.recyclerview import androidx.recyclerview.widget.RecyclerView -/** - * Fix PagedListAdapter with header auto scroll bug. - */ -class PagedHeaderAdapterDataObserver( +class PagingHeaderAdapterDataObserver( private val dataObserver: RecyclerView.AdapterDataObserver, private val headerCount: Int, ) : RecyclerView.AdapterDataObserver() { diff --git a/app/src/main/java/one/mixin/android/ui/common/recyclerview/SafePagedListAdapter.kt b/app/src/main/java/one/mixin/android/ui/common/recyclerview/SafePagedListAdapter.kt deleted file mode 100644 index 03420ed480..0000000000 --- a/app/src/main/java/one/mixin/android/ui/common/recyclerview/SafePagedListAdapter.kt +++ /dev/null @@ -1,68 +0,0 @@ -package one.mixin.android.ui.common.recyclerview - -import android.annotation.SuppressLint -import android.os.Build -import android.os.Handler -import android.os.Looper -import androidx.paging.AsyncPagedListDiffer -import androidx.paging.PagedListAdapter -import androidx.recyclerview.widget.DiffUtil -import androidx.recyclerview.widget.RecyclerView -import java.lang.reflect.InvocationTargetException -import java.util.concurrent.Executor - -abstract class SafePagedListAdapter( - diffCallback: DiffUtil.ItemCallback, -) : PagedListAdapter(diffCallback) { - init { - try { - val mDiffer = PagedListAdapter::class.java.getDeclaredField("mDiffer") - val executor = AsyncPagedListDiffer::class.java.getDeclaredField("mMainThreadExecutor") - mDiffer.isAccessible = true - executor.isAccessible = true - - val myDiffer = mDiffer.get(this) as AsyncPagedListDiffer<*> - val foreGround = - object : Executor { - val mHandler = createAsync(Looper.getMainLooper()) - - override fun execute(command: Runnable?) { - try { - mHandler.post { - try { - command?.run() - } catch (ignored: Exception) { - } - } - } catch (ignored: Exception) { - } - } - } - - executor.set(myDiffer, foreGround) - } catch (ignored: Exception) { - } - } - - @SuppressLint("ObsoleteSdkInt") - private fun createAsync(looper: Looper): Handler { - if (Build.VERSION.SDK_INT >= 28) { - return Handler.createAsync(looper) - } - if (Build.VERSION.SDK_INT >= 16) { - try { - return Handler::class.java.getDeclaredConstructor( - Looper::class.java, - Handler.Callback::class.java, - Boolean::class.javaPrimitiveType, - ).newInstance(looper, null, true) - } catch (ignored: IllegalAccessException) { - } catch (ignored: InstantiationException) { - } catch (ignored: NoSuchMethodException) { - } catch (e: InvocationTargetException) { - return Handler(looper) - } - } - return Handler(looper) - } -} diff --git a/app/src/main/java/one/mixin/android/ui/common/recyclerview/SafePagingDataAdapter.kt b/app/src/main/java/one/mixin/android/ui/common/recyclerview/SafePagingDataAdapter.kt new file mode 100644 index 0000000000..60b8d1707a --- /dev/null +++ b/app/src/main/java/one/mixin/android/ui/common/recyclerview/SafePagingDataAdapter.kt @@ -0,0 +1,9 @@ +package one.mixin.android.ui.common.recyclerview + +import androidx.paging.PagingDataAdapter +import androidx.recyclerview.widget.DiffUtil +import androidx.recyclerview.widget.RecyclerView + +abstract class SafePagingDataAdapter( + diffCallback: DiffUtil.ItemCallback, +) : PagingDataAdapter(diffCallback) diff --git a/app/src/main/java/one/mixin/android/ui/conversation/chathistory/ChatHistoryActivity.kt b/app/src/main/java/one/mixin/android/ui/conversation/chathistory/ChatHistoryActivity.kt index d8daa28f67..cd35525624 100644 --- a/app/src/main/java/one/mixin/android/ui/conversation/chathistory/ChatHistoryActivity.kt +++ b/app/src/main/java/one/mixin/android/ui/conversation/chathistory/ChatHistoryActivity.kt @@ -15,12 +15,14 @@ import androidx.appcompat.widget.PopupMenu import androidx.core.view.children import androidx.core.view.isVisible import androidx.lifecycle.LiveData +import androidx.lifecycle.asLiveData import androidx.lifecycle.lifecycleScope import androidx.media3.common.MimeTypes import androidx.media3.common.util.UnstableApi -import androidx.paging.DataSource -import androidx.paging.LivePagedListBuilder -import androidx.paging.PagedList +import androidx.paging.Pager +import androidx.paging.PagingConfig +import androidx.paging.PagingData +import androidx.paging.PagingSource import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.uber.autodispose.autoDispose @@ -181,12 +183,12 @@ class ChatHistoryActivity : BaseActivity() { binding.recyclerView.adapter = chatHistoryAdapter if (isTranscript) { binding.unpinTv.isVisible = false - buildLivePagedList(conversationRepository.findTranscriptMessageItemById(transcriptId)) + buildPagingData { conversationRepository.findTranscriptMessageItemById(transcriptId) } .observe(this) { transcripts -> binding.titleView.rightIb.setOnClickListener { showBottomSheet() } - chatHistoryAdapter.submitList(transcripts) + chatHistoryAdapter.submitData(this@ChatHistoryActivity.lifecycle, transcripts) } binding.titleView.rightAnimator.isVisible = true binding.titleView.rightIb.setImageResource(R.drawable.ic_more) @@ -234,9 +236,9 @@ class ChatHistoryActivity : BaseActivity() { this@ChatHistoryActivity.resources.getQuantityString(R.plurals.pinned_message_title, count, count), "", ) - buildLivePagedList(conversationRepository.getPinMessages(conversationId, count)) + buildPagingData { conversationRepository.getPinMessages(conversationId, count) } .observe(this) { list -> - chatHistoryAdapter.submitList(list) + chatHistoryAdapter.submitData(this@ChatHistoryActivity.lifecycle, list) } } } @@ -254,18 +256,16 @@ class ChatHistoryActivity : BaseActivity() { AudioPlayer.pause() } - private fun buildLivePagedList(dataSource: DataSource.Factory): LiveData> { - val pagedListConfig = - PagedList.Config.Builder() - .setPrefetchDistance(10 * 2) - .setPageSize(10) - .setEnablePlaceholders(true) - .build() - return LivePagedListBuilder( - dataSource, - pagedListConfig, - ).build() - } + private fun buildPagingData(pagingSourceFactory: () -> PagingSource): LiveData> = + Pager( + config = + PagingConfig( + pageSize = 10, + prefetchDistance = 10 * 2, + enablePlaceholders = true, + ), + pagingSourceFactory = pagingSourceFactory, + ).flow.asLiveData() private val chatHistoryAdapter by lazy { ChatHistoryAdapter(onItemListener, this) diff --git a/app/src/main/java/one/mixin/android/ui/conversation/chathistory/ChatHistoryAdapter.kt b/app/src/main/java/one/mixin/android/ui/conversation/chathistory/ChatHistoryAdapter.kt index 9364d0cbee..089ea81ca2 100644 --- a/app/src/main/java/one/mixin/android/ui/conversation/chathistory/ChatHistoryAdapter.kt +++ b/app/src/main/java/one/mixin/android/ui/conversation/chathistory/ChatHistoryAdapter.kt @@ -31,7 +31,7 @@ import one.mixin.android.databinding.ItemChatVideoQuoteBinding import one.mixin.android.extension.hashForDate import one.mixin.android.extension.isSameDay import one.mixin.android.extension.notNullWithElse -import one.mixin.android.ui.common.recyclerview.SafePagedListAdapter +import one.mixin.android.ui.common.recyclerview.SafePagingDataAdapter import one.mixin.android.ui.conversation.chathistory.holder.ActionCardHolder import one.mixin.android.ui.conversation.chathistory.holder.ActionHolder import one.mixin.android.ui.conversation.chathistory.holder.AudioHolder @@ -79,7 +79,7 @@ import kotlin.math.abs class ChatHistoryAdapter( private val onItemListener: OnItemListener, private val context: Activity, -) : SafePagedListAdapter(ChatHistoryMessageItem.DIFF_CALLBACK), +) : SafePagingDataAdapter(ChatHistoryMessageItem.DIFF_CALLBACK), MixinStickyRecyclerHeadersAdapter { override fun onCreateViewHolder( parent: ViewGroup, diff --git a/app/src/main/java/one/mixin/android/ui/home/ConversationListFragment.kt b/app/src/main/java/one/mixin/android/ui/home/ConversationListFragment.kt index ef89caeffd..272edbbd8e 100644 --- a/app/src/main/java/one/mixin/android/ui/home/ConversationListFragment.kt +++ b/app/src/main/java/one/mixin/android/ui/home/ConversationListFragment.kt @@ -20,10 +20,13 @@ import androidx.core.view.isGone import androidx.core.view.isVisible import androidx.core.view.updateLayoutParams import androidx.fragment.app.viewModels +import androidx.lifecycle.Lifecycle import androidx.lifecycle.LiveData import androidx.lifecycle.Observer import androidx.lifecycle.lifecycleScope -import androidx.paging.PagedList +import androidx.lifecycle.repeatOnLifecycle +import androidx.paging.LoadState +import androidx.paging.PagingData import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.uber.autodispose.autoDispose @@ -32,6 +35,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers import kotlinx.coroutines.CoroutineExceptionHandler import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job +import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.launch import one.mixin.android.Constants.CIRCLE.CIRCLE_ID import one.mixin.android.Constants.CIRCLE.CIRCLE_NAME @@ -72,7 +76,7 @@ import one.mixin.android.ui.common.NavigationController import one.mixin.android.ui.common.VerifyFragment import one.mixin.android.ui.common.editDialog import one.mixin.android.ui.common.recyclerview.NormalHolder -import one.mixin.android.ui.common.recyclerview.PagedHeaderAdapter +import one.mixin.android.ui.common.recyclerview.PagingHeaderAdapter import one.mixin.android.ui.conversation.ConversationActivity import one.mixin.android.ui.home.circle.CirclesFragment import one.mixin.android.ui.home.reminder.RecoveryReminderBottomSheetDialogFragment @@ -211,6 +215,7 @@ class ConversationListFragment : LinkFragment() { super.onViewCreated(view, savedInstanceState) navigationController = NavigationController() binding.messageRv.adapter = messageAdapter + observeMessageAdapterLoadState() binding.messageRv.itemAnimator = null binding.messageRv.setHasFixedSize(true) binding.messageRv.addOnScrollListener( @@ -291,7 +296,7 @@ class ConversationListFragment : LinkFragment() { } messageAdapter.onItemListener = - object : PagedHeaderAdapter.OnItemListener { + object : PagingHeaderAdapter.OnItemListener { override fun onNormalLongClick(item: ConversationItem): Boolean { showBottomSheet(item) return true @@ -594,43 +599,64 @@ class ConversationListFragment : LinkFragment() { } private val observer by lazy { - Observer> { pagedList -> - messageAdapter.submitList(pagedList) - if (pagedList.isEmpty()) { - if (circleId == null) { - binding.emptyView.infoTv.setText(R.string.chat_list_empty_info) - binding.emptyView.startBn.setText(R.string.Start_Messaging) - } else { - binding.emptyView.infoTv.setText(R.string.circle_no_conversation_hint) - binding.emptyView.startBn.setText(R.string.Add_conversations) - } - binding.messageRv.updateLayoutParams { - height = ViewGroup.LayoutParams.WRAP_CONTENT - bottomToBottom = ConstraintLayout.LayoutParams.UNSET + Observer> { pagingData -> + messageAdapter.submitData(viewLifecycleOwner.lifecycle, pagingData) + } + } + + private fun observeMessageAdapterLoadState() { + viewLifecycleOwner.lifecycleScope.launch { + viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) { + messageAdapter.loadStateFlow.collectLatest { loadStates -> + val items = messageAdapter.snapshot().items + if (loadStates.refresh is LoadState.NotLoading) { + updateEmptyState(items.isEmpty()) + enqueueMissingAvatars(items) + } } - binding.emptyView.root.isVisible = true + } + } + } + + private fun updateEmptyState(empty: Boolean) { + if (viewDestroyed()) return + if (empty) { + if (circleId == null) { + binding.emptyView.infoTv.setText(R.string.chat_list_empty_info) + binding.emptyView.startBn.setText(R.string.Start_Messaging) } else { - binding.messageRv.updateLayoutParams { - height = 0 - bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID - } - binding.emptyView.root.isVisible = false - pagedList - .filter { item: ConversationItem? -> - item?.isGroupConversation() == true && ( - item.iconUrl() == null || - !File( - item.iconUrl() ?: "", - ).exists() - ) - }.forEach { - jobManager.addJobInBackground(GenerateAvatarJob(it.conversationId)) - } + binding.emptyView.infoTv.setText(R.string.circle_no_conversation_hint) + binding.emptyView.startBn.setText(R.string.Add_conversations) + } + binding.messageRv.updateLayoutParams { + height = ViewGroup.LayoutParams.WRAP_CONTENT + bottomToBottom = ConstraintLayout.LayoutParams.UNSET } + binding.emptyView.root.isVisible = true + } else { + binding.messageRv.updateLayoutParams { + height = 0 + bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID + } + binding.emptyView.root.isVisible = false } } - private var conversationLiveData: LiveData>? = null + private fun enqueueMissingAvatars(items: List) { + items + .filter { item -> + item.isGroupConversation() && ( + item.iconUrl() == null || + !File( + item.iconUrl() ?: "", + ).exists() + ) + }.forEach { + jobManager.addJobInBackground(GenerateAvatarJob(it.conversationId)) + } + } + + private var conversationLiveData: LiveData>? = null var circleId: String? = null set(value) { field = value @@ -807,7 +833,7 @@ class ConversationListFragment : LinkFragment() { } } - class MessageAdapter : PagedHeaderAdapter(ConversationItem.DIFF_CALLBACK) { + class MessageAdapter : PagingHeaderAdapter(ConversationItem.DIFF_CALLBACK) { override fun getNormalViewHolder( context: Context, parent: ViewGroup, @@ -841,7 +867,7 @@ class ConversationListFragment : LinkFragment() { @SuppressLint("SetTextI18n") fun bind( - onItemClickListener: PagedHeaderAdapter.OnItemListener?, + onItemClickListener: PagingHeaderAdapter.OnItemListener?, conversationItem: ConversationItem, ) { val id = Session.getAccountId() diff --git a/app/src/main/java/one/mixin/android/ui/home/ConversationListViewModel.kt b/app/src/main/java/one/mixin/android/ui/home/ConversationListViewModel.kt index f718319d8c..ef1b6618e1 100644 --- a/app/src/main/java/one/mixin/android/ui/home/ConversationListViewModel.kt +++ b/app/src/main/java/one/mixin/android/ui/home/ConversationListViewModel.kt @@ -2,8 +2,12 @@ package one.mixin.android.ui.home import androidx.lifecycle.LiveData import androidx.lifecycle.ViewModel -import androidx.paging.LivePagedListBuilder -import androidx.paging.PagedList +import androidx.lifecycle.asLiveData +import androidx.lifecycle.viewModelScope +import androidx.paging.Pager +import androidx.paging.PagingConfig +import androidx.paging.PagingData +import androidx.paging.cachedIn import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext @@ -50,16 +54,16 @@ class ConversationListViewModel private val jobManager: MixinJobManager, private val cleanMessageHelper: CleanMessageHelper, ) : ViewModel() { - fun observeConversations(circleId: String?): LiveData> { - return LivePagedListBuilder( - messageRepository.observeConversations(circleId), - PagedList.Config.Builder() - .setPrefetchDistance(CONVERSATION_PAGE_SIZE * 2) - .setPageSize(CONVERSATION_PAGE_SIZE) - .setEnablePlaceholders(true) - .build(), - ).build() - } + fun observeConversations(circleId: String?): LiveData> = + Pager( + config = + PagingConfig( + pageSize = CONVERSATION_PAGE_SIZE, + prefetchDistance = CONVERSATION_PAGE_SIZE * 2, + enablePlaceholders = true, + ), + pagingSourceFactory = { messageRepository.observeConversations(circleId) }, + ).flow.cachedIn(viewModelScope).asLiveData() suspend fun createGroupConversation(conversationId: String) { val c = messageRepository.getConversation(conversationId) diff --git a/app/src/main/java/one/mixin/android/ui/media/AudioFragment.kt b/app/src/main/java/one/mixin/android/ui/media/AudioFragment.kt index 3a691e6b38..aaf40ec6b3 100644 --- a/app/src/main/java/one/mixin/android/ui/media/AudioFragment.kt +++ b/app/src/main/java/one/mixin/android/ui/media/AudioFragment.kt @@ -4,9 +4,13 @@ import android.os.Bundle import android.view.View import android.widget.ViewAnimator import androidx.fragment.app.viewModels +import androidx.lifecycle.lifecycleScope +import androidx.paging.LoadState import androidx.recyclerview.widget.LinearLayoutManager import com.timehop.stickyheadersrecyclerview.StickyRecyclerHeadersDecoration import dagger.hilt.android.AndroidEntryPoint +import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.launch import one.mixin.android.Constants import one.mixin.android.R import one.mixin.android.databinding.LayoutRecyclerViewBinding @@ -78,15 +82,17 @@ class AudioFragment : BaseFragment(R.layout.layout_recycler_view) { binding.recyclerView.adapter = adapter binding.emptyIv.setImageResource(R.drawable.ic_empty_audio) binding.emptyTv.setText(R.string.NO_AUDIO) + viewLifecycleOwner.lifecycleScope.launch { + adapter.loadStateFlow.collectLatest { loadStates -> + if (loadStates.refresh is LoadState.NotLoading) { + (view as ViewAnimator).displayedChild = if (adapter.itemCount <= 0) 1 else 0 + } + } + } viewModel.getAudioMessages(conversationId).observe( viewLifecycleOwner, ) { - if (it.size <= 0) { - (view as ViewAnimator).displayedChild = 1 - } else { - (view as ViewAnimator).displayedChild = 0 - } - adapter.submitList(it) + adapter.submitData(viewLifecycleOwner.lifecycle, it) } } } diff --git a/app/src/main/java/one/mixin/android/ui/media/FileFragment.kt b/app/src/main/java/one/mixin/android/ui/media/FileFragment.kt index ef11d4a894..95ff665a6f 100644 --- a/app/src/main/java/one/mixin/android/ui/media/FileFragment.kt +++ b/app/src/main/java/one/mixin/android/ui/media/FileFragment.kt @@ -4,9 +4,13 @@ import android.os.Bundle import android.view.View import android.widget.ViewAnimator import androidx.fragment.app.viewModels +import androidx.lifecycle.lifecycleScope +import androidx.paging.LoadState import androidx.recyclerview.widget.LinearLayoutManager import com.timehop.stickyheadersrecyclerview.StickyRecyclerHeadersDecoration import dagger.hilt.android.AndroidEntryPoint +import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.launch import one.mixin.android.Constants import one.mixin.android.R import one.mixin.android.databinding.LayoutRecyclerViewBinding @@ -69,15 +73,17 @@ class FileFragment : BaseFragment(R.layout.layout_recycler_view) { binding.recyclerView.layoutManager = LinearLayoutManager(requireContext()) binding.recyclerView.addItemDecoration(StickyRecyclerHeadersDecoration(adapter)) binding.recyclerView.adapter = adapter + viewLifecycleOwner.lifecycleScope.launch { + adapter.loadStateFlow.collectLatest { loadStates -> + if (loadStates.refresh is LoadState.NotLoading) { + (view as ViewAnimator).displayedChild = if (adapter.itemCount <= 0) 1 else 0 + } + } + } viewModel.getFileMessages(conversationId).observe( viewLifecycleOwner, ) { - if (it.size <= 0) { - (view as ViewAnimator).displayedChild = 1 - } else { - (view as ViewAnimator).displayedChild = 0 - } - adapter.submitList(it) + adapter.submitData(viewLifecycleOwner.lifecycle, it) } } } diff --git a/app/src/main/java/one/mixin/android/ui/media/LinkAdapter.kt b/app/src/main/java/one/mixin/android/ui/media/LinkAdapter.kt index 1fc5d2778b..c13ed09631 100644 --- a/app/src/main/java/one/mixin/android/ui/media/LinkAdapter.kt +++ b/app/src/main/java/one/mixin/android/ui/media/LinkAdapter.kt @@ -15,13 +15,13 @@ import one.mixin.android.extension.dpToPx import one.mixin.android.extension.hashForDate import one.mixin.android.extension.inflate import one.mixin.android.ui.common.recyclerview.NormalHolder -import one.mixin.android.ui.common.recyclerview.SafePagedListAdapter +import one.mixin.android.ui.common.recyclerview.SafePagingDataAdapter import one.mixin.android.vo.HyperlinkItem import java.util.concurrent.TimeUnit import kotlin.math.abs class LinkAdapter(private val onClickListener: (url: String) -> Unit, private val onLongClickListener: (String) -> Unit) : - SafePagedListAdapter(HyperlinkItem.DIFF_CALLBACK), + SafePagingDataAdapter(HyperlinkItem.DIFF_CALLBACK), StickyRecyclerHeadersAdapter { override fun onCreateViewHolder( parent: ViewGroup, diff --git a/app/src/main/java/one/mixin/android/ui/media/LinkFragment.kt b/app/src/main/java/one/mixin/android/ui/media/LinkFragment.kt index d87081bf54..5c979c3e18 100644 --- a/app/src/main/java/one/mixin/android/ui/media/LinkFragment.kt +++ b/app/src/main/java/one/mixin/android/ui/media/LinkFragment.kt @@ -4,9 +4,13 @@ import android.os.Bundle import android.view.View import android.widget.ViewAnimator import androidx.fragment.app.viewModels +import androidx.lifecycle.lifecycleScope +import androidx.paging.LoadState import androidx.recyclerview.widget.LinearLayoutManager import com.timehop.stickyheadersrecyclerview.StickyRecyclerHeadersDecoration import dagger.hilt.android.AndroidEntryPoint +import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.launch import one.mixin.android.Constants import one.mixin.android.R import one.mixin.android.databinding.LayoutRecyclerViewBinding @@ -51,15 +55,17 @@ class LinkFragment : BaseFragment(R.layout.layout_recycler_view) { binding.recyclerView.layoutManager = LinearLayoutManager(requireContext()) binding.recyclerView.addItemDecoration(StickyRecyclerHeadersDecoration(adapter)) binding.recyclerView.adapter = adapter + viewLifecycleOwner.lifecycleScope.launch { + adapter.loadStateFlow.collectLatest { loadStates -> + if (loadStates.refresh is LoadState.NotLoading) { + (view as ViewAnimator).displayedChild = if (adapter.itemCount <= 0) 1 else 0 + } + } + } viewModel.getLinkMessages(conversationId).observe( viewLifecycleOwner, ) { - if (it.size <= 0) { - (view as ViewAnimator).displayedChild = 1 - } else { - (view as ViewAnimator).displayedChild = 0 - } - adapter.submitList(it) + adapter.submitData(viewLifecycleOwner.lifecycle, it) } } } diff --git a/app/src/main/java/one/mixin/android/ui/media/MediaFragment.kt b/app/src/main/java/one/mixin/android/ui/media/MediaFragment.kt index 5a6063dbd7..c3b70f16dc 100644 --- a/app/src/main/java/one/mixin/android/ui/media/MediaFragment.kt +++ b/app/src/main/java/one/mixin/android/ui/media/MediaFragment.kt @@ -4,8 +4,12 @@ import android.os.Bundle import android.view.View import android.widget.ViewAnimator import androidx.fragment.app.viewModels +import androidx.lifecycle.lifecycleScope +import androidx.paging.LoadState import androidx.recyclerview.widget.GridLayoutManager import dagger.hilt.android.AndroidEntryPoint +import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.launch import one.mixin.android.Constants.ARGS_CONVERSATION_ID import one.mixin.android.R import one.mixin.android.databinding.LayoutRecyclerViewBinding @@ -87,15 +91,17 @@ class MediaFragment : BaseFragment(R.layout.layout_recycler_view) { binding.recyclerView.adapter = adapter binding.emptyIv.setImageResource(R.drawable.ic_empty_media) binding.emptyTv.setText(R.string.NO_MEDIA) + viewLifecycleOwner.lifecycleScope.launch { + adapter.loadStateFlow.collectLatest { loadStates -> + if (loadStates.refresh is LoadState.NotLoading) { + (view as ViewAnimator).displayedChild = if (adapter.itemCount <= 0) 1 else 0 + } + } + } viewModel.getMediaMessagesExcludeLive(conversationId).observe( viewLifecycleOwner, ) { - if (it.size <= 0) { - (view as ViewAnimator).displayedChild = 1 - } else { - (view as ViewAnimator).displayedChild = 0 - } - adapter.submitList(it) + adapter.submitData(viewLifecycleOwner.lifecycle, it) } } diff --git a/app/src/main/java/one/mixin/android/ui/media/PagedListPagerAdapter.kt b/app/src/main/java/one/mixin/android/ui/media/PagedListPagerAdapter.kt deleted file mode 100644 index db4e4d846c..0000000000 --- a/app/src/main/java/one/mixin/android/ui/media/PagedListPagerAdapter.kt +++ /dev/null @@ -1,119 +0,0 @@ -package one.mixin.android.ui.media - -import android.view.View -import android.view.ViewGroup -import androidx.paging.PagedList -import androidx.viewpager.widget.PagerAdapter -import java.util.TreeMap - -abstract class PagedListPagerAdapter : PagerAdapter() { - var pagedList: PagedList? = null - private set - private var callback = PagerCallback() - - var visiblePositions = TreeMap() - private set - - override fun isViewFromObject( - view: View, - obj: Any, - ) = view == obj - - override fun getCount() = pagedList?.size ?: 0 - - fun getItem(position: Int): T? { - return if (position >= 0 && position < pagedList?.size ?: 0) { - pagedList?.get(position) - } else { - null - } - } - - var submitAction: (() -> Unit)? = null - - final override fun instantiateItem( - container: ViewGroup, - position: Int, - ): Any { - visiblePositions[position] = getItem(position) - pagedList?.loadAround(position) - return createItem(container, position) - } - - final override fun destroyItem( - container: ViewGroup, - position: Int, - obj: Any, - ) { - visiblePositions.remove(position) - removeItem(container, position, obj) - } - - override fun getItemPosition(obj: Any) = POSITION_NONE - - abstract fun createItem( - container: ViewGroup, - position: Int, - ): Any - - abstract fun removeItem( - container: ViewGroup, - position: Int, - obj: Any, - ) - - fun submitList(pagedList: PagedList?) { - this.pagedList?.removeWeakCallback(callback) - this.pagedList = pagedList - pagedList?.addWeakCallback(null, callback) - notifyDataSetChanged() - submitAction?.let { - it.invoke() - submitAction = null - } - } - - private inner class PagerCallback : PagedList.Callback() { - override fun onChanged( - position: Int, - count: Int, - ) = - analyzeCount(position, count) - - override fun onInserted( - position: Int, - count: Int, - ) = - analyzeCount(position, count) - - override fun onRemoved( - position: Int, - count: Int, - ) = - analyzeCount(position, count) - - private fun analyzeCount( - start: Int, - count: Int, - ) = analyzeRange(start, start + count) - - private fun analyzeRange( - start: Int, - end: Int, - ) { - if (isInterleave(start, end)) { - notifyDataSetChanged() - } - } - - private fun isInterleave( - start: Int, - end: Int, - ) = - try { - start <= visiblePositions.lastKey() && visiblePositions.firstKey() <= end - } catch (e: Exception) { - false - } - } -} diff --git a/app/src/main/java/one/mixin/android/ui/media/PostFragment.kt b/app/src/main/java/one/mixin/android/ui/media/PostFragment.kt index cd6c41aa52..bbd0fc5141 100644 --- a/app/src/main/java/one/mixin/android/ui/media/PostFragment.kt +++ b/app/src/main/java/one/mixin/android/ui/media/PostFragment.kt @@ -4,9 +4,13 @@ import android.os.Bundle import android.view.View import android.widget.ViewAnimator import androidx.fragment.app.viewModels +import androidx.lifecycle.lifecycleScope +import androidx.paging.LoadState import androidx.recyclerview.widget.LinearLayoutManager import com.timehop.stickyheadersrecyclerview.StickyRecyclerHeadersDecoration import dagger.hilt.android.AndroidEntryPoint +import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.launch import one.mixin.android.Constants import one.mixin.android.R import one.mixin.android.databinding.LayoutRecyclerViewBinding @@ -57,15 +61,17 @@ class PostFragment : BaseFragment(R.layout.layout_recycler_view) { binding.recyclerView.layoutManager = LinearLayoutManager(requireContext()) binding.recyclerView.addItemDecoration(StickyRecyclerHeadersDecoration(adapter)) binding.recyclerView.adapter = adapter + viewLifecycleOwner.lifecycleScope.launch { + adapter.loadStateFlow.collectLatest { loadStates -> + if (loadStates.refresh is LoadState.NotLoading) { + (view as ViewAnimator).displayedChild = if (adapter.itemCount <= 0) 1 else 0 + } + } + } viewModel.getPostMessages(conversationId).observe( viewLifecycleOwner, ) { - if (it.size <= 0) { - (view as ViewAnimator).displayedChild = 1 - } else { - (view as ViewAnimator).displayedChild = 0 - } - adapter.submitList(it) + adapter.submitData(viewLifecycleOwner.lifecycle, it) } } } diff --git a/app/src/main/java/one/mixin/android/ui/media/SharedMediaHeaderAdapter.kt b/app/src/main/java/one/mixin/android/ui/media/SharedMediaHeaderAdapter.kt index 3e5bf2ea39..3436b04679 100644 --- a/app/src/main/java/one/mixin/android/ui/media/SharedMediaHeaderAdapter.kt +++ b/app/src/main/java/one/mixin/android/ui/media/SharedMediaHeaderAdapter.kt @@ -10,12 +10,12 @@ import one.mixin.android.extension.dpToPx import one.mixin.android.extension.hashForDate import one.mixin.android.extension.inflate import one.mixin.android.ui.common.recyclerview.NormalHolder -import one.mixin.android.ui.common.recyclerview.SafePagedListAdapter +import one.mixin.android.ui.common.recyclerview.SafePagingDataAdapter import one.mixin.android.vo.MessageItem import kotlin.math.abs abstract class SharedMediaHeaderAdapter(diffCallback: DiffUtil.ItemCallback = MessageItem.DIFF_CALLBACK) : - SafePagedListAdapter(diffCallback), + SafePagingDataAdapter(diffCallback), StickyRecyclerHeadersAdapter { override fun getHeaderId(pos: Int): Long { val messageItem = getItem(pos) diff --git a/app/src/main/java/one/mixin/android/ui/media/SharedMediaViewModel.kt b/app/src/main/java/one/mixin/android/ui/media/SharedMediaViewModel.kt index 2b2610dbeb..b76220de8e 100644 --- a/app/src/main/java/one/mixin/android/ui/media/SharedMediaViewModel.kt +++ b/app/src/main/java/one/mixin/android/ui/media/SharedMediaViewModel.kt @@ -1,22 +1,21 @@ package one.mixin.android.ui.media import android.net.Uri -import android.annotation.SuppressLint import androidx.annotation.OptIn import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel +import androidx.lifecycle.asLiveData import androidx.lifecycle.viewModelScope import androidx.media3.common.util.UnstableApi -import androidx.paging.DataSource -import androidx.paging.LivePagedListBuilder -import androidx.paging.PagedList -import androidx.paging.PositionalDataSource -import androidx.arch.core.executor.ArchTaskExecutor +import androidx.paging.Pager +import androidx.paging.PagingConfig +import androidx.paging.PagingData +import androidx.paging.PagingSource +import androidx.paging.cachedIn import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext import one.mixin.android.Constants.PAGE_SIZE import one.mixin.android.job.AttachmentDownloadJob import one.mixin.android.job.ConvertVideoJob @@ -46,32 +45,18 @@ class SharedMediaViewModel private val jobManager: MixinJobManager, ) : ViewModel() { - fun getMediaMessagesExcludeLive(conversationId: String): LiveData> { - val liveData = MutableLiveData>() + fun getMediaMessagesExcludeLive(conversationId: String): LiveData> { + val liveData = MutableLiveData>() viewModelScope.launch(Dispatchers.IO) { val list = conversationRepository.getMediaMessagesExcludeLiveList(conversationId) val filteredList = list.filter { !it.isAppCard() || it.isAppCardWithCover() } - val pagedList = createPagedList(filteredList, 0) - liveData.postValue(pagedList) + liveData.postValue(PagingData.from(filteredList)) } return liveData } - @SuppressLint("RestrictedApi") - private fun createPagedList(list: List, initialKey: Int): PagedList { - val config = PagedList.Config.Builder() - .setPageSize(MediaFragment.PAGE_SIZE) - .setEnablePlaceholders(false) - .build() - return PagedList.Builder(ListDataSource(list), config) - .setNotifyExecutor(ArchTaskExecutor.getMainThreadExecutor()) - .setFetchExecutor(ArchTaskExecutor.getIOThreadExecutor()) - .setInitialKey(initialKey) - .build() - } - - fun getAudioMessages(conversationId: String): LiveData> { - val liveData = MutableLiveData>() + fun getAudioMessages(conversationId: String): LiveData> { + val liveData = MutableLiveData>() viewModelScope.launch(Dispatchers.IO) { val list = conversationRepository.getAudioMessagesList(conversationId) val sortedList = list.sortedWith( @@ -96,47 +81,19 @@ class SharedMediaViewModel } }, ) - val pagedList = createPagedList(sortedList, 0) - liveData.postValue(pagedList) + liveData.postValue(PagingData.from(sortedList)) } return liveData } - fun getPostMessages(conversationId: String): LiveData> { - return LivePagedListBuilder( - conversationRepository.getPostMessages(conversationId), - PagedList.Config.Builder() - .setPrefetchDistance(PAGE_SIZE * 2) - .setPageSize(PAGE_SIZE) - .setEnablePlaceholders(true) - .build(), - ) - .build() - } + fun getPostMessages(conversationId: String): LiveData> = + pager { conversationRepository.getPostMessages(conversationId) } - fun getLinkMessages(conversationId: String): LiveData> { - return LivePagedListBuilder( - conversationRepository.getLinkMessages(conversationId), - PagedList.Config.Builder() - .setPrefetchDistance(PAGE_SIZE * 2) - .setPageSize(PAGE_SIZE) - .setEnablePlaceholders(true) - .build(), - ) - .build() - } + fun getLinkMessages(conversationId: String): LiveData> = + pager { conversationRepository.getLinkMessages(conversationId) } - fun getFileMessages(conversationId: String): LiveData> { - return LivePagedListBuilder( - conversationRepository.getFileMessages(conversationId), - PagedList.Config.Builder() - .setPrefetchDistance(PAGE_SIZE * 2) - .setPageSize(PAGE_SIZE) - .setEnablePlaceholders(true) - .build(), - ) - .build() - } + fun getFileMessages(conversationId: String): LiveData> = + pager { conversationRepository.getFileMessages(conversationId) } fun retryDownload(id: String) = viewModelScope.launch(Dispatchers.IO) { @@ -231,8 +188,13 @@ class SharedMediaViewModel conversationId: String, index: Int, excludeLive: Boolean, - ): LiveData> = - conversationRepository.getMediaMessages(conversationId, index, excludeLive) + ): LiveData> = + pager( + pageSize = MediaPagerActivity.PAGE_SIZE, + initialKey = index, + ) { + conversationRepository.getMediaMessagesPagingSource(conversationId, excludeLive) + } suspend fun getMediaMessage( conversationId: String, @@ -246,27 +208,20 @@ class SharedMediaViewModel jobManager.addJobInBackground(AttachmentDownloadJob(it)) } } -} -class ListDataSource(private val items: List) : PositionalDataSource() { - override fun loadInitial(params: LoadInitialParams, callback: LoadInitialCallback) { - val totalCount = items.size - if (totalCount == 0) { - callback.onResult(emptyList(), 0, 0) - return - } - val position = computeInitialLoadPosition(params, totalCount) - val loadSize = computeInitialLoadSize(params, position, totalCount) - callback.onResult(items.subList(position, minOf(position + loadSize, totalCount)), position, totalCount) - } - - override fun loadRange(params: LoadRangeParams, callback: LoadRangeCallback) { - val start = params.startPosition - val end = minOf(start + params.loadSize, items.size) - if (start < items.size && start < end) { - callback.onResult(items.subList(start, end)) - } else { - callback.onResult(emptyList()) - } - } + private fun pager( + pageSize: Int = PAGE_SIZE, + initialKey: Int? = null, + pagingSourceFactory: () -> PagingSource, + ): LiveData> = + Pager( + config = + PagingConfig( + pageSize = pageSize, + prefetchDistance = pageSize * 2, + enablePlaceholders = true, + ), + initialKey = initialKey, + pagingSourceFactory = pagingSourceFactory, + ).flow.cachedIn(viewModelScope).asLiveData() } diff --git a/app/src/main/java/one/mixin/android/ui/media/pager/MediaPagerActivity.kt b/app/src/main/java/one/mixin/android/ui/media/pager/MediaPagerActivity.kt index bbc1d7f9cd..bd9ec884a3 100644 --- a/app/src/main/java/one/mixin/android/ui/media/pager/MediaPagerActivity.kt +++ b/app/src/main/java/one/mixin/android/ui/media/pager/MediaPagerActivity.kt @@ -29,7 +29,6 @@ import androidx.activity.result.contract.ActivityResultContract import androidx.activity.viewModels import androidx.appcompat.app.AlertDialog import androidx.appcompat.view.ContextThemeWrapper -import androidx.arch.core.executor.ArchTaskExecutor import androidx.core.app.ActivityOptionsCompat import androidx.core.net.toFile import androidx.core.view.doOnPreDraw @@ -37,7 +36,7 @@ import androidx.core.view.isVisible import androidx.lifecycle.lifecycleScope import androidx.media3.common.Player import androidx.media3.common.util.UnstableApi -import androidx.paging.PagedList +import androidx.paging.PagingData import androidx.viewpager2.widget.ViewPager2 import coil3.annotation.ExperimentalCoilApi import coil3.imageLoader @@ -85,7 +84,6 @@ import one.mixin.android.util.SystemUIManager import one.mixin.android.util.VideoPlayer import one.mixin.android.util.reportEvent import one.mixin.android.util.rxpermission.RxPermissions -import one.mixin.android.vo.FixedMessageDataSource import one.mixin.android.vo.MediaStatus import one.mixin.android.vo.MessageItem import one.mixin.android.vo.absolutePath @@ -288,22 +286,9 @@ class MediaPagerActivity : BaseActivity(), DismissFrameLayout.OnDismissListener, } else { viewModel.getMediaMessage(conversationId, messageId) ?: return@launch } - val pagedConfig = - PagedList.Config.Builder() - .setInitialLoadSizeHint(1) - .setPageSize(1) - .build() - val pagedList = - PagedList.Builder( - FixedMessageDataSource(listOf(messageItem), 1), - pagedConfig, - ).setNotifyExecutor(ArchTaskExecutor.getMainThreadExecutor()) - .setFetchExecutor(ArchTaskExecutor.getIOThreadExecutor()) - .build() adapter.initialPos = initialIndex - adapter.submitList(pagedList) { - observeAllDataSource() - } + adapter.submitData(lifecycle, PagingData.from(listOf(messageItem))) + observeAllDataSource() if (messageItem.isVideo() || messageItem.isLive()) { checkPip() messageItem.loadVideoOrLive { @@ -316,38 +301,39 @@ class MediaPagerActivity : BaseActivity(), DismissFrameLayout.OnDismissListener, lifecycleScope.launch { val excludeLive = mediaSource == MediaSource.SharedMedia initialIndex = viewModel.indexMediaMessages(conversationId, messageId, excludeLive) + adapter.addOnPagesUpdatedListener { + positionInitialItem(excludeLive) + } viewModel.getMediaMessages(conversationId, initialIndex, excludeLive) .observe( this@MediaPagerActivity, ) { - if (it.isEmpty()) return@observe - adapter.submitList(it) { - if (firstLoad) { - runCatching { - adapter.initialPos = initialIndex - it.loadAround(initialIndex) - if (excludeLive) { - binding.viewPager.setCurrentItem(initialIndex, false) - } else if (it.getOrNull(initialIndex)?.messageId == messageId) { // Only change when data is same - binding.viewPager.setCurrentItem(initialIndex, false) - } else { - lifecycleScope.launch { - val total = viewModel.countIndexMediaMessages(conversationId, excludeLive) - reportEvent("Initial index not found,conversationId: $conversationId,messageId: $messageId, initialIndex: $initialIndex, total: $total") - } - } - }.onFailure { - lifecycleScope.launch { - val total = viewModel.countIndexMediaMessages(conversationId, excludeLive) - reportEvent("${it.message},conversationId: $conversationId,messageId: $messageId, initialIndex: $initialIndex, total: $total") - } - } - checkOrientation() - firstLoad = false - } - } + adapter.submitData(lifecycle, it) + } + } + + private fun positionInitialItem(excludeLive: Boolean) { + if (!firstLoad || adapter.itemCount <= initialIndex) return + runCatching { + adapter.initialPos = initialIndex + val item = adapter.peek(initialIndex) ?: return + if (excludeLive || item.messageId == messageId) { + binding.viewPager.setCurrentItem(initialIndex, false) + } else { + lifecycleScope.launch { + val total = viewModel.countIndexMediaMessages(conversationId, excludeLive) + reportEvent("Initial index not found,conversationId: $conversationId,messageId: $messageId, initialIndex: $initialIndex, total: $total") } + } + }.onFailure { + lifecycleScope.launch { + val total = viewModel.countIndexMediaMessages(conversationId, excludeLive) + reportEvent("${it.message},conversationId: $conversationId,messageId: $messageId, initialIndex: $initialIndex, total: $total") + } } + checkOrientation() + firstLoad = false + } private fun checkPip() { if (pipVideoView.shown) { @@ -720,7 +706,7 @@ class MediaPagerActivity : BaseActivity(), DismissFrameLayout.OnDismissListener, private fun getMessageItemByPosition(position: Int): MessageItem? = try { - adapter.currentList?.get(position) + adapter.peek(position) } catch (e: IndexOutOfBoundsException) { null } diff --git a/app/src/main/java/one/mixin/android/ui/media/pager/MediaPagerAdapter.kt b/app/src/main/java/one/mixin/android/ui/media/pager/MediaPagerAdapter.kt index f15ff59b30..150e023ca5 100644 --- a/app/src/main/java/one/mixin/android/ui/media/pager/MediaPagerAdapter.kt +++ b/app/src/main/java/one/mixin/android/ui/media/pager/MediaPagerAdapter.kt @@ -14,7 +14,7 @@ import one.mixin.android.extension.displayRatio import one.mixin.android.extension.inflate import one.mixin.android.extension.screenHeight import one.mixin.android.extension.screenWidth -import one.mixin.android.ui.common.recyclerview.SafePagedListAdapter +import one.mixin.android.ui.common.recyclerview.SafePagingDataAdapter import one.mixin.android.vo.MessageItem import one.mixin.android.vo.isAppCard import one.mixin.android.vo.isImage @@ -29,7 +29,7 @@ class MediaPagerAdapter( private val context: Context, private val onDismissListener: DismissFrameLayout.OnDismissListener, private val onMediaPagerAdapterListener: MediaPagerAdapterListener, -) : SafePagedListAdapter(MessageItem.DIFF_CALLBACK) { +) : SafePagingDataAdapter(MessageItem.DIFF_CALLBACK) { var initialPos: Int = 0 private val videoStatusCache = LruCache(100) diff --git a/app/src/main/java/one/mixin/android/ui/player/MediaItemAdapter.kt b/app/src/main/java/one/mixin/android/ui/player/MediaItemAdapter.kt index 898407eecc..99bab9cf47 100644 --- a/app/src/main/java/one/mixin/android/ui/player/MediaItemAdapter.kt +++ b/app/src/main/java/one/mixin/android/ui/player/MediaItemAdapter.kt @@ -14,7 +14,7 @@ import one.mixin.android.R import one.mixin.android.databinding.ItemFragmentMediaBinding import one.mixin.android.extension.loadImage import one.mixin.android.job.MixinJobManager -import one.mixin.android.ui.common.recyclerview.SafePagedListAdapter +import one.mixin.android.ui.common.recyclerview.SafePagingDataAdapter import one.mixin.android.ui.player.internal.albumArtUri import one.mixin.android.ui.player.internal.diffCallback import one.mixin.android.ui.player.internal.displaySubtitle @@ -24,7 +24,7 @@ import one.mixin.android.ui.player.internal.id import one.mixin.android.util.MusicPlayer import one.mixin.android.widget.CircleProgress -@UnstableApi class MediaItemAdapter : SafePagedListAdapter(diffCallback) { +@UnstableApi class MediaItemAdapter : SafePagingDataAdapter(diffCallback) { override fun onCreateViewHolder( parent: ViewGroup, viewType: Int, diff --git a/app/src/main/java/one/mixin/android/ui/player/MusicBottomSheetDialogFragment.kt b/app/src/main/java/one/mixin/android/ui/player/MusicBottomSheetDialogFragment.kt index 21442f064b..31ff614638 100644 --- a/app/src/main/java/one/mixin/android/ui/player/MusicBottomSheetDialogFragment.kt +++ b/app/src/main/java/one/mixin/android/ui/player/MusicBottomSheetDialogFragment.kt @@ -8,7 +8,6 @@ import android.os.Bundle import android.support.v4.media.MediaMetadataCompat import android.view.View import android.view.ViewGroup -import androidx.arch.core.executor.ArchTaskExecutor import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.core.view.isVisible import androidx.core.view.setPadding @@ -20,7 +19,7 @@ import androidx.media3.common.Player import androidx.media3.common.Player.MEDIA_ITEM_TRANSITION_REASON_PLAYLIST_CHANGED import androidx.media3.common.Player.MEDIA_ITEM_TRANSITION_REASON_REPEAT import androidx.media3.common.util.UnstableApi -import androidx.paging.PagedList +import androidx.paging.PagingData import androidx.recyclerview.widget.LinearLayoutManager import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.bottomsheet.BottomSheetDialogFragment @@ -48,11 +47,8 @@ import one.mixin.android.util.MusicPlayer import one.mixin.android.util.SystemUIManager import one.mixin.android.util.rxpermission.RxPermissions import one.mixin.android.util.viewBinding -import one.mixin.android.vo.FixedMessageDataSource import one.mixin.android.webrtc.EXTRA_CONVERSATION_ID import one.mixin.android.widget.MixinBottomSheetDialog -import kotlin.math.max -import kotlin.math.min @Suppress("DEPRECATION") @UnstableApi @@ -174,7 +170,7 @@ class MusicBottomSheetDialogFragment : BottomSheetDialogFragment() { viewModel.conversationLiveData(conversationId, index) .observe(this@MusicBottomSheetDialogFragment) { list -> if (list.isEmpty()) return@observe - listAdapter.submitList(list) + listAdapter.submitData(lifecycle, PagingData.from(list)) pb.isVisible = false if (firstOpen && mediaId != null) { @@ -226,33 +222,18 @@ class MusicBottomSheetDialogFragment : BottomSheetDialogFragment() { } private fun updateMusicLayout( - pagedList: PagedList, + list: List, mediaId: String, ) { binding.apply { - var mediaItem: MediaMetadataCompat? = null - for (i in 0 until pagedList.size) { - val item = pagedList[i] - if (item != null && item.id == mediaId) { - mediaItem = item - break - } - } - if (mediaItem == null) { - lifecycleScope.launch { - val index = viewModel.indexAudioByConversationId(conversationId, mediaId) - pagedList.loadAround(max(0, min(pagedList.size - 1, index))) - firstOpen = true - return@launch - } - } + val mediaItem = list.firstOrNull { it.id == mediaId } ?: return musicLayout.title.text = mediaItem?.displayTitle musicLayout.subtitle.text = mediaItem?.displaySubtitle musicLayout.albumArt.loadImage(mediaItem?.albumArtUri?.path, R.drawable.ic_music_place_holder) - if (pagedList.isNotEmpty() && firstOpen) { + if (list.isNotEmpty() && firstOpen) { firstOpen = false - val pos = pagedList.indexOf(mediaItem) + val pos = list.indexOf(mediaItem) if (pos != -1) { playlistRv.post { (playlistRv.layoutManager as LinearLayoutManager).scrollToPosition(pos) @@ -298,29 +279,17 @@ class MusicBottomSheetDialogFragment : BottomSheetDialogFragment() { ) { return } - val pagedList = listAdapter.currentList ?: return + val list = listAdapter.snapshot().items val mediaId = mediaItem.mediaId - updateMusicLayout(pagedList, mediaId) + updateMusicLayout(list, mediaId) } } - @SuppressLint("RestrictedApi") private val urlObserver = UrlLoader.UrlObserver { list -> - val pagedConfig = - PagedList.Config.Builder() - .setPageSize(CONVERSATION_UI_PAGE_SIZE) - .build() - val pagedList = - PagedList.Builder( - FixedMessageDataSource(list, list.size), - pagedConfig, - ).setNotifyExecutor(ArchTaskExecutor.getMainThreadExecutor()) - .setFetchExecutor(ArchTaskExecutor.getIOThreadExecutor()) - .build() lifecycleScope.launch { - listAdapter.submitList(pagedList) + listAdapter.submitData(lifecycle, PagingData.from(list)) binding.pb.isVisible = false } } diff --git a/app/src/main/java/one/mixin/android/ui/player/MusicService.kt b/app/src/main/java/one/mixin/android/ui/player/MusicService.kt index 91374ba5eb..9d5b4ca979 100644 --- a/app/src/main/java/one/mixin/android/ui/player/MusicService.kt +++ b/app/src/main/java/one/mixin/android/ui/player/MusicService.kt @@ -18,7 +18,6 @@ import androidx.media3.common.Player.DISCONTINUITY_REASON_REMOVE import androidx.media3.common.Player.DISCONTINUITY_REASON_SEEK_ADJUSTMENT import androidx.media3.session.MediaSession import androidx.media3.session.MediaSessionService -import androidx.paging.PagedList import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.launch import one.mixin.android.RxBus @@ -34,8 +33,6 @@ import one.mixin.android.ui.player.internal.id import one.mixin.android.ui.player.internal.urlLoader import one.mixin.android.util.MusicPlayer import javax.inject.Inject -import kotlin.math.max -import kotlin.math.min @AndroidEntryPoint class MusicService : MediaSessionService(), LifecycleOwner { @@ -125,7 +122,7 @@ class MusicService : MediaSessionService(), LifecycleOwner { stopSelf() } - private var conversationLiveData: LiveData>? = null + private var conversationLiveData: LiveData>? = null private lateinit var conversationObserver: ConversationObserver private var urlObserver: UrlObserver? = null @@ -180,22 +177,16 @@ class MusicService : MediaSessionService(), LifecycleOwner { conversationLiveData?.observe(this, conversationObserver) } - private inner class ConversationObserver(private var mediaId: String? = null) : Observer> { + private inner class ConversationObserver(private var mediaId: String? = null) : Observer> { private var first = true - private var currentPagedList: PagedList? = null + private var currentList: List? = null private var playWhenReady = true - override fun onChanged(value: PagedList) { + override fun onChanged(value: List) { if (value.isEmpty()) return - currentPagedList = value - val downloadedList = mutableListOf() - for (i in 0 until value.size) { - val item = value[i] - if (item != null && item.downloadStatus == MediaDescriptionCompat.STATUS_DOWNLOADED) { - downloadedList.add(item) - } - } + currentList = value + val downloadedList = value.filter { it.downloadStatus == MediaDescriptionCompat.STATUS_DOWNLOADED } currentPlaylist = downloadedList lifecycleScope.launch { MusicPlayer.get().updatePlaylist(downloadedList) @@ -214,14 +205,13 @@ class MusicService : MediaSessionService(), LifecycleOwner { mediaId: String, playWhenReady: Boolean = true, ) { - currentPagedList?.let { list -> + currentList?.let { list -> if (list.isEmpty()) return@let - list.loadAround(max(0, min(list.size - 1, index))) this.mediaId = mediaId this.playWhenReady = playWhenReady first = true - list.dataSource.invalidate() + onChanged(list) } } } diff --git a/app/src/main/java/one/mixin/android/ui/player/internal/ConversationLoader.kt b/app/src/main/java/one/mixin/android/ui/player/internal/ConversationLoader.kt index 1e1f86262a..5ec1393251 100644 --- a/app/src/main/java/one/mixin/android/ui/player/internal/ConversationLoader.kt +++ b/app/src/main/java/one/mixin/android/ui/player/internal/ConversationLoader.kt @@ -5,8 +5,10 @@ import android.support.v4.media.MediaBrowserCompat import android.support.v4.media.MediaDescriptionCompat import android.support.v4.media.MediaMetadataCompat import androidx.lifecycle.LiveData -import androidx.paging.PagedList -import androidx.paging.toLiveData +import androidx.lifecycle.asLiveData +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.flow.map +import kotlinx.coroutines.withContext import one.mixin.android.db.MixinDatabase import one.mixin.android.extension.fileSize import one.mixin.android.ui.player.internal.AlbumArtCache.DEFAULT_ALBUM_ART @@ -21,16 +23,13 @@ class ConversationLoader : MusicMetaLoader() { db: MixinDatabase, pageSize: Int = 10, initialLoadKey: Int = 0, - ): LiveData> = - db.messageDao().findAudiosByConversationId(conversationId) - .mapByPage { loadMessageItems(it) } - .toLiveData( - PagedList.Config.Builder() - .setPageSize(pageSize) - .setEnablePlaceholders(true) - .build(), - initialLoadKey, - ) + ): LiveData> = + db.invalidationTracker.createFlow("messages", "users") + .map { + withContext(Dispatchers.IO) { + loadMessageItems(db.messageDao().findAudiosByConversationIdList(conversationId)) + } + }.asLiveData() private fun loadMessageItems(messageItems: List): List { val mediaMetadataCompatList = mutableListOf() diff --git a/app/src/main/java/one/mixin/android/ui/search/SearchMessageAdapter.kt b/app/src/main/java/one/mixin/android/ui/search/SearchMessageAdapter.kt index 2074e05d32..67d35803da 100644 --- a/app/src/main/java/one/mixin/android/ui/search/SearchMessageAdapter.kt +++ b/app/src/main/java/one/mixin/android/ui/search/SearchMessageAdapter.kt @@ -11,7 +11,7 @@ import one.mixin.android.databinding.ItemSearchMessageBinding import one.mixin.android.extension.dp import one.mixin.android.extension.highLight import one.mixin.android.extension.timeAgoDate -import one.mixin.android.ui.common.recyclerview.SafePagedListAdapter +import one.mixin.android.ui.common.recyclerview.SafePagingDataAdapter import one.mixin.android.util.GsonHelper import one.mixin.android.vo.AppCardData import one.mixin.android.vo.SearchMessageDetailItem @@ -20,7 +20,7 @@ import one.mixin.android.vo.isContact import one.mixin.android.vo.isData import one.mixin.android.vo.isTranscript -class SearchMessageAdapter : SafePagedListAdapter(SearchMessageDetailItem.DIFF_CALLBACK) { +class SearchMessageAdapter : SafePagingDataAdapter(SearchMessageDetailItem.DIFF_CALLBACK) { var query: String = "" override fun onCreateViewHolder( diff --git a/app/src/main/java/one/mixin/android/ui/search/SearchMessageFragment.kt b/app/src/main/java/one/mixin/android/ui/search/SearchMessageFragment.kt index 42983b6d72..47eb3ffdf0 100644 --- a/app/src/main/java/one/mixin/android/ui/search/SearchMessageFragment.kt +++ b/app/src/main/java/one/mixin/android/ui/search/SearchMessageFragment.kt @@ -10,7 +10,7 @@ import androidx.fragment.app.viewModels import androidx.lifecycle.LiveData import androidx.lifecycle.Observer import androidx.lifecycle.lifecycleScope -import androidx.paging.PagedList +import androidx.paging.PagingData import androidx.recyclerview.widget.LinearLayoutManager import com.jakewharton.rxbinding3.widget.textChanges import com.uber.autodispose.autoDispose @@ -65,8 +65,8 @@ class SearchMessageFragment : BaseFragment(R.layout.fragment_search_message) { private val adapter by lazy { SearchMessageAdapter() } - private var observer: Observer>? = null - private var curLiveData: LiveData>? = null + private var observer: Observer>? = null + private var curLiveData: LiveData>? = null private val binding by viewBinding(FragmentSearchMessageBinding::bind) @@ -226,7 +226,7 @@ class SearchMessageFragment : BaseFragment(R.layout.fragment_search_message) { observer = null curLiveData = null binding.progress.isVisible = false - adapter.submitList(null) + adapter.submitData(viewLifecycleOwner.lifecycle, PagingData.empty()) return@launch } @@ -246,7 +246,7 @@ class SearchMessageFragment : BaseFragment(R.layout.fragment_search_message) { if (s != binding.searchEt.text.toString()) return@Observer binding.progress.isVisible = false - adapter.submitList(it) + adapter.submitData(viewLifecycleOwner.lifecycle, it) } observer?.let { curLiveData?.observe(viewLifecycleOwner, it) diff --git a/app/src/main/java/one/mixin/android/ui/search/SearchViewModel.kt b/app/src/main/java/one/mixin/android/ui/search/SearchViewModel.kt index 34a4157d0c..d75dad642c 100644 --- a/app/src/main/java/one/mixin/android/ui/search/SearchViewModel.kt +++ b/app/src/main/java/one/mixin/android/ui/search/SearchViewModel.kt @@ -5,10 +5,12 @@ import android.os.CancellationSignal import android.os.Parcelable import androidx.lifecycle.LiveData import androidx.lifecycle.ViewModel +import androidx.lifecycle.asLiveData import androidx.lifecycle.viewModelScope -import androidx.paging.Config -import androidx.paging.PagedList -import androidx.paging.toLiveData +import androidx.paging.Pager +import androidx.paging.PagingConfig +import androidx.paging.PagingData +import androidx.paging.cachedIn import dagger.hilt.android.lifecycle.HiltViewModel import io.reactivex.Observable import io.reactivex.android.schedulers.AndroidSchedulers @@ -212,20 +214,23 @@ internal constructor( query: String, conversationId: String, cancellationSignal: CancellationSignal, - ): LiveData> { + ): LiveData> { val escapedQuery = query.trim().escapeSql() - return conversationRepository.fuzzySearchMessageDetail( - escapedQuery, - conversationId, - cancellationSignal, - ).toLiveData( + return Pager( config = - Config( - pageSize = PAGE_SIZE, - prefetchDistance = PAGE_SIZE * 2, - enablePlaceholders = false, - ), - ) + PagingConfig( + pageSize = PAGE_SIZE, + prefetchDistance = PAGE_SIZE * 2, + enablePlaceholders = false, + ), + pagingSourceFactory = { + conversationRepository.fuzzySearchMessageDetail( + escapedQuery, + conversationId, + cancellationSignal, + ) + }, + ).flow.cachedIn(viewModelScope).asLiveData() } fun search(query: String): Observable> = diff --git a/app/src/main/java/one/mixin/android/ui/wallet/adapter/TransactionsAdapter.kt b/app/src/main/java/one/mixin/android/ui/wallet/adapter/TransactionsAdapter.kt index f6f2516409..f7ff723043 100644 --- a/app/src/main/java/one/mixin/android/ui/wallet/adapter/TransactionsAdapter.kt +++ b/app/src/main/java/one/mixin/android/ui/wallet/adapter/TransactionsAdapter.kt @@ -10,13 +10,13 @@ import one.mixin.android.R import one.mixin.android.extension.getClipboardManager import one.mixin.android.extension.hashForDate import one.mixin.android.extension.inflate -import one.mixin.android.ui.common.recyclerview.PagedHeaderAdapter +import one.mixin.android.ui.common.recyclerview.PagingHeaderAdapter import one.mixin.android.util.debug.debugLongClick import one.mixin.android.vo.SnapshotItem import kotlin.math.abs class TransactionsAdapter : - PagedHeaderAdapter(SnapshotItem.DIFF_CALLBACK), + PagingHeaderAdapter(SnapshotItem.DIFF_CALLBACK), StickyRecyclerHeadersAdapter { var listener: OnSnapshotListener? = null diff --git a/app/src/main/java/one/mixin/android/vo/MessageItem.kt b/app/src/main/java/one/mixin/android/vo/MessageItem.kt index 915185767b..7e67bd10ae 100644 --- a/app/src/main/java/one/mixin/android/vo/MessageItem.kt +++ b/app/src/main/java/one/mixin/android/vo/MessageItem.kt @@ -14,7 +14,6 @@ import androidx.core.net.toFile import androidx.core.net.toUri import androidx.media3.common.MimeTypes import androidx.media3.common.util.UnstableApi -import androidx.paging.PositionalDataSource import androidx.recyclerview.widget.DiffUtil import androidx.room3.Entity import androidx.room3.Ignore @@ -419,23 +418,6 @@ private fun MessageItem.simpleChat(): String { } } -class FixedMessageDataSource(private val items: List, private val totalCount: Int) : - PositionalDataSource() { - override fun loadRange( - params: LoadRangeParams, - callback: LoadRangeCallback, - ) { - callback.onResult(items) - } - - override fun loadInitial( - params: LoadInitialParams, - callback: LoadInitialCallback, - ) { - callback.onResult(items, 0, totalCount) - } -} - fun MessageItem.toTranscript(transcriptId: String): TranscriptMessage { val thumb = if ((thumbImage?.length ?: 0) > Constants.MAX_THUMB_IMAGE_LENGTH) { diff --git a/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedLimitOffsetDataSourceQuery.kt b/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedLimitOffsetPagingSourceQuery.kt similarity index 84% rename from query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedLimitOffsetDataSourceQuery.kt rename to query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedLimitOffsetPagingSourceQuery.kt index 9d380f134a..5deb93de24 100644 --- a/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedLimitOffsetDataSourceQuery.kt +++ b/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedLimitOffsetPagingSourceQuery.kt @@ -2,7 +2,7 @@ package one.mixin.android.codegen.annotation @Target(AnnotationTarget.FUNCTION) @Retention(AnnotationRetention.SOURCE) -annotation class GeneratedLimitOffsetDataSourceQuery( +annotation class GeneratedLimitOffsetPagingSourceQuery( val countSql: String, val offsetSql: String, val querySql: String, diff --git a/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedNoCountDataSourceQuery.kt b/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedNoCountPagingSourceQuery.kt similarity index 84% rename from query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedNoCountDataSourceQuery.kt rename to query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedNoCountPagingSourceQuery.kt index 0e9f3e6263..2fa7e7d292 100644 --- a/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedNoCountDataSourceQuery.kt +++ b/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedNoCountPagingSourceQuery.kt @@ -2,7 +2,7 @@ package one.mixin.android.codegen.annotation @Target(AnnotationTarget.FUNCTION) @Retention(AnnotationRetention.SOURCE) -annotation class GeneratedNoCountDataSourceQuery( +annotation class GeneratedNoCountPagingSourceQuery( val sql: String, val binds: Array, val count: String, diff --git a/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedRoomRawQuery.kt b/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedRoomRawQuery.kt new file mode 100644 index 0000000000..ed2d7c09b1 --- /dev/null +++ b/query-codegen/src/main/kotlin/one/mixin/android/codegen/annotation/GeneratedRoomRawQuery.kt @@ -0,0 +1,7 @@ +package one.mixin.android.codegen.annotation + +@Target(AnnotationTarget.FUNCTION) +@Retention(AnnotationRetention.SOURCE) +annotation class GeneratedRoomRawQuery( + val sql: String, +) diff --git a/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryFileRenderer.kt b/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryFileRenderer.kt index 2a3dd52fef..87a9ed9e5d 100644 --- a/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryFileRenderer.kt +++ b/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryFileRenderer.kt @@ -4,8 +4,8 @@ data class QueryProviderModel( val packageName: String, val generatedName: String, val functions: List, - val limitOffsetFunctions: List = emptyList(), - val noCountFunctions: List = emptyList(), + val limitOffsetFunctions: List = emptyList(), + val noCountFunctions: List = emptyList(), val rawCursorFunctions: List = emptyList(), val simpleQueryFunctions: List = emptyList(), val pagingSourceFunctions: List = emptyList(), @@ -29,7 +29,7 @@ data class QueryParameterModel( val type: String, ) -data class LimitOffsetDataSourceFunctionModel( +data class LimitOffsetPagingSourceFunctionModel( val name: String, val returnType: String, val returnTypeImports: List, @@ -43,7 +43,7 @@ data class LimitOffsetDataSourceFunctionModel( val converterName: String, ) -data class NoCountDataSourceFunctionModel( +data class NoCountPagingSourceFunctionModel( val name: String, val returnType: String, val returnTypeImports: List, @@ -194,36 +194,35 @@ class QueryFileRenderer { private fun renderLimitOffsetFunction( lines: MutableList, - function: LimitOffsetDataSourceFunctionModel, + function: LimitOffsetPagingSourceFunctionModel, ) { - val itemType = function.returnType.dataSourceItemType() + val itemType = function.returnType.pagingSourceItemType() lines += " fun ${function.name}(" function.parameters.forEach { parameter -> lines += " ${parameter.name}: ${parameter.type}," } - lines += " ): ${function.returnType} =" - lines += " object : DataSource.Factory() {" - lines += " override fun create(): DataSource {" - renderRoomQueryAcquire(lines, "countStatement", function.countSql, 0, " ") - renderRoomQueryAcquire(lines, "offsetStatement", function.offsetSql, 2, " ") - lines += " val querySqlGenerator = fun(ids: String): RoomQuery {" - lines += " return RoomQuery.acquire(" - renderSqlLiteral(lines, function.querySql.renderSqlTemplate(function.parameters.map { it.name } + "ids"), " ") - lines += " 0," - lines += " )" - lines += " }" - lines += " return object : MixinLimitOffsetDataSource<$itemType>(" - lines += " ${function.databaseParameter}," - lines += " countStatement," - lines += " offsetStatement," - lines += " querySqlGenerator," - lines += " arrayOf(${function.tables.joinToString { "\"$it\"" }})," - lines += " ) {" - lines += " override fun convertRows(cursor: Cursor?): List<$itemType> =" - lines += " ${function.converterName}(cursor)" - lines += " }" - lines += " }" + lines += " ): ${function.returnType} {" + renderRoomQueryAcquire(lines, "countStatement", function.countSql, 0, " ") + renderRoomQueryAcquire(lines, "offsetStatement", function.offsetSql, 2, " ") + lines += " val querySqlGenerator = fun(ids: String): RoomQuery {" + lines += " return RoomQuery.acquire(" + renderSqlLiteral(lines, function.querySql.renderSqlTemplate(function.parameters.map { it.name } + "ids"), " ") + lines += " 0," + lines += " )" + lines += " }" + lines += " return object : MixinCountLimitOffsetDataSource<$itemType>(" + lines += " offsetStatement," + lines += " { ${function.databaseParameter}.query(countStatement).use { if (it.moveToFirst()) it.getInt(0) else 0 } }," + lines += " querySqlGenerator," + lines += " ${function.databaseParameter}," + function.tables.forEach { table -> + lines += " \"$table\"," + } + lines += " ) {" + lines += " override fun convertRows(cursor: Cursor): List<$itemType> =" + lines += " ${function.converterName}(cursor)" lines += " }" + lines += " }" } private fun renderRawCursorFunction( @@ -263,7 +262,7 @@ class QueryFileRenderer { lines: MutableList, function: PagingSourceQueryFunctionModel, ) { - val itemType = function.returnType.dataSourceItemType() + val itemType = function.returnType.pagingSourceItemType() lines += " fun ${function.name}(" function.parameters.forEach { parameter -> lines += " ${parameter.name}: ${parameter.type}," @@ -363,39 +362,36 @@ class QueryFileRenderer { private fun renderNoCountFunction( lines: MutableList, - function: NoCountDataSourceFunctionModel, + function: NoCountPagingSourceFunctionModel, ) { - val itemType = function.returnType.dataSourceItemType() + val itemType = function.returnType.pagingSourceItemType() lines += " fun ${function.name}(" function.parameters.forEach { parameter -> lines += " ${parameter.name}: ${parameter.type}," } - lines += " ): ${function.returnType} =" - lines += " object : DataSource.Factory() {" - lines += " override fun create(): DataSource {" - renderRoomQueryAcquire(lines, "_statement", function.sql, function.bindParameters.size, " ") + lines += " ): ${function.returnType} {" + renderRoomQueryAcquire(lines, "_statement", function.sql, function.bindParameters.size, " ") function.bindParameters.forEachIndexed { index, bindParameter -> val argIndex = index + 1 if (index == 0) { - lines += " var _argIndex = $argIndex" + lines += " var _argIndex = $argIndex" } else { - lines += " _argIndex = $argIndex" + lines += " _argIndex = $argIndex" } - renderBind(lines, function, bindParameter, " ") + renderBind(lines, function, bindParameter, " ") } - lines += " return object : NoCountLimitOffsetDataSource<$itemType>(" - lines += " ${function.databaseParameter}," - lines += " _statement," - lines += " ${function.countParameter}," + lines += " return object : MixinNonCountLimitOffsetDataSource<$itemType>(" + lines += " _statement," + lines += " ${function.countParameter}," + lines += " ${function.databaseParameter}," function.tables.forEach { table -> - lines += " \"$table\"," + lines += " \"$table\"," } - lines += " ) {" - lines += " override fun convertRows(cursor: Cursor?): List<$itemType> =" - lines += " ${function.converterName}(cursor)" - lines += " }" - lines += " }" + lines += " ) {" + lines += " override fun convertRows(cursor: Cursor): List<$itemType> =" + lines += " ${function.converterName}(cursor)" lines += " }" + lines += " }" } private fun renderRoomQueryAcquire( @@ -441,7 +437,7 @@ class QueryFileRenderer { private fun renderBind( lines: MutableList, - function: NoCountDataSourceFunctionModel, + function: NoCountPagingSourceFunctionModel, bindParameter: String, indent: String, ) { @@ -495,7 +491,7 @@ class QueryFileRenderer { } else { listOf( "android.database.Cursor", - "one.mixin.android.db.datasource.MixinLimitOffsetDataSource", + "one.mixin.android.db.datasource.MixinCountLimitOffsetDataSource", ) } @@ -505,7 +501,7 @@ class QueryFileRenderer { } else { listOf( "android.database.Cursor", - "one.mixin.android.db.datasource.NoCountLimitOffsetDataSource", + "one.mixin.android.db.datasource.MixinNonCountLimitOffsetDataSource", ) } @@ -517,7 +513,7 @@ class QueryFileRenderer { } private fun QueryProviderModel.queryExtensionImports(): List = - if (limitOffsetFunctions.isEmpty() && noCountFunctions.isEmpty() && rawCursorFunctions.isEmpty() && pagingSourceFunctions.isEmpty()) { + if (limitOffsetFunctions.isEmpty() && rawCursorFunctions.isEmpty() && pagingSourceFunctions.isEmpty()) { emptyList() } else { listOf("one.mixin.android.db.datasource.query") @@ -555,7 +551,7 @@ class QueryFileRenderer { ) } - private fun String.dataSourceItemType(): String = + private fun String.pagingSourceItemType(): String = substringAfterLast(",").removeSuffix(">").trim() private fun String.renderSqlTemplate(parameterNames: List): String { diff --git a/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryProcessor.kt b/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryProcessor.kt index f805939c24..f091ed7601 100644 --- a/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryProcessor.kt +++ b/query-codegen/src/main/kotlin/one/mixin/android/codegen/processor/QueryProcessor.kt @@ -20,8 +20,8 @@ import com.google.devtools.ksp.symbol.Variance import com.google.devtools.ksp.validate import one.mixin.android.codegen.annotation.GeneratedQuery import one.mixin.android.codegen.annotation.GeneratedQueryProvider -import one.mixin.android.codegen.annotation.GeneratedLimitOffsetDataSourceQuery -import one.mixin.android.codegen.annotation.GeneratedNoCountDataSourceQuery +import one.mixin.android.codegen.annotation.GeneratedLimitOffsetPagingSourceQuery +import one.mixin.android.codegen.annotation.GeneratedNoCountPagingSourceQuery import one.mixin.android.codegen.annotation.GeneratedPagingSourceQuery import one.mixin.android.codegen.annotation.GeneratedRawCursorQuery import one.mixin.android.codegen.annotation.GeneratedRoomRawQuery @@ -47,8 +47,8 @@ class QueryProcessor( private fun generateProvider(provider: KSClassDeclaration) { val allFunctions = provider.getAllFunctions().toList() val queryFunctions = allFunctions.filter { it.hasAnnotation() } - val limitOffsetFunctions = allFunctions.filter { it.hasAnnotation() } - val noCountFunctions = allFunctions.filter { it.hasAnnotation() } + val limitOffsetFunctions = allFunctions.filter { it.hasAnnotation() } + val noCountFunctions = allFunctions.filter { it.hasAnnotation() } val rawCursorFunctions = allFunctions.filter { it.hasAnnotation() } val simpleQueryFunctions = allFunctions.filter { it.hasAnnotation() } val pagingSourceFunctions = allFunctions.filter { it.hasAnnotation() } @@ -103,15 +103,15 @@ class QueryProcessor( ) } - private fun limitOffsetFunctionModel(function: KSFunctionDeclaration): LimitOffsetDataSourceFunctionModel { - val annotation = function.annotation() + private fun limitOffsetFunctionModel(function: KSFunctionDeclaration): LimitOffsetPagingSourceFunctionModel { + val annotation = function.annotation() val importCollector = TypeImportCollector() val parameters = function.parameters(importCollector) val returnType = function.returnType?.resolve() if (returnType == null) { - logger.error("GeneratedLimitOffsetDataSourceQuery functions must declare a return type", function) + logger.error("GeneratedLimitOffsetPagingSourceQuery functions must declare a return type", function) } - return LimitOffsetDataSourceFunctionModel( + return LimitOffsetPagingSourceFunctionModel( name = function.simpleName.asString(), returnType = returnType?.let { importCollector.render(it) } ?: "Unit", returnTypeImports = importCollector.imports, @@ -126,15 +126,15 @@ class QueryProcessor( ) } - private fun noCountFunctionModel(function: KSFunctionDeclaration): NoCountDataSourceFunctionModel { - val annotation = function.annotation() + private fun noCountFunctionModel(function: KSFunctionDeclaration): NoCountPagingSourceFunctionModel { + val annotation = function.annotation() val importCollector = TypeImportCollector() val parameters = function.parameters(importCollector) val returnType = function.returnType?.resolve() if (returnType == null) { - logger.error("GeneratedNoCountDataSourceQuery functions must declare a return type", function) + logger.error("GeneratedNoCountPagingSourceQuery functions must declare a return type", function) } - return NoCountDataSourceFunctionModel( + return NoCountPagingSourceFunctionModel( name = function.simpleName.asString(), returnType = returnType?.let { importCollector.render(it) } ?: "Unit", returnTypeImports = importCollector.imports, diff --git a/query-codegen/src/test/kotlin/one/mixin/android/codegen/processor/QueryFileRendererTest.kt b/query-codegen/src/test/kotlin/one/mixin/android/codegen/processor/QueryFileRendererTest.kt index 6f336b24f3..07eb26675e 100644 --- a/query-codegen/src/test/kotlin/one/mixin/android/codegen/processor/QueryFileRendererTest.kt +++ b/query-codegen/src/test/kotlin/one/mixin/android/codegen/processor/QueryFileRendererTest.kt @@ -106,7 +106,7 @@ class QueryFileRendererTest { } @Test - fun rendersLimitOffsetDataSourceFactory() { + fun rendersLimitOffsetPagingSource() { val source = QueryFileRenderer().render( QueryProviderModel( @@ -115,12 +115,12 @@ class QueryFileRendererTest { functions = emptyList(), limitOffsetFunctions = listOf( - LimitOffsetDataSourceFunctionModel( + LimitOffsetPagingSourceFunctionModel( name = "observeConversations", - returnType = "DataSource.Factory", + returnType = "PagingSource", returnTypeImports = listOf( - "androidx.paging.DataSource", + "androidx.paging.PagingSource", "one.mixin.android.vo.ConversationItem", ), parameters = listOf(QueryParameterModel("database", "MixinDatabase")), @@ -142,9 +142,9 @@ class QueryFileRendererTest { import android.annotation.SuppressLint import android.database.Cursor - import androidx.paging.DataSource + import androidx.paging.PagingSource import one.mixin.android.db.MixinDatabase - import one.mixin.android.db.datasource.MixinLimitOffsetDataSource + import one.mixin.android.db.datasource.MixinCountLimitOffsetDataSource import one.mixin.android.db.datasource.RoomQuery import one.mixin.android.db.datasource.query import one.mixin.android.vo.ConversationItem @@ -153,41 +153,39 @@ class QueryFileRendererTest { object GeneratedDataProvider { fun observeConversations( database: MixinDatabase, - ): DataSource.Factory = - object : DataSource.Factory() { - override fun create(): DataSource { - val countStatement = RoomQuery.acquire( - ""${'"'} - SELECT count(1) FROM conversations - ""${'"'}.trimIndent(), - 0, - ) - val offsetStatement = RoomQuery.acquire( - ""${'"'} - SELECT c.rowid FROM conversations c LIMIT ? OFFSET ? - ""${'"'}.trimIndent(), - 2, - ) - val querySqlGenerator = fun(ids: String): RoomQuery { - return RoomQuery.acquire( - ""${'"'} - SELECT * FROM conversations c WHERE c.rowid IN (${'$'}ids) - ""${'"'}.trimIndent(), - 0, - ) - } - return object : MixinLimitOffsetDataSource( - database, - countStatement, - offsetStatement, - querySqlGenerator, - arrayOf("conversations", "users"), - ) { - override fun convertRows(cursor: Cursor?): List = - convertToConversationItems(cursor) - } - } + ): PagingSource { + val countStatement = RoomQuery.acquire( + ""${'"'} + SELECT count(1) FROM conversations + ""${'"'}.trimIndent(), + 0, + ) + val offsetStatement = RoomQuery.acquire( + ""${'"'} + SELECT c.rowid FROM conversations c LIMIT ? OFFSET ? + ""${'"'}.trimIndent(), + 2, + ) + val querySqlGenerator = fun(ids: String): RoomQuery { + return RoomQuery.acquire( + ""${'"'} + SELECT * FROM conversations c WHERE c.rowid IN (${'$'}ids) + ""${'"'}.trimIndent(), + 0, + ) } + return object : MixinCountLimitOffsetDataSource( + offsetStatement, + { database.query(countStatement).use { if (it.moveToFirst()) it.getInt(0) else 0 } }, + querySqlGenerator, + database, + "conversations", + "users", + ) { + override fun convertRows(cursor: Cursor): List = + convertToConversationItems(cursor) + } + } } """.trimIndent(), source, @@ -195,7 +193,7 @@ class QueryFileRendererTest { } @Test - fun rendersNoCountDataSourceFactory() { + fun rendersNoCountPagingSource() { val source = QueryFileRenderer().render( QueryProviderModel( @@ -204,12 +202,12 @@ class QueryFileRendererTest { functions = emptyList(), noCountFunctions = listOf( - NoCountDataSourceFunctionModel( + NoCountPagingSourceFunctionModel( name = "getPinMessages", - returnType = "DataSource.Factory", + returnType = "PagingSource", returnTypeImports = listOf( - "androidx.paging.DataSource", + "androidx.paging.PagingSource", "one.mixin.android.vo.ChatHistoryMessageItem", ), parameters = @@ -236,11 +234,10 @@ class QueryFileRendererTest { import android.annotation.SuppressLint import android.database.Cursor - import androidx.paging.DataSource + import androidx.paging.PagingSource import one.mixin.android.db.MixinDatabase - import one.mixin.android.db.datasource.NoCountLimitOffsetDataSource + import one.mixin.android.db.datasource.MixinNonCountLimitOffsetDataSource import one.mixin.android.db.datasource.RoomQuery - import one.mixin.android.db.datasource.query import one.mixin.android.vo.ChatHistoryMessageItem @SuppressLint("RestrictedApi") @@ -249,29 +246,26 @@ class QueryFileRendererTest { database: MixinDatabase, conversationId: String, count: Int, - ): DataSource.Factory = - object : DataSource.Factory() { - override fun create(): DataSource { - val _statement = RoomQuery.acquire( - ""${'"'} - SELECT * FROM messages WHERE conversation_id = ? - ""${'"'}.trimIndent(), - 1, - ) - var _argIndex = 1 - _statement.bindString(_argIndex, conversationId) - return object : NoCountLimitOffsetDataSource( - database, - _statement, - count, - "pin_messages", - "messages", - ) { - override fun convertRows(cursor: Cursor?): List = - convertChatHistoryMessageItem(cursor) - } - } + ): PagingSource { + val _statement = RoomQuery.acquire( + ""${'"'} + SELECT * FROM messages WHERE conversation_id = ? + ""${'"'}.trimIndent(), + 1, + ) + var _argIndex = 1 + _statement.bindString(_argIndex, conversationId) + return object : MixinNonCountLimitOffsetDataSource( + _statement, + count, + database, + "pin_messages", + "messages", + ) { + override fun convertRows(cursor: Cursor): List = + convertChatHistoryMessageItem(cursor) } + } } """.trimIndent(), source,