X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fmysqlschema.php;h=435ba4e3a95f57f3ca0ba314db4fb483d0ca0b83;hb=fb4b004435403dd0d4126a0c11c9fa5c557e9dba;hp=a2581e6d81a2bd842279545ba8750ca02e677f72;hpb=f5019ac5aac229b9ac118a905703c675688e4ed0;p=quix0rs-gnu-social.git diff --git a/lib/mysqlschema.php b/lib/mysqlschema.php index a2581e6d81..435ba4e3a9 100644 --- a/lib/mysqlschema.php +++ b/lib/mysqlschema.php @@ -244,6 +244,20 @@ class MysqlSchema extends Schema return $this->fetchQueryData($sql); } + /** + * Append an SQL statement with an index definition for a full-text search + * index over one or more columns on a table. + * + * @param array $statements + * @param string $table + * @param string $name + * @param array $def + */ + function appendCreateFulltextIndex(array &$statements, $table, $name, array $def) + { + $statements[] = "CREATE FULLTEXT INDEX $name ON $table " . $this->buildIndexList($def); + } + /** * Close out a 'create table' SQL statement. * @@ -284,6 +298,16 @@ class MysqlSchema extends Schema return "{$tableName}_{$columnName}_idx"; } + /** + * MySQL doesn't take 'DROP CONSTRAINT', need to treat primary keys as + * if they were indexes here, but can use 'PRIMARY KEY' special name. + * + * @param array $phrase + */ + function appendAlterDropPrimary(array &$phrase) + { + $phrase[] = 'DROP PRIMARY KEY'; + } /** * MySQL doesn't take 'DROP CONSTRAINT', need to treat unique keys as