New view chat combines all contact tables
This commit is contained in:
parent
b46b88cc10
commit
f1e4d30898
3 changed files with 362 additions and 2 deletions
184
database.sql
184
database.sql
|
@ -1,6 +1,6 @@
|
|||
-- ------------------------------------------
|
||||
-- Friendica 2021.09-dev (Siberian Iris)
|
||||
-- DB_UPDATE_VERSION 1427
|
||||
-- DB_UPDATE_VERSION 1428
|
||||
-- ------------------------------------------
|
||||
|
||||
|
||||
|
@ -2395,6 +2395,188 @@ CREATE VIEW `owner-view` AS SELECT
|
|||
INNER JOIN `contact` ON `contact`.`uid` = `user`.`uid` AND `contact`.`self`
|
||||
INNER JOIN `profile` ON `profile`.`uid` = `user`.`uid`;
|
||||
|
||||
--
|
||||
-- VIEW account-view
|
||||
--
|
||||
DROP VIEW IF EXISTS `account-view`;
|
||||
CREATE VIEW `account-view` AS SELECT
|
||||
`contact`.`id` AS `id`,
|
||||
`contact`.`url` AS `url`,
|
||||
`contact`.`nurl` AS `nurl`,
|
||||
`contact`.`uri-id` AS `uri-id`,
|
||||
`contact`.`addr` AS `addr`,
|
||||
`contact`.`alias` AS `alias`,
|
||||
`contact`.`name` AS `name`,
|
||||
`contact`.`nick` AS `nick`,
|
||||
`contact`.`about` AS `about`,
|
||||
`contact`.`keywords` AS `keywords`,
|
||||
`contact`.`xmpp` AS `xmpp`,
|
||||
`contact`.`avatar` AS `avatar`,
|
||||
`contact`.`photo` AS `photo`,
|
||||
`contact`.`thumb` AS `thumb`,
|
||||
`contact`.`micro` AS `micro`,
|
||||
`contact`.`header` AS `header`,
|
||||
`contact`.`created` AS `created`,
|
||||
`contact`.`updated` AS `updated`,
|
||||
`contact`.`network` AS `network`,
|
||||
`contact`.`protocol` AS `protocol`,
|
||||
`contact`.`location` AS `location`,
|
||||
`contact`.`attag` AS `attag`,
|
||||
`contact`.`pubkey` AS `pubkey`,
|
||||
`contact`.`prvkey` AS `prvkey`,
|
||||
`contact`.`subscribe` AS `subscribe`,
|
||||
`contact`.`last-update` AS `last-update`,
|
||||
`contact`.`success_update` AS `success_update`,
|
||||
`contact`.`failure_update` AS `failure_update`,
|
||||
`contact`.`failed` AS `failed`,
|
||||
`contact`.`last-item` AS `last-item`,
|
||||
`contact`.`last-discovery` AS `last-discovery`,
|
||||
`contact`.`contact-type` AS `contact-type`,
|
||||
`contact`.`manually-approve` AS `manually-approve`,
|
||||
`contact`.`unsearchable` AS `unsearchable`,
|
||||
`contact`.`sensitive` AS `sensitive`,
|
||||
`contact`.`baseurl` AS `baseurl`,
|
||||
`contact`.`gsid` AS `gsid`,
|
||||
`contact`.`info` AS `info`,
|
||||
`contact`.`bdyear` AS `bdyear`,
|
||||
`contact`.`bd` AS `bd`,
|
||||
`contact`.`poco` AS `poco`,
|
||||
`contact`.`name-date` AS `name-date`,
|
||||
`contact`.`uri-date` AS `uri-date`,
|
||||
`contact`.`avatar-date` AS `avatar-date`,
|
||||
`contact`.`term-date` AS `term-date`,
|
||||
`contact`.`hidden` AS `global-ignored`,
|
||||
`contact`.`blocked` AS `global-blocked`,
|
||||
`contact`.`hidden` AS `hidden`,
|
||||
`contact`.`archive` AS `archive`,
|
||||
`contact`.`deleted` AS `deleted`,
|
||||
`contact`.`blocked` AS `blocked`,
|
||||
`contact`.`request` AS `dfrn-request`,
|
||||
`contact`.`notify` AS `dfrn-notify`,
|
||||
`contact`.`poll` AS `dfrn-poll`,
|
||||
`contact`.`confirm` AS `dfrn-confirm`,
|
||||
`fcontact`.`guid` AS `diaspora-guid`,
|
||||
`fcontact`.`batch` AS `diaspora-batch`,
|
||||
`fcontact`.`notify` AS `diaspora-notify`,
|
||||
`fcontact`.`poll` AS `diaspora-poll`,
|
||||
`fcontact`.`alias` AS `diaspora-alias`,
|
||||
`apcontact`.`uuid` AS `ap-uuid`,
|
||||
`apcontact`.`type` AS `ap-type`,
|
||||
`apcontact`.`following` AS `ap-following`,
|
||||
`apcontact`.`followers` AS `ap-followers`,
|
||||
`apcontact`.`inbox` AS `ap-inbox`,
|
||||
`apcontact`.`outbox` AS `ap-outbox`,
|
||||
`apcontact`.`sharedinbox` AS `ap-sharedinbox`,
|
||||
`apcontact`.`generator` AS `ap-generator`,
|
||||
`apcontact`.`following_count` AS `ap-following_count`,
|
||||
`apcontact`.`followers_count` AS `ap-followers_count`,
|
||||
`apcontact`.`statuses_count` AS `ap-statuses_count`
|
||||
FROM `contact`
|
||||
LEFT JOIN `apcontact` ON `apcontact`.`uri-id` = `contact`.`uri-id`
|
||||
LEFT JOIN `fcontact` ON `fcontact`.`uri-id` = contact.`uri-id`
|
||||
WHERE `contact`.`uid` = 0;
|
||||
|
||||
--
|
||||
-- VIEW account-user-view
|
||||
--
|
||||
DROP VIEW IF EXISTS `account-user-view`;
|
||||
CREATE VIEW `account-user-view` AS SELECT
|
||||
`ucontact`.`id` AS `id`,
|
||||
`ucontact`.`uid` AS `uid`,
|
||||
`contact`.`url` AS `url`,
|
||||
`contact`.`nurl` AS `nurl`,
|
||||
`contact`.`uri-id` AS `uri-id`,
|
||||
`contact`.`addr` AS `addr`,
|
||||
`contact`.`alias` AS `alias`,
|
||||
`contact`.`name` AS `name`,
|
||||
`contact`.`nick` AS `nick`,
|
||||
`contact`.`about` AS `about`,
|
||||
`contact`.`keywords` AS `keywords`,
|
||||
`contact`.`xmpp` AS `xmpp`,
|
||||
`contact`.`avatar` AS `avatar`,
|
||||
`contact`.`photo` AS `photo`,
|
||||
`contact`.`thumb` AS `thumb`,
|
||||
`contact`.`micro` AS `micro`,
|
||||
`contact`.`header` AS `header`,
|
||||
`contact`.`created` AS `created`,
|
||||
`contact`.`updated` AS `updated`,
|
||||
`ucontact`.`self` AS `self`,
|
||||
`ucontact`.`remote_self` AS `remote_self`,
|
||||
`ucontact`.`rel` AS `rel`,
|
||||
`contact`.`network` AS `network`,
|
||||
`ucontact`.`protocol` AS `protocol`,
|
||||
`contact`.`location` AS `location`,
|
||||
`contact`.`attag` AS `attag`,
|
||||
`contact`.`pubkey` AS `pubkey`,
|
||||
`contact`.`prvkey` AS `prvkey`,
|
||||
`contact`.`subscribe` AS `subscribe`,
|
||||
`contact`.`last-update` AS `last-update`,
|
||||
`contact`.`success_update` AS `success_update`,
|
||||
`contact`.`failure_update` AS `failure_update`,
|
||||
`contact`.`failed` AS `failed`,
|
||||
`contact`.`last-item` AS `last-item`,
|
||||
`contact`.`last-discovery` AS `last-discovery`,
|
||||
`contact`.`contact-type` AS `contact-type`,
|
||||
`contact`.`manually-approve` AS `manually-approve`,
|
||||
`contact`.`unsearchable` AS `unsearchable`,
|
||||
`contact`.`sensitive` AS `sensitive`,
|
||||
`contact`.`baseurl` AS `baseurl`,
|
||||
`contact`.`gsid` AS `gsid`,
|
||||
`contact`.`info` AS `info`,
|
||||
`contact`.`bdyear` AS `bdyear`,
|
||||
`contact`.`bd` AS `bd`,
|
||||
`contact`.`poco` AS `poco`,
|
||||
`contact`.`name-date` AS `name-date`,
|
||||
`contact`.`uri-date` AS `uri-date`,
|
||||
`contact`.`avatar-date` AS `avatar-date`,
|
||||
`contact`.`term-date` AS `term-date`,
|
||||
`contact`.`hidden` AS `global-ignored`,
|
||||
`contact`.`blocked` AS `global-blocked`,
|
||||
`ucontact`.`hidden` AS `hidden`,
|
||||
`ucontact`.`archive` AS `archive`,
|
||||
`ucontact`.`pending` AS `pending`,
|
||||
`ucontact`.`deleted` AS `deleted`,
|
||||
`ucontact`.`notify_new_posts` AS `notify_new_posts`,
|
||||
`ucontact`.`fetch_further_information` AS `fetch_further_information`,
|
||||
`ucontact`.`ffi_keyword_denylist` AS `ffi_keyword_denylist`,
|
||||
`ucontact`.`rating` AS `rating`,
|
||||
`ucontact`.`readonly` AS `readonly`,
|
||||
`ucontact`.`blocked` AS `blocked`,
|
||||
`ucontact`.`block_reason` AS `block_reason`,
|
||||
`ucontact`.`subhub` AS `subhub`,
|
||||
`ucontact`.`hub-verify` AS `hub-verify`,
|
||||
`ucontact`.`reason` AS `reason`,
|
||||
`ucontact`.`duplex` AS `dfrn-duplex`,
|
||||
`ucontact`.`ret-aes` AS `dfrn-ret-aes`,
|
||||
`ucontact`.`site-pubkey` AS `dfrn-site-pubkey`,
|
||||
`ucontact`.`issued-id` AS `dfrn-issued-id`,
|
||||
`ucontact`.`dfrn-id` AS `dfrn-id`,
|
||||
`ucontact`.`aes_allow` AS `dfrn-aes_allow`,
|
||||
`contact`.`request` AS `dfrn-request`,
|
||||
`contact`.`notify` AS `dfrn-notify`,
|
||||
`contact`.`poll` AS `dfrn-poll`,
|
||||
`contact`.`confirm` AS `dfrn-confirm`,
|
||||
`fcontact`.`guid` AS `diaspora-guid`,
|
||||
`fcontact`.`batch` AS `diaspora-batch`,
|
||||
`fcontact`.`notify` AS `diaspora-notify`,
|
||||
`fcontact`.`poll` AS `diaspora-poll`,
|
||||
`fcontact`.`alias` AS `diaspora-alias`,
|
||||
`apcontact`.`uuid` AS `ap-uuid`,
|
||||
`apcontact`.`type` AS `ap-type`,
|
||||
`apcontact`.`following` AS `ap-following`,
|
||||
`apcontact`.`followers` AS `ap-followers`,
|
||||
`apcontact`.`inbox` AS `ap-inbox`,
|
||||
`apcontact`.`outbox` AS `ap-outbox`,
|
||||
`apcontact`.`sharedinbox` AS `ap-sharedinbox`,
|
||||
`apcontact`.`generator` AS `ap-generator`,
|
||||
`apcontact`.`following_count` AS `ap-following_count`,
|
||||
`apcontact`.`followers_count` AS `ap-followers_count`,
|
||||
`apcontact`.`statuses_count` AS `ap-statuses_count`
|
||||
FROM `contact` AS `ucontact`
|
||||
INNER JOIN `contact` ON `contact`.`uri-id` = `ucontact`.`uri-id` AND `contact`.`uid` = 0
|
||||
LEFT JOIN `apcontact` ON `apcontact`.`uri-id` = `ucontact`.`uri-id`
|
||||
LEFT JOIN `fcontact` ON `fcontact`.`uri-id` = `ucontact`.`uri-id` AND `fcontact`.`network` = 'dspr';
|
||||
|
||||
--
|
||||
-- VIEW pending-view
|
||||
--
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue