mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-17 07:28:56 +00:00
[ticket/17507] Add id as primary key, fix schema_create_primary_key() method
PHPBB-17507
This commit is contained in:
parent
e4cd3ac744
commit
38ee655b2a
2 changed files with 7 additions and 3 deletions
|
@ -39,7 +39,10 @@ class remove_jabber extends migration
|
||||||
$this->table_prefix . 'user_notifications' => [
|
$this->table_prefix . 'user_notifications' => [
|
||||||
'id' => ['ULINT', null, 'auto_increment'],
|
'id' => ['ULINT', null, 'auto_increment'],
|
||||||
],
|
],
|
||||||
]
|
],
|
||||||
|
'add_primary_keys' => [
|
||||||
|
$this->table_prefix . 'user_notifications' => ['id'],
|
||||||
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -993,13 +993,14 @@ class doctrine implements tools_interface
|
||||||
* @param $column
|
* @param $column
|
||||||
* @param Schema $schema
|
* @param Schema $schema
|
||||||
* @param string $table_name
|
* @param string $table_name
|
||||||
|
* @param array|string $column_name
|
||||||
* @param bool $safe_check
|
* @param bool $safe_check
|
||||||
*
|
*
|
||||||
* @throws SchemaException
|
* @throws SchemaException
|
||||||
*/
|
*/
|
||||||
protected function schema_create_primary_key(Schema $schema, $column, string $table_name, bool $safe_check = false): void
|
protected function schema_create_primary_key(Schema $schema, string $table_name, array|string $column_name, bool $safe_check = false): void
|
||||||
{
|
{
|
||||||
$columns = (is_array($column)) ? $column : [$column];
|
$columns = (is_array($column_name)) ? $column_name : [$column_name];
|
||||||
$table = $schema->getTable($table_name);
|
$table = $schema->getTable($table_name);
|
||||||
$table->dropPrimaryKey();
|
$table->dropPrimaryKey();
|
||||||
$table->setPrimaryKey($columns);
|
$table->setPrimaryKey($columns);
|
||||||
|
|
Loading…
Add table
Reference in a new issue