mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-09 11:38:52 +00:00
[ticket/17525] Avoid index name duplication (auth_role_id)
phpbb_acl_groups and phpbb_acl_users have indexes with the same names (auth_role_id) which can cause issues on SQLite/Postgres PHPBB-17525
This commit is contained in:
parent
8d1f8af7c6
commit
0e0214a71d
1 changed files with 58 additions and 0 deletions
|
@ -0,0 +1,58 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* This file is part of the phpBB Forum Software package.
|
||||||
|
*
|
||||||
|
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||||
|
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||||
|
*
|
||||||
|
* For full copyright and license information, please see
|
||||||
|
* the docs/CREDITS.txt file.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace phpbb\db\migration\data\v400;
|
||||||
|
|
||||||
|
use phpbb\db\migration\migration;
|
||||||
|
|
||||||
|
class rename_auth_role_id_index extends migration
|
||||||
|
{
|
||||||
|
public static function depends_on()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'\phpbb\db\migration\data\v400\dev',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update_schema()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'drop_keys' => [
|
||||||
|
$this->table_prefix . 'acl_users' => [
|
||||||
|
'auth_role_id',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'add_index' => [
|
||||||
|
$this->table_prefix . 'acl_users' => [
|
||||||
|
'usr_auth_role_id' => ['auth_role_id'],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function revert_schema()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'drop_keys' => [
|
||||||
|
$this->table_prefix . 'acl_users' => [
|
||||||
|
'usr_auth_role_id',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'add_index' => [
|
||||||
|
$this->table_prefix . 'acl_users' => [
|
||||||
|
'auth_role_id' => ['auth_role_id'],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue