@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator

Do not create search_documentfield table; update docs

Summary:
Per rP719dd6d3f44245e935b21291a59338a819938c49 and previous rP6cedd4a95cfc23a1679400fb64863c49f24f2306, remove the `search_documentfield` table from initial creation (`quickstart.sql`) and Diviner database docs.

Pointed out in Q82.

Additional context:
MySQL 5.6.4 released 2011-12-20 "now supports FULLTEXT indexes for InnoDB tables" per https://forums.mysql.com/read.php?3,506409 and per https://downloads.mysql.com/docs/mysql-5.6-relnotes-en.pdf pages 230 and 233.
Per https://www.oracle.com/us/support/library/lifetime-support-technology-069183.pdf page 29, "Extended Support Ends" for "MySQL Database 5.6" in "Feb 2021".
MariaDB went for version 10 instead of 5.6 per https://mariadb.org/mariadb-10-0-and-mysql-5-6/; MariaDB 10.0 saw its End of Life date on "31 Mar 2019" per https://mariadb.org/about/#maintenance-policy

Test Plan:
* As an admin, go to `/config/issue/` which triggers `PhabricatorSetupCheck::runNormalChecks()` and thus runs database checks.
* Install a fresh instance of Phorge which runs quickstart.sql, for example setting `"storage.default-namespace": "test"` inside `conf/local/local.json` and see that things still works, like Phriction search by name etc.

Reviewers: O1 Blessed Committers, mainframe98, valerio.bozzolan

Reviewed By: O1 Blessed Committers, mainframe98, valerio.bozzolan

Subscribers: mainframe98, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25895

+5 -39
-17
resources/sql/quickstart.sql
··· 9385 9385 9386 9386 SET character_set_client = {$CHARSET} ; 9387 9387 9388 - CREATE TABLE `search_documentfield` ( 9389 - `phid` varbinary(64) NOT NULL, 9390 - `phidType` varchar(4) CHARACTER SET {$CHARSET} COLLATE {$COLLATE_TEXT} NOT NULL, 9391 - `field` varchar(4) CHARACTER SET {$CHARSET} COLLATE {$COLLATE_TEXT} NOT NULL, 9392 - `auxPHID` varbinary(64) DEFAULT NULL, 9393 - `corpus` longtext CHARACTER SET {$CHARSET_FULLTEXT} COLLATE {$COLLATE_FULLTEXT}, 9394 - `stemmedCorpus` longtext CHARACTER SET {$CHARSET_SORT} COLLATE {$COLLATE_SORT}, 9395 - KEY `phid` (`phid`), 9396 - FULLTEXT KEY `key_corpus` (`corpus`,`stemmedCorpus`) 9397 - ) ENGINE=MyISAM DEFAULT CHARSET={$CHARSET} COLLATE={$COLLATE_TEXT}; 9398 - 9399 - USE `{$NAMESPACE}_search`; 9400 - 9401 - SET NAMES utf8 ; 9402 - 9403 - SET character_set_client = {$CHARSET} ; 9404 - 9405 9388 CREATE TABLE `search_documentrelationship` ( 9406 9389 `phid` varbinary(64) NOT NULL, 9407 9390 `relatedPHID` varbinary(64) NOT NULL,
+4 -18
src/applications/config/check/PhabricatorMySQLSetupCheck.php
··· 167 167 "(in the %s section) and then restart %s:\n\n". 168 168 "%s\n". 169 169 "(You can also use a different file if you prefer. The file ". 170 - "suggested above has about 50 of the most common English words.)\n\n". 171 - "Finally, run this command to rebuild indexes using the new ". 172 - "rules:\n\n". 173 - "%s", 170 + "suggested above has about 50 of the most common English words.)", 174 171 $host_name, 175 172 phutil_tag('tt', array(), 'my.cnf'), 176 173 phutil_tag('tt', array(), '[mysqld]'), 177 174 phutil_tag('tt', array(), 'mysqld'), 178 - phutil_tag('pre', array(), 'ft_stopword_file='.$stopword_path), 179 - phutil_tag( 180 - 'pre', 181 - array(), 182 - "mysql> REPAIR TABLE {$namespace}_search.search_documentfield;")); 175 + phutil_tag('pre', array(), 'ft_stopword_file='.$stopword_path)); 183 176 184 177 $this->newIssue('mysql.ft_stopword_file') 185 178 ->setName(pht('MySQL is Using Default Stopword File')) ··· 215 208 "only MySQL fulltext search is affected.\n\n". 216 209 "To reduce the minimum word length to 3, add this to your %s file ". 217 210 "(in the %s section) and then restart %s:\n\n". 218 - "%s\n". 219 - "Finally, run this command to rebuild indexes using the new ". 220 - "rules:\n\n". 221 - "%s", 211 + "%s\n", 222 212 $host_name, 223 213 phutil_tag('tt', array(), 'my.cnf'), 224 214 phutil_tag('tt', array(), '[mysqld]'), 225 215 phutil_tag('tt', array(), 'mysqld'), 226 - phutil_tag('pre', array(), 'ft_min_word_len=3'), 227 - phutil_tag( 228 - 'pre', 229 - array(), 230 - "mysql> REPAIR TABLE {$namespace}_search.search_documentfield;")); 216 + phutil_tag('pre', array(), 'ft_min_word_len=3')); 231 217 232 218 $this->newIssue('mysql.ft_min_word_len') 233 219 ->setName(pht('MySQL is Using Default Minimum Word Length'))
+1 -4
src/docs/contributor/database.diviner
··· 10 10 Phorge uses MySQL or another MySQL-compatible database (like MariaDB 11 11 or Amazon RDS). 12 12 13 - Phorge uses the InnoDB table engine. The only exception is the 14 - `search_documentfield` table which uses MyISAM because MySQL doesn't support 15 - fulltext search in InnoDB (recent versions do, but we haven't added support 16 - yet). 13 + Phorge uses the InnoDB table engine. 17 14 18 15 We are unlikely to ever support other incompatible databases like PostgreSQL or 19 16 SQLite.