Fix database

This commit is contained in:
Philipp 2023-02-21 21:01:57 +01:00
parent 7e92adef6c
commit fae2c6632c
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
2 changed files with 20 additions and 21 deletions

View file

@ -1855,7 +1855,7 @@ CREATE TABLE IF NOT EXISTS `worker-ipc` (
-- VIEW application-view -- VIEW application-view
-- --
DROP VIEW IF EXISTS `application-view`; DROP VIEW IF EXISTS `application-view`;
CREATE VIEW `application-view` AS SELECT CREATE VIEW `application-view` AS SELECT
`application`.`id` AS `id`, `application`.`id` AS `id`,
`application-token`.`uid` AS `uid`, `application-token`.`uid` AS `uid`,
`application`.`name` AS `name`, `application`.`name` AS `name`,
@ -1878,7 +1878,7 @@ CREATE VIEW `application-view` AS SELECT
-- VIEW post-user-view -- VIEW post-user-view
-- --
DROP VIEW IF EXISTS `post-user-view`; DROP VIEW IF EXISTS `post-user-view`;
CREATE VIEW `post-user-view` AS SELECT CREATE VIEW `post-user-view` AS SELECT
`post-user`.`id` AS `id`, `post-user`.`id` AS `id`,
`post-user`.`id` AS `post-user-id`, `post-user`.`id` AS `post-user-id`,
`post-user`.`uid` AS `uid`, `post-user`.`uid` AS `uid`,
@ -2057,7 +2057,7 @@ CREATE VIEW `post-user-view` AS SELECT
-- VIEW post-thread-user-view -- VIEW post-thread-user-view
-- --
DROP VIEW IF EXISTS `post-thread-user-view`; DROP VIEW IF EXISTS `post-thread-user-view`;
CREATE VIEW `post-thread-user-view` AS SELECT CREATE VIEW `post-thread-user-view` AS SELECT
`post-user`.`id` AS `id`, `post-user`.`id` AS `id`,
`post-user`.`id` AS `post-user-id`, `post-user`.`id` AS `post-user-id`,
`post-thread-user`.`uid` AS `uid`, `post-thread-user`.`uid` AS `uid`,
@ -2234,7 +2234,7 @@ CREATE VIEW `post-thread-user-view` AS SELECT
-- VIEW post-view -- VIEW post-view
-- --
DROP VIEW IF EXISTS `post-view`; DROP VIEW IF EXISTS `post-view`;
CREATE VIEW `post-view` AS SELECT CREATE VIEW `post-view` AS SELECT
`item-uri`.`uri` AS `uri`, `item-uri`.`uri` AS `uri`,
`post`.`uri-id` AS `uri-id`, `post`.`uri-id` AS `uri-id`,
`parent-item-uri`.`uri` AS `parent-uri`, `parent-item-uri`.`uri` AS `parent-uri`,
@ -2374,7 +2374,7 @@ CREATE VIEW `post-view` AS SELECT
-- VIEW post-thread-view -- VIEW post-thread-view
-- --
DROP VIEW IF EXISTS `post-thread-view`; DROP VIEW IF EXISTS `post-thread-view`;
CREATE VIEW `post-thread-view` AS SELECT CREATE VIEW `post-thread-view` AS SELECT
`item-uri`.`uri` AS `uri`, `item-uri`.`uri` AS `uri`,
`post-thread`.`uri-id` AS `uri-id`, `post-thread`.`uri-id` AS `uri-id`,
`parent-item-uri`.`uri` AS `parent-uri`, `parent-item-uri`.`uri` AS `parent-uri`,
@ -2516,7 +2516,7 @@ CREATE VIEW `post-thread-view` AS SELECT
-- VIEW category-view -- VIEW category-view
-- --
DROP VIEW IF EXISTS `category-view`; DROP VIEW IF EXISTS `category-view`;
CREATE VIEW `category-view` AS SELECT CREATE VIEW `category-view` AS SELECT
`post-category`.`uri-id` AS `uri-id`, `post-category`.`uri-id` AS `uri-id`,
`post-category`.`uid` AS `uid`, `post-category`.`uid` AS `uid`,
`post-category`.`type` AS `type`, `post-category`.`type` AS `type`,
@ -2530,7 +2530,7 @@ CREATE VIEW `category-view` AS SELECT
-- VIEW collection-view -- VIEW collection-view
-- --
DROP VIEW IF EXISTS `collection-view`; DROP VIEW IF EXISTS `collection-view`;
CREATE VIEW `collection-view` AS SELECT CREATE VIEW `collection-view` AS SELECT
`post-collection`.`uri-id` AS `uri-id`, `post-collection`.`uri-id` AS `uri-id`,
`post-collection`.`type` AS `type`, `post-collection`.`type` AS `type`,
`post-collection`.`author-id` AS `cid`, `post-collection`.`author-id` AS `cid`,
@ -2551,7 +2551,7 @@ CREATE VIEW `collection-view` AS SELECT
-- VIEW media-view -- VIEW media-view
-- --
DROP VIEW IF EXISTS `media-view`; DROP VIEW IF EXISTS `media-view`;
CREATE VIEW `media-view` AS SELECT CREATE VIEW `media-view` AS SELECT
`post-media`.`uri-id` AS `uri-id`, `post-media`.`uri-id` AS `uri-id`,
`post-media`.`type` AS `type`, `post-media`.`type` AS `type`,
`post`.`received` AS `received`, `post`.`received` AS `received`,
@ -2569,7 +2569,7 @@ CREATE VIEW `media-view` AS SELECT
-- VIEW tag-view -- VIEW tag-view
-- --
DROP VIEW IF EXISTS `tag-view`; DROP VIEW IF EXISTS `tag-view`;
CREATE VIEW `tag-view` AS SELECT CREATE VIEW `tag-view` AS SELECT
`post-tag`.`uri-id` AS `uri-id`, `post-tag`.`uri-id` AS `uri-id`,
`post-tag`.`type` AS `type`, `post-tag`.`type` AS `type`,
`post-tag`.`tid` AS `tid`, `post-tag`.`tid` AS `tid`,
@ -2585,7 +2585,7 @@ CREATE VIEW `tag-view` AS SELECT
-- VIEW network-item-view -- VIEW network-item-view
-- --
DROP VIEW IF EXISTS `network-item-view`; DROP VIEW IF EXISTS `network-item-view`;
CREATE VIEW `network-item-view` AS SELECT CREATE VIEW `network-item-view` AS SELECT
`post-user`.`uri-id` AS `uri-id`, `post-user`.`uri-id` AS `uri-id`,
`parent-post`.`id` AS `parent`, `parent-post`.`id` AS `parent`,
`post-user`.`received` AS `received`, `post-user`.`received` AS `received`,
@ -2600,7 +2600,7 @@ CREATE VIEW `network-item-view` AS SELECT
`post-user`.`contact-id` AS `contact-id`, `post-user`.`contact-id` AS `contact-id`,
`ownercontact`.`contact-type` AS `contact-type` `ownercontact`.`contact-type` AS `contact-type`
FROM `post-user` FROM `post-user`
STRAIGHT_JOIN `post-thread-user` ON `post-thread-user`.`uri-id` = `post-user`.`parent-uri-id` AND `post-thread-user`.`uid` = `post-user`.`uid` STRAIGHT_JOIN `post-thread-user` ON `post-thread-user`.`uri-id` = `post-user`.`parent-uri-id` AND `post-thread-user`.`uid` = `post-user`.`uid`
INNER JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id` INNER JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id`
LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `post-thread-user`.`uid` AND `author`.`cid` = `post-thread-user`.`author-id` LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `post-thread-user`.`uid` AND `author`.`cid` = `post-thread-user`.`author-id`
LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `post-thread-user`.`uid` AND `owner`.`cid` = `post-thread-user`.`owner-id` LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `post-thread-user`.`uid` AND `owner`.`cid` = `post-thread-user`.`owner-id`
@ -2616,7 +2616,7 @@ CREATE VIEW `network-item-view` AS SELECT
-- VIEW network-thread-view -- VIEW network-thread-view
-- --
DROP VIEW IF EXISTS `network-thread-view`; DROP VIEW IF EXISTS `network-thread-view`;
CREATE VIEW `network-thread-view` AS SELECT CREATE VIEW `network-thread-view` AS SELECT
`post-thread-user`.`uri-id` AS `uri-id`, `post-thread-user`.`uri-id` AS `uri-id`,
`parent-post`.`id` AS `parent`, `parent-post`.`id` AS `parent`,
`post-thread-user`.`received` AS `received`, `post-thread-user`.`received` AS `received`,
@ -2645,7 +2645,7 @@ CREATE VIEW `network-thread-view` AS SELECT
-- VIEW owner-view -- VIEW owner-view
-- --
DROP VIEW IF EXISTS `owner-view`; DROP VIEW IF EXISTS `owner-view`;
CREATE VIEW `owner-view` AS SELECT CREATE VIEW `owner-view` AS SELECT
`contact`.`id` AS `id`, `contact`.`id` AS `id`,
`contact`.`uid` AS `uid`, `contact`.`uid` AS `uid`,
`contact`.`created` AS `created`, `contact`.`created` AS `created`,
@ -2775,7 +2775,7 @@ CREATE VIEW `owner-view` AS SELECT
-- VIEW account-view -- VIEW account-view
-- --
DROP VIEW IF EXISTS `account-view`; DROP VIEW IF EXISTS `account-view`;
CREATE VIEW `account-view` AS SELECT CREATE VIEW `account-view` AS SELECT
`contact`.`id` AS `id`, `contact`.`id` AS `id`,
`contact`.`url` AS `url`, `contact`.`url` AS `url`,
`contact`.`nurl` AS `nurl`, `contact`.`nurl` AS `nurl`,
@ -2861,7 +2861,7 @@ CREATE VIEW `account-view` AS SELECT
-- VIEW account-user-view -- VIEW account-user-view
-- --
DROP VIEW IF EXISTS `account-user-view`; DROP VIEW IF EXISTS `account-user-view`;
CREATE VIEW `account-user-view` AS SELECT CREATE VIEW `account-user-view` AS SELECT
`ucontact`.`id` AS `id`, `ucontact`.`id` AS `id`,
`contact`.`id` AS `pid`, `contact`.`id` AS `pid`,
`ucontact`.`uid` AS `uid`, `ucontact`.`uid` AS `uid`,
@ -2965,7 +2965,7 @@ CREATE VIEW `account-user-view` AS SELECT
-- VIEW pending-view -- VIEW pending-view
-- --
DROP VIEW IF EXISTS `pending-view`; DROP VIEW IF EXISTS `pending-view`;
CREATE VIEW `pending-view` AS SELECT CREATE VIEW `pending-view` AS SELECT
`register`.`id` AS `id`, `register`.`id` AS `id`,
`register`.`hash` AS `hash`, `register`.`hash` AS `hash`,
`register`.`created` AS `created`, `register`.`created` AS `created`,
@ -2987,7 +2987,7 @@ CREATE VIEW `pending-view` AS SELECT
-- VIEW tag-search-view -- VIEW tag-search-view
-- --
DROP VIEW IF EXISTS `tag-search-view`; DROP VIEW IF EXISTS `tag-search-view`;
CREATE VIEW `tag-search-view` AS SELECT CREATE VIEW `tag-search-view` AS SELECT
`post-tag`.`uri-id` AS `uri-id`, `post-tag`.`uri-id` AS `uri-id`,
`post-user`.`uid` AS `uid`, `post-user`.`uid` AS `uid`,
`post-user`.`id` AS `iid`, `post-user`.`id` AS `iid`,
@ -3009,7 +3009,7 @@ CREATE VIEW `tag-search-view` AS SELECT
-- VIEW workerqueue-view -- VIEW workerqueue-view
-- --
DROP VIEW IF EXISTS `workerqueue-view`; DROP VIEW IF EXISTS `workerqueue-view`;
CREATE VIEW `workerqueue-view` AS SELECT CREATE VIEW `workerqueue-view` AS SELECT
`process`.`pid` AS `pid`, `process`.`pid` AS `pid`,
`workerqueue`.`priority` AS `priority` `workerqueue`.`priority` AS `priority`
FROM `process` FROM `process`
@ -3020,7 +3020,7 @@ CREATE VIEW `workerqueue-view` AS SELECT
-- VIEW profile_field-view -- VIEW profile_field-view
-- --
DROP VIEW IF EXISTS `profile_field-view`; DROP VIEW IF EXISTS `profile_field-view`;
CREATE VIEW `profile_field-view` AS SELECT CREATE VIEW `profile_field-view` AS SELECT
`profile_field`.`id` AS `id`, `profile_field`.`id` AS `id`,
`profile_field`.`uid` AS `uid`, `profile_field`.`uid` AS `uid`,
`profile_field`.`label` AS `label`, `profile_field`.`label` AS `label`,
@ -3040,7 +3040,7 @@ CREATE VIEW `profile_field-view` AS SELECT
-- VIEW diaspora-contact-view -- VIEW diaspora-contact-view
-- --
DROP VIEW IF EXISTS `diaspora-contact-view`; DROP VIEW IF EXISTS `diaspora-contact-view`;
CREATE VIEW `diaspora-contact-view` AS SELECT CREATE VIEW `diaspora-contact-view` AS SELECT
`diaspora-contact`.`uri-id` AS `uri-id`, `diaspora-contact`.`uri-id` AS `uri-id`,
`item-uri`.`uri` AS `url`, `item-uri`.`uri` AS `url`,
`item-uri`.`guid` AS `guid`, `item-uri`.`guid` AS `guid`,

View file

@ -10,7 +10,6 @@ Database Tables
| [2fa_trusted_browser](help/database/db_2fa_trusted_browser) | Two-factor authentication trusted browsers | | [2fa_trusted_browser](help/database/db_2fa_trusted_browser) | Two-factor authentication trusted browsers |
| [account-suggestion](help/database/db_account-suggestion) | Account suggestion | | [account-suggestion](help/database/db_account-suggestion) | Account suggestion |
| [account-user](help/database/db_account-user) | Remote and local accounts | | [account-user](help/database/db_account-user) | Remote and local accounts |
| [addon](help/database/db_addon) | registered addons |
| [apcontact](help/database/db_apcontact) | ActivityPub compatible contacts - used in the ActivityPub implementation | | [apcontact](help/database/db_apcontact) | ActivityPub compatible contacts - used in the ActivityPub implementation |
| [application](help/database/db_application) | OAuth application | | [application](help/database/db_application) | OAuth application |
| [application-marker](help/database/db_application-marker) | Timeline marker | | [application-marker](help/database/db_application-marker) | Timeline marker |