I need to add a information to a content types within my module. Generally, is it good practise to update node_type schema or is it better to create my own and join it to the node_type via primary key?


1 Answer 1


You should make use of the hook_schema_alter to update entity schema of existing schema's.

function YOURMODULE_schema_alter(&$schema) {
  // Add field to existing schema.
  $schema['users']['fields']['timezone_id'] = array(
    'type' => 'int',
    'not null' => TRUE,
    'default' => 0,
    'description' => 'Per-user timezone configuration.',
  • 1
    It depends on the complexity of your information you need to add on your content type. If it is 1 piece of content, you generally alter the existing schema. On the other hand, if you have a lot of extra information to store, you create your own schema. It is also your job to load / save / ... the extra data which requires a lot more development if you go for option 2. Mar 3, 2015 at 7:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.