]> git.mxchange.org Git - friendica.git/blobdiff - database.sql
Merge pull request #9955 from annando/pdo-emulate-prepares
[friendica.git] / database.sql
index 602fe08b2dce6d30b0146dbb48aa7669a62722ff..12d03225415fb130ea1c11b0f6e8f8b5b8f7f9c2 100644 (file)
@@ -1,6 +1,6 @@
 -- ------------------------------------------
 -- Friendica 2021.03-dev (Red Hot Poker)
--- DB_UPDATE_VERSION 1405
+-- DB_UPDATE_VERSION 1406
 -- ------------------------------------------
 
 
@@ -33,7 +33,8 @@ CREATE TABLE IF NOT EXISTS `gserver` (
        `next_contact` datetime DEFAULT '0001-01-01 00:00:00' COMMENT 'Next connection request',
         PRIMARY KEY(`id`),
         UNIQUE INDEX `nurl` (`nurl`(190)),
-        INDEX `next_contact` (`next_contact`)
+        INDEX `next_contact` (`next_contact`),
+        INDEX `network` (`network`)
 ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Global servers';
 
 --
@@ -89,6 +90,7 @@ CREATE TABLE IF NOT EXISTS `user` (
         INDEX `nickname` (`nickname`(32)),
         INDEX `parent-uid` (`parent-uid`),
         INDEX `guid` (`guid`),
+        INDEX `email` (`email`(64)),
        FOREIGN KEY (`parent-uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
 ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='The local users';
 
@@ -193,6 +195,7 @@ CREATE TABLE IF NOT EXISTS `contact` (
         INDEX `network_uid_lastupdate` (`network`,`uid`,`last-update`),
         INDEX `uid_network_self_lastupdate` (`uid`,`network`,`self`,`last-update`),
         INDEX `uid_lastitem` (`uid`,`last-item`),
+        INDEX `baseurl` (`baseurl`(64)),
         INDEX `gsid` (`gsid`),
        FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE,
        FOREIGN KEY (`gsid`) REFERENCES `gserver` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT
@@ -1459,10 +1462,10 @@ CREATE TABLE IF NOT EXISTS `workerqueue` (
 ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Background tasks queue entries';
 
 --
--- VIEW post-view
+-- VIEW post-user-view
 --
-DROP VIEW IF EXISTS `post-view`;
-CREATE VIEW `post-view` AS SELECT 
+DROP VIEW IF EXISTS `post-user-view`;
+CREATE VIEW `post-user-view` AS SELECT 
        `post-user`.`id` AS `id`,
        `post-user`.`id` AS `post-user-id`,
        `post-user`.`uid` AS `uid`,
@@ -1617,10 +1620,10 @@ CREATE VIEW `post-view` AS SELECT
                        LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`;
 
 --
--- VIEW post-thread-view
+-- VIEW post-thread-user-view
 --
-DROP VIEW IF EXISTS `post-thread-view`;
-CREATE VIEW `post-thread-view` AS SELECT 
+DROP VIEW IF EXISTS `post-thread-user-view`;
+CREATE VIEW `post-thread-user-view` AS SELECT 
        `post-user`.`id` AS `id`,
        `post-user`.`id` AS `post-user-id`,
        `post-thread-user`.`uid` AS `uid`,
@@ -2031,8 +2034,10 @@ CREATE VIEW `tag-search-view` AS SELECT
        `post-user`.`private` AS `private`,
        `post-user`.`wall` AS `wall`,
        `post-user`.`origin` AS `origin`,
+       `post-user`.`global` AS `global`,
        `post-user`.`gravity` AS `gravity`,
        `post-user`.`received` AS `received`,
+       `post-user`.`network` AS `network`,
        `tag`.`name` AS `name`
        FROM `post-tag`
                        INNER JOIN `tag` ON `tag`.`id` = `post-tag`.`tid`