diff --git a/app/schemas/one.mixin.android.db.MixinDatabase/70.json b/app/schemas/one.mixin.android.db.MixinDatabase/70.json new file mode 100644 index 0000000000..386929b4de --- /dev/null +++ b/app/schemas/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/src/main/java/one/mixin/android/Constants.kt b/app/src/main/java/one/mixin/android/Constants.kt index 2a5cae5a0e..3db01847ad 100644 --- a/app/src/main/java/one/mixin/android/Constants.kt +++ b/app/src/main/java/one/mixin/android/Constants.kt @@ -216,7 +216,7 @@ object Constants { object DataBase { const val DB_NAME = "mixin.db" const val MINI_VERSION = 15 - const val CURRENT_VERSION = 69 + const val CURRENT_VERSION = 70 const val FTS_DB_NAME = "fts.db" const val PENDING_DB_NAME = "pending.db" 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 a8c7746079..f4cb915ad0 100644 --- a/app/src/main/java/one/mixin/android/db/MixinDatabase.kt +++ b/app/src/main/java/one/mixin/android/db/MixinDatabase.kt @@ -69,6 +69,7 @@ import one.mixin.android.db.MixinDatabaseMigrations.Companion.MIGRATION_65_66 import one.mixin.android.db.MixinDatabaseMigrations.Companion.MIGRATION_66_67 import one.mixin.android.db.MixinDatabaseMigrations.Companion.MIGRATION_67_68 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 @@ -424,7 +425,8 @@ abstract class MixinDatabase : RoomDatabase() { MIGRATION_65_66, MIGRATION_66_67, MIGRATION_67_68, - MIGRATION_68_69 + MIGRATION_68_69, + MIGRATION_69_70, ) .enableMultiInstanceInvalidation() .setQueryExecutor( 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 d5fd42aaad..97afb771b6 100644 --- a/app/src/main/java/one/mixin/android/db/MixinDatabaseMigrations.kt +++ b/app/src/main/java/one/mixin/android/db/MixinDatabaseMigrations.kt @@ -597,6 +597,13 @@ class MixinDatabaseMigrations private constructor() { } } + val MIGRATION_69_70: Migration = + object : Migration(69, 70) { + override fun migrate(db: SupportSQLiteDatabase) { + db.execSQL("ALTER TABLE `markets` ADD COLUMN `descriptions` TEXT") + } + } + // If you add a new table, be sure to add a clear method to the DatabaseUtil } } 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 new file mode 100644 index 0000000000..8c7d49bc3f --- /dev/null +++ b/app/src/main/java/one/mixin/android/db/converter/DescriptionsConverter.kt @@ -0,0 +1,21 @@ +package one.mixin.android.db.converter + +import androidx.room.TypeConverter +import com.google.gson.Gson +import com.google.gson.reflect.TypeToken +import one.mixin.android.extension.equalsIgnoreCase + +object DescriptionsConverter { + @TypeConverter + fun fromString(value: String?): Map? { + if (value.isNullOrEmpty() || value.equalsIgnoreCase("null")) return null + val mapType = object : TypeToken>() {}.type + return Gson().fromJson(value, mapType) + } + + @TypeConverter + fun fromMap(map: Map?): String? { + if (map.isNullOrEmpty()) return null + return Gson().toJson(map) + } +} diff --git a/app/src/main/java/one/mixin/android/ui/wallet/MarketDetailsFragment.kt b/app/src/main/java/one/mixin/android/ui/wallet/MarketDetailsFragment.kt index 8ae5d870c7..8bdc0778be 100644 --- a/app/src/main/java/one/mixin/android/ui/wallet/MarketDetailsFragment.kt +++ b/app/src/main/java/one/mixin/android/ui/wallet/MarketDetailsFragment.kt @@ -6,6 +6,7 @@ import android.view.View import android.view.View.VISIBLE import androidx.compose.runtime.mutableStateOf import androidx.core.app.NotificationManagerCompat +import androidx.core.text.HtmlCompat import androidx.core.view.isInvisible import androidx.core.view.isVisible import androidx.fragment.app.viewModels @@ -50,6 +51,7 @@ import one.mixin.android.vo.Fiats import one.mixin.android.vo.market.MarketItem import one.mixin.android.vo.safe.TokenItem import java.math.BigDecimal +import java.util.Locale import javax.inject.Inject import timber.log.Timber @@ -369,6 +371,15 @@ class MarketDetailsFragment : BaseFragment(R.layout.fragment_details_market) { lowTime.isVisible = true lowTime.text = info.atlDate.dayTime() + val desc = info.descriptions?.let { map -> + val lang = Locale.getDefault().language + (map[lang]?.takeIf { it.isNotBlank() } + ?: map["en"]?.takeIf { it.isNotBlank() } + ?: map.values.firstOrNull { it.isNotBlank() }) + }?.let { HtmlCompat.fromHtml(it, HtmlCompat.FROM_HTML_MODE_LEGACY).toString().trim() } + aboutContainer.isVisible = !desc.isNullOrBlank() + aboutContent.text = desc.orEmpty() + priceValue.setTextColor(textPrimary) marketCap.setTextColor(textPrimary) marketHigh.setTextColor(textPrimary) @@ -403,6 +414,7 @@ class MarketDetailsFragment : BaseFragment(R.layout.fragment_details_market) { highValue.setText(R.string.N_A) lowValue.setTextColor(textAssist) lowValue.setText(R.string.N_A) + aboutContainer.isVisible = false } } } 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 c57bb91bb8..69cd90dd13 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 @@ -7,12 +7,13 @@ import androidx.room.PrimaryKey import androidx.room.TypeConverters import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize +import one.mixin.android.db.converter.DescriptionsConverter import one.mixin.android.db.converter.OptionalListConverter @Entity( tableName = "markets", ) -@TypeConverters(OptionalListConverter::class) +@TypeConverters(OptionalListConverter::class, DescriptionsConverter::class) @Parcelize data class Market( @PrimaryKey @@ -105,5 +106,8 @@ data class Market( val sparklineIn24h: String, @SerializedName("updated_at") @ColumnInfo(name = "updated_at") - val updatedAt: String + val updatedAt: String, + @SerializedName("descriptions") + @ColumnInfo(name = "descriptions") + val descriptions: Map? = null, ) : Parcelable \ No newline at end of file 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 81ad351ffb..36edd3c4e0 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 @@ -4,10 +4,11 @@ import android.os.Parcelable import androidx.room.ColumnInfo import androidx.room.TypeConverters import kotlinx.parcelize.Parcelize +import one.mixin.android.db.converter.DescriptionsConverter import one.mixin.android.db.converter.OptionalListConverter @Parcelize -@TypeConverters(OptionalListConverter::class) +@TypeConverters(OptionalListConverter::class, DescriptionsConverter::class) data class MarketItem( @ColumnInfo(name = "coin_id") val coinId: String, @@ -68,7 +69,9 @@ data class MarketItem( @ColumnInfo(name = "sparkline_in_24h") val sparklineIn24: String, @ColumnInfo(name = "is_favored") - var isFavored: Boolean? + var isFavored: Boolean?, + @ColumnInfo(name = "descriptions") + val descriptions: Map? = null, ) : Parcelable { companion object { fun fromMarket(market: Market): MarketItem { @@ -102,7 +105,8 @@ data class MarketItem( assetIds = market.assetIds, sparklineIn7d = market.sparklineIn7d, sparklineIn24 = market.sparklineIn24h, - isFavored = null + isFavored = null, + descriptions = market.descriptions, ) } } diff --git a/app/src/main/res/layout/fragment_details_market.xml b/app/src/main/res/layout/fragment_details_market.xml index bd5095b2cb..0b96a3dcad 100644 --- a/app/src/main/res/layout/fragment_details_market.xml +++ b/app/src/main/res/layout/fragment_details_market.xml @@ -574,6 +574,34 @@ + + + + + + +