forked from GNUsocial/gnu-social
[DATABASE][MariaDB] Fix index changes with foreign keys enabled
This commit is contained in:
@@ -333,6 +333,21 @@ class MysqlSchema extends Schema
|
||||
$statements[] = "CREATE FULLTEXT INDEX $name ON $table " . $this->buildIndexList($def);
|
||||
}
|
||||
|
||||
/**
|
||||
* Append an SQL statement with an index definition for an advisory
|
||||
* index over one or more columns on a table.
|
||||
*
|
||||
* @param array $statements
|
||||
* @param string $table
|
||||
* @param string $name
|
||||
* @param array $def
|
||||
*/
|
||||
public function appendCreateIndex(array &$statements, $table, $name, array $def)
|
||||
{
|
||||
$statements[] = "ALTER TABLE {$this->quoteIdentifier($table)} "
|
||||
. "ADD INDEX {$name} {$this->buildIndexList($def)}";
|
||||
}
|
||||
|
||||
/**
|
||||
* Close out a 'create table' SQL statement.
|
||||
*
|
||||
@@ -456,7 +471,8 @@ class MysqlSchema extends Schema
|
||||
*/
|
||||
public function appendDropIndex(array &$statements, $table, $name)
|
||||
{
|
||||
$statements[] = "DROP INDEX {$name} ON {$this->quoteIdentifier($table)}";
|
||||
$statements[] = "ALTER TABLE {$this->quoteIdentifier($table)} "
|
||||
. "DROP INDEX {$name}";
|
||||
}
|
||||
|
||||
private function isNumericType(array $cd): bool
|
||||
|
Reference in New Issue
Block a user