mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-04 14:47:52 +02:00
[ticket/12873] Test the good identifier in \phpbb\db\tools
We need to rename the index key because with the default prefix (phpbb_) this key has a length of 31. And because we don't accept the keys longer than 30 characters we should ensure that by default no key is longer than 30 characters. PHPBB3-12873
This commit is contained in:
parent
d5f87e6053
commit
919aeb3879
@ -2397,7 +2397,7 @@
|
||||
]
|
||||
},
|
||||
"KEYS": {
|
||||
"unq_mtch": [
|
||||
"un_mtch": [
|
||||
"UNIQUE",
|
||||
[
|
||||
"word_id",
|
||||
|
@ -731,7 +731,7 @@ class release_3_0_0 extends \phpbb\db\migration\migration
|
||||
'title_match' => array('BOOL', 0),
|
||||
),
|
||||
'KEYS' => array(
|
||||
'unq_mtch' => array('UNIQUE', array('word_id', 'post_id', 'title_match')),
|
||||
'un_mtch' => array('UNIQUE', array('word_id', 'post_id', 'title_match')),
|
||||
'word_id' => array('INDEX', 'word_id'),
|
||||
'post_id' => array('INDEX', 'post_id'),
|
||||
),
|
||||
|
@ -2079,7 +2079,7 @@ class tools
|
||||
$statements = array();
|
||||
|
||||
$table_prefix = substr(CONFIG_TABLE, 0, -6); // strlen(config)
|
||||
if (strlen($table_name . $index_name) - strlen($table_prefix) > 24)
|
||||
if (strlen($table_name . '_' . $index_name) - strlen($table_prefix) > 24)
|
||||
{
|
||||
$max_length = strlen($table_prefix) + 24;
|
||||
trigger_error("Index name '{$table_name}_$index_name' on table '$table_name' is too long. The maximum is $max_length characters.", E_USER_ERROR);
|
||||
|
Loading…
x
Reference in New Issue
Block a user