From 583914a548c4dcaeb87044011bdf7a0e2d4ca99d Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 5 Dec 2017 21:54:13 +0000 Subject: [PATCH 1/3] Removed some unused tables and functions --- database.sql | 23 ----------------------- include/dbstructure.php | 23 ----------------------- include/fcontact.php | 33 --------------------------------- 3 files changed, 79 deletions(-) delete mode 100644 include/fcontact.php diff --git a/database.sql b/database.sql index 09f1a83cc..c058c06f5 100644 --- a/database.sql +++ b/database.sql @@ -274,29 +274,6 @@ CREATE TABLE IF NOT EXISTS `fcontact` ( UNIQUE INDEX `url` (`url`(190)) ) DEFAULT COLLATE utf8mb4_general_ci; --- --- TABLE ffinder --- -CREATE TABLE IF NOT EXISTS `ffinder` ( - `id` int(10) unsigned NOT NULL auto_increment, - `uid` int(10) unsigned NOT NULL DEFAULT 0, - `cid` int(10) unsigned NOT NULL DEFAULT 0, - `fid` int(10) unsigned NOT NULL DEFAULT 0, - PRIMARY KEY(`id`) -) DEFAULT COLLATE utf8mb4_general_ci; - --- --- TABLE fserver --- -CREATE TABLE IF NOT EXISTS `fserver` ( - `id` int(11) NOT NULL auto_increment, - `server` varchar(255) NOT NULL DEFAULT '', - `posturl` varchar(255) NOT NULL DEFAULT '', - `key` text, - PRIMARY KEY(`id`), - INDEX `server` (`server`(32)) -) DEFAULT COLLATE utf8mb4_general_ci; - -- -- TABLE fsuggest -- diff --git a/include/dbstructure.php b/include/dbstructure.php index 3c620d7d7..1e47ee9ed 100644 --- a/include/dbstructure.php +++ b/include/dbstructure.php @@ -888,29 +888,6 @@ function db_definition() { "url" => array("UNIQUE", "url(190)"), ) ); - $database["ffinder"] = array( - "fields" => array( - "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")), - "cid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("contact" => "id")), - "fid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("fcontact" => "id")), - ), - "indexes" => array( - "PRIMARY" => array("id"), - ) - ); - $database["fserver"] = array( - "fields" => array( - "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "server" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), - "posturl" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), - "key" => array("type" => "text"), - ), - "indexes" => array( - "PRIMARY" => array("id"), - "server" => array("server(32)"), - ) - ); $database["fsuggest"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), diff --git a/include/fcontact.php b/include/fcontact.php deleted file mode 100644 index 7e93d067f..000000000 --- a/include/fcontact.php +++ /dev/null @@ -1,33 +0,0 @@ - $nurl, 'name' => $name, 'photo' => $photo)); - - if (DBM::is_result($r)) { - $r = q("SELECT `id` FROM `fcontact` WHERE `url` = '%s' LIMIT 1", - dbesc($nurl) - ); - if (DBM::is_result($r)) - return $r[0]['id']; - } - - return 0; -} - -function ffinder_store($uid,$cid,$fid) { - $r = dba::insert('ffinder', array('uid' => $uid, 'cid' => $cid, 'fid' => $fid)); - return $r; -} - From 45227a12a677d4fc4a83a105eb420070c340b091 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 5 Dec 2017 22:20:49 +0000 Subject: [PATCH 2/3] "item_id" and "spam" aren't used --- database.sql | 16 ---------------- include/dbstructure.php | 33 --------------------------------- include/items.php | 1 - 3 files changed, 50 deletions(-) diff --git a/database.sql b/database.sql index c058c06f5..b41c0bc54 100644 --- a/database.sql +++ b/database.sql @@ -535,22 +535,6 @@ CREATE TABLE IF NOT EXISTS `item` ( INDEX `uid_ownerlink` (`uid`,`owner-link`(190)) ) DEFAULT COLLATE utf8mb4_general_ci; --- --- TABLE item_id --- -CREATE TABLE IF NOT EXISTS `item_id` ( - `id` int(11) NOT NULL auto_increment, - `iid` int(11) NOT NULL DEFAULT 0, - `uid` int(11) NOT NULL DEFAULT 0, - `sid` varchar(255) NOT NULL DEFAULT '', - `service` varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY(`id`), - INDEX `uid` (`uid`), - INDEX `sid` (`sid`(32)), - INDEX `service` (`service`(32)), - INDEX `iid` (`iid`) -) DEFAULT COLLATE utf8mb4_general_ci; - -- -- TABLE locks -- diff --git a/include/dbstructure.php b/include/dbstructure.php index 1e47ee9ed..dae54835f 100644 --- a/include/dbstructure.php +++ b/include/dbstructure.php @@ -1149,22 +1149,6 @@ function db_definition() { "uid_ownerlink" => array("uid","owner-link(190)"), ) ); - $database["item_id"] = array( - "fields" => array( - "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "iid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("item" => "id")), - "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")), - "sid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), - "service" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), - ), - "indexes" => array( - "PRIMARY" => array("id"), - "uid" => array("uid"), - "sid" => array("sid(32)"), - "service" => array("service(32)"), - "iid" => array("iid"), - ) - ); $database["locks"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), @@ -1539,23 +1523,6 @@ function db_definition() { "iid" => array("UNIQUE", "iid"), ) ); - $database["spam"] = array( - "fields" => array( - "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")), - "spam" => array("type" => "int(11)", "not null" => "1", "default" => "0"), - "ham" => array("type" => "int(11)", "not null" => "1", "default" => "0"), - "term" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), - "date" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE), - ), - "indexes" => array( - "PRIMARY" => array("id"), - "uid" => array("uid"), - "spam" => array("spam"), - "ham" => array("ham"), - "term" => array("term(32)"), - ) - ); $database["term"] = array( "fields" => array( "tid" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), diff --git a/include/items.php b/include/items.php index 63c321819..61a9c7a1f 100644 --- a/include/items.php +++ b/include/items.php @@ -2233,7 +2233,6 @@ function drop_item($id, $interactive = true) { // Now delete them if ($parentid != "") { - $r = q("DELETE FROM `item_id` WHERE `iid` IN (%s)", dbesc($parentid)); $r = q("DELETE FROM `sign` WHERE `iid` IN (%s)", dbesc($parentid)); } From 0fb6150fae94c6787f767ba60572cd24986a10d9 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 5 Dec 2017 22:22:21 +0000 Subject: [PATCH 3/3] Updated database.sql --- database.sql | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/database.sql b/database.sql index b41c0bc54..1ff770641 100644 --- a/database.sql +++ b/database.sql @@ -909,23 +909,6 @@ CREATE TABLE IF NOT EXISTS `sign` ( UNIQUE INDEX `iid` (`iid`) ) DEFAULT COLLATE utf8mb4_general_ci; --- --- TABLE spam --- -CREATE TABLE IF NOT EXISTS `spam` ( - `id` int(11) NOT NULL auto_increment, - `uid` int(11) NOT NULL DEFAULT 0, - `spam` int(11) NOT NULL DEFAULT 0, - `ham` int(11) NOT NULL DEFAULT 0, - `term` varchar(255) NOT NULL DEFAULT '', - `date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00', - PRIMARY KEY(`id`), - INDEX `uid` (`uid`), - INDEX `spam` (`spam`), - INDEX `ham` (`ham`), - INDEX `term` (`term`(32)) -) DEFAULT COLLATE utf8mb4_general_ci; - -- -- TABLE term --