Bump MessageDatabase.kt [15] -> [16]

Bump Room [2.3.0] -> [2.4.2]

MAILAND-2380
This commit is contained in:
Davide Farella 2022-04-06 14:30:22 +02:00
parent 205aa715ce
commit bc749c0f2f
5 changed files with 553 additions and 12 deletions

View File

@ -2,7 +2,7 @@
"formatVersion": 1,
"database": {
"version": 15,
"identityHash": "129e6d8c1a51ba4e86fbbecb7be4622d",
"identityHash": "62f56b04811fed2faf791d36b634e176",
"entities": [
{
"tableName": "attachmentv3",
@ -208,7 +208,7 @@
},
{
"tableName": "messagev3",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`ID` TEXT, `ConversationID` TEXT, `Subject` TEXT, `Unread` INTEGER NOT NULL, `Type` INTEGER NOT NULL, `Time` INTEGER NOT NULL, `Size` INTEGER NOT NULL, `Location` INTEGER NOT NULL, `FolderLocation` TEXT, `Starred` INTEGER, `NumAttachments` INTEGER NOT NULL, `IsEncrypted` INTEGER NOT NULL, `ExpirationTime` INTEGER NOT NULL, `IsReplied` INTEGER, `IsRepliedAll` INTEGER, `IsForwarded` INTEGER, `Body` TEXT, `IsDownloaded` INTEGER NOT NULL, `AddressID` TEXT, `InlineResponse` INTEGER NOT NULL, `NewServerId` TEXT, `MIMEType` TEXT, `SpamScore` INTEGER NOT NULL, `AccessTime` INTEGER NOT NULL, `Header` TEXT, `ParsedHeaders` TEXT, `LabelIDs` TEXT NOT NULL, `ToList` TEXT NOT NULL, `ReplyTos` TEXT NOT NULL, `CCList` TEXT NOT NULL, `BCCList` TEXT NOT NULL, `Flags` INTEGER NOT NULL, `_id` INTEGER PRIMARY KEY AUTOINCREMENT, `Sender_SenderName` TEXT, `Sender_SenderSerialized` TEXT)",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`ID` TEXT, `ConversationID` TEXT, `Subject` TEXT, `Unread` INTEGER NOT NULL, `Type` INTEGER NOT NULL, `Time` INTEGER NOT NULL, `Size` INTEGER NOT NULL, `Location` INTEGER NOT NULL, `FolderLocation` TEXT, `Starred` INTEGER, `NumAttachments` INTEGER NOT NULL, `IsEncrypted` INTEGER NOT NULL, `ExpirationTime` INTEGER NOT NULL, `IsReplied` INTEGER, `IsRepliedAll` INTEGER, `IsForwarded` INTEGER, `Body` TEXT, `IsDownloaded` INTEGER NOT NULL, `AddressID` TEXT, `InlineResponse` INTEGER NOT NULL, `NewServerId` TEXT, `MIMEType` TEXT, `SpamScore` INTEGER NOT NULL, `AccessTime` INTEGER NOT NULL, `Header` TEXT, `ParsedHeaders` TEXT, `LabelIDs` TEXT NOT NULL, `ToList` TEXT NOT NULL, `ReplyTos` TEXT NOT NULL, `CCList` TEXT NOT NULL, `BCCList` TEXT NOT NULL, `_id` INTEGER PRIMARY KEY AUTOINCREMENT, `Sender_SenderName` TEXT, `Sender_SenderSerialized` TEXT)",
"fields": [
{
"fieldPath": "messageId",
@ -396,12 +396,6 @@
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "flags",
"columnName": "Flags",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "dbId",
"columnName": "_id",
@ -531,7 +525,7 @@
"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, '129e6d8c1a51ba4e86fbbecb7be4622d')"
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '62f56b04811fed2faf791d36b634e176')"
]
}
}

View File

