1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[ticket/16741] Add support for dropping primary keys and removing constraints

PHPBB3-16741
This commit is contained in:
Marc Alexander
2022-01-16 20:48:56 +01:00
parent d4b8a48f11
commit 78528d2b32
2 changed files with 71 additions and 14 deletions

View File

@@ -60,6 +60,16 @@ class sqlsrv_platform extends SQLServer2012Platform
}
}
// When dropping a primary key, the constraint needs to be dropped
foreach ($diff->removedIndexes as $key => $index)
{
if ($index->isPrimary())
{
unset($diff->removedIndexes[$key]);
$sql[] = $this->getDropConstraintSQL($index->getQuotedName($this), $diff->name);
}
}
$sql = array_merge($sql, parent::getAlterTableSQL($diff));
$doctrine_names = [];