Mercury-IM/persistence-room/schemas/org.mercury_im.messenger.persistence.room.AppDatabase/1.json

376 lines
11 KiB
JSON
Raw Normal View History

2019-05-27 21:34:11 +02:00
{
"formatVersion": 1,
"database": {
"version": 1,
2019-06-21 04:44:59 +02:00
"identityHash": "63a5e8d6de4b6d8eb30e820be9ab9a69",
2019-05-27 21:34:11 +02:00
"entities": [
{
2019-06-10 02:52:08 +02:00
"tableName": "contacts",
2019-06-20 17:20:23 +02:00
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `accountId` INTEGER NOT NULL, `entityId` INTEGER NOT NULL, `rosterName` TEXT, `nickname` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`accountId`) REFERENCES `accounts`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`entityId`) REFERENCES `entities`(`id`) ON UPDATE NO ACTION ON DELETE RESTRICT )",
2019-05-27 21:34:11 +02:00
"fields": [
2019-06-10 02:52:08 +02:00
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
2019-05-27 21:34:11 +02:00
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
2019-06-20 17:20:23 +02:00
"fieldPath": "entityId",
"columnName": "entityId",
2019-06-10 02:52:08 +02:00
"affinity": "INTEGER",
2019-05-27 21:34:11 +02:00
"notNull": true
},
{
"fieldPath": "rosterName",
"columnName": "rosterName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "nickname",
"columnName": "nickname",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
2019-06-10 02:52:08 +02:00
"id"
2019-05-27 21:34:11 +02:00
],
"autoGenerate": false
},
"indices": [
{
2019-06-10 02:52:08 +02:00
"name": "index_contacts_id",
"unique": false,
2019-05-27 21:34:11 +02:00
"columnNames": [
2019-06-10 02:52:08 +02:00
"id"
],
"createSql": "CREATE INDEX `index_contacts_id` ON `${TABLE_NAME}` (`id`)"
},
{
"name": "index_contacts_accountId",
"unique": false,
"columnNames": [
"accountId"
],
"createSql": "CREATE INDEX `index_contacts_accountId` ON `${TABLE_NAME}` (`accountId`)"
},
{
2019-06-20 17:20:23 +02:00
"name": "index_contacts_entityId",
2019-06-10 02:52:08 +02:00
"unique": false,
"columnNames": [
2019-06-20 17:20:23 +02:00
"entityId"
2019-05-27 21:34:11 +02:00
],
2019-06-20 17:20:23 +02:00
"createSql": "CREATE INDEX `index_contacts_entityId` ON `${TABLE_NAME}` (`entityId`)"
},
{
"name": "index_contacts_id_entityId",
"unique": true,
"columnNames": [
"id",
"entityId"
],
"createSql": "CREATE UNIQUE INDEX `index_contacts_id_entityId` ON `${TABLE_NAME}` (`id`, `entityId`)"
2019-05-27 21:34:11 +02:00
}
],
"foreignKeys": [
{
"table": "accounts",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
2019-06-03 01:16:49 +02:00
},
{
"table": "entities",
"onDelete": "RESTRICT",
"onUpdate": "NO ACTION",
"columns": [
2019-06-20 17:20:23 +02:00
"entityId"
2019-06-03 01:16:49 +02:00
],
"referencedColumns": [
2019-06-10 02:52:08 +02:00
"id"
2019-06-03 01:16:49 +02:00
]
2019-05-27 21:34:11 +02:00
}
]
},
{
"tableName": "accounts",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `jid` TEXT, `password` TEXT, `enabled` INTEGER NOT NULL)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "jid",
"columnName": "jid",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "password",
"columnName": "password",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "enabled",
"columnName": "enabled",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
2019-06-03 01:16:49 +02:00
"indices": [
{
"name": "index_accounts_id",
"unique": false,
"columnNames": [
"id"
],
"createSql": "CREATE INDEX `index_accounts_id` ON `${TABLE_NAME}` (`id`)"
}
],
2019-05-27 21:34:11 +02:00
"foreignKeys": []
},
2019-06-21 04:44:59 +02:00
{
"tableName": "chats",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `xmppId` INTEGER NOT NULL, `open` INTEGER NOT NULL, FOREIGN KEY(`xmppId`) REFERENCES `entities`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "peerIdentityId",
"columnName": "xmppId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "isOpened",
"columnName": "open",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_chats_id",
"unique": false,
"columnNames": [
"id"
],
"createSql": "CREATE INDEX `index_chats_id` ON `${TABLE_NAME}` (`id`)"
},
{
"name": "index_chats_xmppId",
"unique": false,
"columnNames": [
"xmppId"
],
"createSql": "CREATE INDEX `index_chats_xmppId` ON `${TABLE_NAME}` (`xmppId`)"
}
],
"foreignKeys": [
{
"table": "entities",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"xmppId"
],
"referencedColumns": [
"id"
]
}
]
},
2019-05-27 21:34:11 +02:00
{
"tableName": "messages",
2019-06-20 17:20:23 +02:00
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `accountId` INTEGER NOT NULL, `body` TEXT, `sendDate` INTEGER, `from` TEXT, `to` TEXT, `incoming` INTEGER NOT NULL, FOREIGN KEY(`accountId`) REFERENCES `accounts`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
2019-05-27 21:34:11 +02:00
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "body",
"columnName": "body",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "sendDate",
"columnName": "sendDate",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "from",
"columnName": "from",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "to",
"columnName": "to",
"affinity": "TEXT",
"notNull": false
2019-06-20 17:20:23 +02:00
},
{
"fieldPath": "incoming",
"columnName": "incoming",
"affinity": "INTEGER",
"notNull": true
2019-05-27 21:34:11 +02:00
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
2019-06-03 01:16:49 +02:00
"indices": [
{
"name": "index_messages_id",
"unique": false,
"columnNames": [
"id"
],
"createSql": "CREATE INDEX `index_messages_id` ON `${TABLE_NAME}` (`id`)"
2019-06-10 02:52:08 +02:00
},
{
"name": "index_messages_accountId",
"unique": false,
"columnNames": [
"accountId"
],
"createSql": "CREATE INDEX `index_messages_accountId` ON `${TABLE_NAME}` (`accountId`)"
2019-06-03 01:16:49 +02:00
}
],
"foreignKeys": [
{
"table": "accounts",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "entities",
2019-06-10 02:52:08 +02:00
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `accountId` INTEGER NOT NULL, `jid` TEXT NOT NULL, `avatar` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`accountId`) REFERENCES `accounts`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
2019-06-03 01:16:49 +02:00
"fields": [
2019-06-10 02:52:08 +02:00
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
2019-06-03 01:16:49 +02:00
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "jid",
"columnName": "jid",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "avatarFile",
2019-06-10 02:52:08 +02:00
"columnName": "avatar",
2019-06-03 01:16:49 +02:00
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
2019-06-10 02:52:08 +02:00
"id"
2019-06-03 01:16:49 +02:00
],
"autoGenerate": false
},
"indices": [
2019-06-10 02:52:08 +02:00
{
"name": "index_entities_id",
"unique": false,
"columnNames": [
"id"
],
"createSql": "CREATE INDEX `index_entities_id` ON `${TABLE_NAME}` (`id`)"
},
2019-06-03 01:16:49 +02:00
{
"name": "index_entities_accountId_jid",
"unique": true,
"columnNames": [
"accountId",
"jid"
],
"createSql": "CREATE UNIQUE INDEX `index_entities_accountId_jid` ON `${TABLE_NAME}` (`accountId`, `jid`)"
}
],
2019-05-27 21:34:11 +02:00
"foreignKeys": [
{
"table": "accounts",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
2019-06-21 04:44:59 +02:00
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '63a5e8d6de4b6d8eb30e820be9ab9a69')"
2019-05-27 21:34:11 +02:00
]
}
}