@ -0,0 +1,543 @@
{
"formatVersion": 1,
"database": {
"version": 16,
"identityHash": "913ea9559cd96b96a19268a453870e77",
"entities": [
{
"tableName": "attachmentv3",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`attachment_id` TEXT, `file_name` TEXT, `mime_type` TEXT, `file_size` INTEGER NOT NULL, `key_packets` TEXT, `message_id` TEXT NOT NULL, `uploaded` INTEGER NOT NULL, `uploading` INTEGER NOT NULL, `signature` TEXT, `headers` TEXT, `is_inline` INTEGER NOT NULL, `file_path` TEXT, `mime_data` BLOB, `_id` INTEGER PRIMARY KEY AUTOINCREMENT)",
"fields": [
{
"fieldPath": "attachmentId",
"columnName": "attachment_id",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "fileName",
"columnName": "file_name",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mimeType",
"columnName": "mime_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "fileSize",
"columnName": "file_size",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "keyPackets",
"columnName": "key_packets",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "messageId",
"columnName": "message_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "isUploaded",
"columnName": "uploaded",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "isUploading",
"columnName": "uploading",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "signature",
"columnName": "signature",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "headers",
"columnName": "headers",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "inline",
"columnName": "is_inline",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "filePath",
"columnName": "file_path",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mimeData",
"columnName": "mime_data",
"affinity": "BLOB",
"notNull": false
},
{
"fieldPath": "dbId",
"columnName": "_id",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_attachmentv3_attachment_id",
"unique": true,
"columnNames": [
"attachment_id"
],
"orders": [],
"createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_attachmentv3_attachment_id` ON `${TABLE_NAME}` (`attachment_id`)"
}
],
"foreignKeys": []
},
{
"tableName": "conversations",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`ID` TEXT NOT NULL, `Order` INTEGER NOT NULL, `UserID` TEXT NOT NULL, `Subject` TEXT NOT NULL, `Senders` TEXT NOT NULL, `Recipients` TEXT NOT NULL, `NumMessages` INTEGER NOT NULL, `NumUnread` INTEGER NOT NULL, `NumAttachments` INTEGER NOT NULL, `ExpirationTime` INTEGER NOT NULL, `Size` INTEGER NOT NULL, `Labels` TEXT NOT NULL, PRIMARY KEY(`ID`))",
"fields": [
{
"fieldPath": "id",
"columnName": "ID",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "order",
"columnName": "Order",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "userId",
"columnName": "UserID",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "subject",
"columnName": "Subject",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "senders",
"columnName": "Senders",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "recipients",
"columnName": "Recipients",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "numMessages",
"columnName": "NumMessages",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "numUnread",
"columnName": "NumUnread",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "numAttachments",
"columnName": "NumAttachments",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "expirationTime",
"columnName": "ExpirationTime",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "size",
"columnName": "Size",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "labels",
"columnName": "Labels",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"ID"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_conversations_ID",
"unique": true,
"columnNames": [
"ID"
],
"orders": [],
"createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_conversations_ID` ON `${TABLE_NAME}` (`ID`)"
}
],
"foreignKeys": []
},
{
"tableName": "messagev3",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`ID` TEXT, `ConversationID` TEXT, `Subject` TEXT, `Unread` INTEGER NOT NULL, `Type` INTEGER NOT NULL, `Time` INTEGER NOT NULL, `Size` INTEGER NOT NULL, `Location` INTEGER NOT NULL, `FolderLocation` TEXT, `Starred` INTEGER, `NumAttachments` INTEGER NOT NULL, `IsEncrypted` INTEGER NOT NULL, `ExpirationTime` INTEGER NOT NULL, `IsReplied` INTEGER, `IsRepliedAll` INTEGER, `IsForwarded` INTEGER, `Body` TEXT, `IsDownloaded` INTEGER NOT NULL, `AddressID` TEXT, `InlineResponse` INTEGER NOT NULL, `NewServerId` TEXT, `MIMEType` TEXT, `SpamScore` INTEGER NOT NULL, `AccessTime` INTEGER NOT NULL, `Header` TEXT, `ParsedHeaders` TEXT, `LabelIDs` TEXT NOT NULL, `ToList` TEXT NOT NULL, `ReplyTos` TEXT NOT NULL, `CCList` TEXT NOT NULL, `BCCList` TEXT NOT NULL, `Flags` INTEGER NOT NULL DEFAULT 0, `_id` INTEGER PRIMARY KEY AUTOINCREMENT, `Sender_SenderName` TEXT, `Sender_SenderSerialized` TEXT)",
"fields": [
{
"fieldPath": "messageId",
"columnName": "ID",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "conversationId",
"columnName": "ConversationID",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "subject",
"columnName": "Subject",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "Unread",
"columnName": "Unread",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "Type",
"columnName": "Type",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "time",
"columnName": "Time",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "totalSize",
"columnName": "Size",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "location",
"columnName": "Location",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "folderLocation",
"columnName": "FolderLocation",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "isStarred",
"columnName": "Starred",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "numAttachments",
"columnName": "NumAttachments",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "messageEncryption",
"columnName": "IsEncrypted",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "expirationTime",
"columnName": "ExpirationTime",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "isReplied",
"columnName": "IsReplied",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "isRepliedAll",
"columnName": "IsRepliedAll",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "isForwarded",
"columnName": "IsForwarded",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "messageBody",
"columnName": "Body",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "isDownloaded",
"columnName": "IsDownloaded",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "addressID",
"columnName": "AddressID",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "isInline",
"columnName": "InlineResponse",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "localId",
"columnName": "NewServerId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mimeType",
"columnName": "MIMEType",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "spamScore",
"columnName": "SpamScore",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "accessTime",
"columnName": "AccessTime",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "header",
"columnName": "Header",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "parsedHeaders",
"columnName": "ParsedHeaders",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "allLabelIDs",
"columnName": "LabelIDs",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "toList",
"columnName": "ToList",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "replyTos",
"columnName": "ReplyTos",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "ccList",
"columnName": "CCList",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "bccList",
"columnName": "BCCList",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "flags",
"columnName": "Flags",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "dbId",
"columnName": "_id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "sender.name",
"columnName": "Sender_SenderName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "sender.emailAddress",
"columnName": "Sender_SenderSerialized",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_messagev3_ID",
"unique": true,
"columnNames": [
"ID"
],
"orders": [],
"createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_messagev3_ID` ON `${TABLE_NAME}` (`ID`)"
},
{
"name": "index_messagev3_Location",
"unique": false,
"columnNames": [
"Location"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_messagev3_Location` ON `${TABLE_NAME}` (`Location`)"
},
{
"name": "index_messagev3_ConversationID",
"unique": false,
"columnNames": [
"ConversationID"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_messagev3_ConversationID` ON `${TABLE_NAME}` (`ConversationID`)"
}
],
"foreignKeys": []
},
{
"tableName": "message_preference",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`ID` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `message_id` TEXT NOT NULL, `view_in_dark_mode` INTEGER NOT NULL)",
"fields": [
{
"fieldPath": "id",
"columnName": "ID",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "messageId",
"columnName": "message_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "viewInDarkMode",
"columnName": "view_in_dark_mode",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"ID"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "UnreadCounter",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`user_id` TEXT NOT NULL, `type` TEXT NOT NULL, `label_id` TEXT NOT NULL, `unread_count` INTEGER NOT NULL, PRIMARY KEY(`user_id`, `label_id`, `type`))",
"fields": [
{
"fieldPath": "userId",
"columnName": "user_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "labelId",
"columnName": "label_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "unreadCount",
"columnName": "unread_count",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"user_id",
"label_id",
"type"
],
"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, '913ea9559cd96b96a19268a453870e77')"
]
}
}

