function node_update_8015

Add language support to the {node_access} table.

Related topics

File

drupal/core/modules/node/node.install, line 819
Install, update and uninstall functions for the node module.

Code

function node_update_8015() {

  // Add the langcode field.
  $langcode_field = array(
    'type' => 'varchar',
    'length' => 12,
    'not null' => TRUE,
    'default' => '',
    'description' => 'The {language}.langcode of this node.',
  );
  db_add_field('node_access', 'langcode', $langcode_field);

  // Add the fallback field.
  $fallback_field = array(
    'description' => 'Boolean indicating whether this record should be used as a fallback if a language condition is not provided.',
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 1,
  );
  db_add_field('node_access', 'fallback', $fallback_field);
  db_drop_primary_key('node_access');
  db_add_primary_key('node_access', array(
    'nid',
    'gid',
    'realm',
    'langcode',
  ));
}