mirror of
https://codeberg.org/Mercury-IM/Mercury-IM
synced 2024-06-29 23:14:51 +02:00
376 lines
11 KiB
JSON
376 lines
11 KiB
JSON
{
|
|
"formatVersion": 1,
|
|
"database": {
|
|
"version": 1,
|
|
"identityHash": "63a5e8d6de4b6d8eb30e820be9ab9a69",
|
|
"entities": [
|
|
{
|
|
"tableName": "contacts",
|
|
"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 )",
|
|
"fields": [
|
|
{
|
|
"fieldPath": "id",
|
|
"columnName": "id",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "accountId",
|
|
"columnName": "accountId",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "entityId",
|
|
"columnName": "entityId",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "rosterName",
|
|
"columnName": "rosterName",
|
|
"affinity": "TEXT",
|
|
"notNull": false
|
|
},
|
|
{
|
|
"fieldPath": "nickname",
|
|
"columnName": "nickname",
|
|
"affinity": "TEXT",
|
|
"notNull": false
|
|
}
|
|
],
|
|
"primaryKey": {
|
|
"columnNames": [
|
|
"id"
|
|
],
|
|
"autoGenerate": false
|
|
},
|
|
"indices": [
|
|
{
|
|
"name": "index_contacts_id",
|
|
"unique": false,
|
|
"columnNames": [
|
|
"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`)"
|
|
},
|
|
{
|
|
"name": "index_contacts_entityId",
|
|
"unique": false,
|
|
"columnNames": [
|
|
"entityId"
|
|
],
|
|
"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`)"
|
|
}
|
|
],
|
|
"foreignKeys": [
|
|
{
|
|
"table": "accounts",
|
|
"onDelete": "CASCADE",
|
|
"onUpdate": "NO ACTION",
|
|
"columns": [
|
|
"accountId"
|
|
],
|
|
"referencedColumns": [
|
|
"id"
|
|
]
|
|
},
|
|
{
|
|
"table": "entities",
|
|
"onDelete": "RESTRICT",
|
|
"onUpdate": "NO ACTION",
|
|
"columns": [
|
|
"entityId"
|
|
],
|
|
"referencedColumns": [
|
|
"id"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"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
|
|
},
|
|
"indices": [
|
|
{
|
|
"name": "index_accounts_id",
|
|
"unique": false,
|
|
"columnNames": [
|
|
"id"
|
|
],
|
|
"createSql": "CREATE INDEX `index_accounts_id` ON `${TABLE_NAME}` (`id`)"
|
|
}
|
|
],
|
|
"foreignKeys": []
|
|
},
|
|
{
|
|
"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"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"tableName": "messages",
|
|
"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 )",
|
|
"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
|
|
},
|
|
{
|
|
"fieldPath": "incoming",
|
|
"columnName": "incoming",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
}
|
|
],
|
|
"primaryKey": {
|
|
"columnNames": [
|
|
"id"
|
|
],
|
|
"autoGenerate": true
|
|
},
|
|
"indices": [
|
|
{
|
|
"name": "index_messages_id",
|
|
"unique": false,
|
|
"columnNames": [
|
|
"id"
|
|
],
|
|
"createSql": "CREATE INDEX `index_messages_id` ON `${TABLE_NAME}` (`id`)"
|
|
},
|
|
{
|
|
"name": "index_messages_accountId",
|
|
"unique": false,
|
|
"columnNames": [
|
|
"accountId"
|
|
],
|
|
"createSql": "CREATE INDEX `index_messages_accountId` ON `${TABLE_NAME}` (`accountId`)"
|
|
}
|
|
],
|
|
"foreignKeys": [
|
|
{
|
|
"table": "accounts",
|
|
"onDelete": "CASCADE",
|
|
"onUpdate": "NO ACTION",
|
|
"columns": [
|
|
"accountId"
|
|
],
|
|
"referencedColumns": [
|
|
"id"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"tableName": "entities",
|
|
"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 )",
|
|
"fields": [
|
|
{
|
|
"fieldPath": "id",
|
|
"columnName": "id",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "accountId",
|
|
"columnName": "accountId",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "jid",
|
|
"columnName": "jid",
|
|
"affinity": "TEXT",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "avatarFile",
|
|
"columnName": "avatar",
|
|
"affinity": "TEXT",
|
|
"notNull": false
|
|
}
|
|
],
|
|
"primaryKey": {
|
|
"columnNames": [
|
|
"id"
|
|
],
|
|
"autoGenerate": false
|
|
},
|
|
"indices": [
|
|
{
|
|
"name": "index_entities_id",
|
|
"unique": false,
|
|
"columnNames": [
|
|
"id"
|
|
],
|
|
"createSql": "CREATE INDEX `index_entities_id` ON `${TABLE_NAME}` (`id`)"
|
|
},
|
|
{
|
|
"name": "index_entities_accountId_jid",
|
|
"unique": true,
|
|
"columnNames": [
|
|
"accountId",
|
|
"jid"
|
|
],
|
|
"createSql": "CREATE UNIQUE INDEX `index_entities_accountId_jid` ON `${TABLE_NAME}` (`accountId`, `jid`)"
|
|
}
|
|
],
|
|
"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)",
|
|
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '63a5e8d6de4b6d8eb30e820be9ab9a69')"
|
|
]
|
|
}
|
|
} |