I want to alter the comment subject field title width.
Core comment module sets it to 64 characters, and I want to change it up to 100 characters.
Now I tried to alter the schema using hook_schema_alter() function. Below is my code snippet, which I tried,
/**
* Implements hook_schema_alter().
*/
function comment_alter_schema_alter(&$schema) {
if (isset($schema['comment'])) {
$schema['comment']['fields']['subject'] = array(
'type' => 'varchar',
'length' => 100,
'not null' => TRUE,
'default' => '',
'description' => 'The comment title.',
);
}
}
I am confused whether do I have to write some stuff in .install
file or not?
Now after installing module how can i check whether the width of subject field is increased or not. If I see the comment
table then it is as it is to 64 characters. I could find this in your table structure using PHPMyAdmin.