New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ticket/12873] Test the correct identifier in \phpbb\db\tools #2761
Conversation
Can you explain why there are changes to the schema file? |
I think instead of "good" you mean "correct". The first one does not really work in that context. |
For the change in the schema file, 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. |
This information should be provided as part of the commit message.
Are you aware that schema.json is an automatically generated file? |
.... off course I know... I just forgot to fix the migration instead.... |
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
updated |
@@ -731,7 +731,7 @@ public function update_schema() | |||
'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')), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arg, this seems like a bad idea. It will cause 2 different index names depending on whether you install 3.1 or updated from 3.0
However dropping the index and recreating it might be even more expensive. But I guess it's what we should do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't rename indexes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we also can not rename columns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be very very expensive on big boards... but it is very mattering if we have 2 different index names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess in this case its better to have two different names. It's unlikely that we aant to drop the index later anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nicofuma we decided to go with a new migration and just make the upgrade take a while.
So drop the old index and create a new one in a new migration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(The db index that is, not the whole search index.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
PHPBB3-12873
[ticket/12873] Test the correct identifier in \phpbb\db\tools * Nicofuma/ticket/12873: [ticket/12873] Add migration to rename the index [ticket/12873] Don not touch the existing migrations [ticket/12873] Test the good identifier in \phpbb\db\tools
[ticket/12873] Test the correct identifier in \phpbb\db\tools * Nicofuma/ticket/12873: [ticket/12873] Add migration to rename the index [ticket/12873] Don not touch the existing migrations [ticket/12873] Test the good identifier in \phpbb\db\tools
https://tracker.phpbb.com/browse/PHPBB3-12873
https://tracker.phpbb.com/browse/PHPBB3-12770
PHPBB3-12770
PHPBB3-12873