mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-03 07:18:08 +02:00
[ticket/17507] Add id as primary key, fix schema_create_primary_key() method
PHPBB-17507
This commit is contained in:
@@ -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);
|
||||||
|
Reference in New Issue
Block a user