View File

@ -18,6 +18,7 @@
*/
package ch.protonmail.android.data.local
import androidx.room.AutoMigration
import androidx.room.Database
import androidx.room.RoomDatabase
import androidx.room.TypeConverters
@ -42,7 +43,10 @@ import me.proton.core.data.room.db.CommonConverters
MessagePreferenceEntity::class,
UnreadCounterEntity::class
],
version = 15
autoMigrations = [
AutoMigration(from = 15, to = 16)
],
version = 16
)
@TypeConverters(
value = [

View File

@ -210,7 +210,7 @@ data class Message @JvmOverloads constructor(
@Embedded(prefix = COLUMN_MESSAGE_PREFIX_SENDER)
var sender: MessageSender? = MessageSender(null, null),
@ColumnInfo(name = COLUMN_MESSAGE_FLAGS)
@ColumnInfo(name = COLUMN_MESSAGE_FLAGS, defaultValue = "0")
val flags: Long = 0
) : Serializable {

View File

@ -42,7 +42,7 @@ fun initVersions() {
`lifecycle version` = "2.4.0-alpha01" // Released: Mar 24, 2021
`material version` = "1.4.0" // Released: Jul 04, 2021
`android-paging version` = "2.1.0" // Released: Jan 26, 2019
`android-room version` = "2.3.0" // Released: Apr 21, 2021
`android-room version` = "2.4.2" // Released: Feb 23, 2022
`android-work version` = "2.7.1" // Released: Nov 17, 2021
`android-test version` = "1.4.0-beta01" // Released: May 15, 2021