[ticket/14771] Use constants instead of magic numbers in migration

PHPBB3-14771
This commit is contained in:
Marc Alexander 2021-07-13 22:22:43 +02:00
parent 3c63116fe7
commit b55595fa87
No known key found for this signature in database
GPG key ID: 50E0D2423696F995

View file

@ -40,7 +40,7 @@ class add_audio_files_attachment_group extends \phpbb\db\migration\migration
{
$sql = 'INSERT INTO ' . $this->table_prefix . 'extension_groups ' . $this->db->sql_build_array('INSERT', [
'group_name' => 'AUDIO_FILES',
'cat_id' => 7,
'cat_id' => ATTACHMENT_CATEGORY_AUDIO,
'allow_group' => 0,
'upload_icon' => '',
'max_filesize' => 0,
@ -51,7 +51,7 @@ class add_audio_files_attachment_group extends \phpbb\db\migration\migration
}
else
{
$sql = 'UPDATE ' . $this->table_prefix . 'extension_groups SET cat_id = 7
$sql = 'UPDATE ' . $this->table_prefix . 'extension_groups SET cat_id = ' . ATTACHMENT_CATEGORY_AUDIO . '
WHERE ' . $this->db->sql_build_array('SELECT', ['group_id' => $audio_group_id]);
$this->db->sql_query($sql);
}