123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938 |
- <?php
- function node_schema() {
- $schema['node'] = array(
- 'description' => 'The base table for nodes.',
- 'fields' => array(
- 'nid' => array(
- 'description' => 'The primary identifier for a node.',
- 'type' => 'serial',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ),
-
-
- 'vid' => array(
- 'description' => 'The current {node_revision}.vid version identifier.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => FALSE,
- 'default' => NULL,
- ),
- 'type' => array(
- 'description' => 'The {node_type}.type of this node.',
- 'type' => 'varchar',
- 'length' => 32,
- 'not null' => TRUE,
- 'default' => '',
- ),
- 'language' => array(
- 'description' => 'The {languages}.language of this node.',
- 'type' => 'varchar',
- 'length' => 12,
- 'not null' => TRUE,
- 'default' => '',
- ),
- 'title' => array(
- 'description' => 'The title of this node, always treated as non-markup plain text.',
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
- 'default' => '',
- ),
- 'uid' => array(
- 'description' => 'The {users}.uid that owns this node; initially, this is the user that created it.',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'status' => array(
- 'description' => 'Boolean indicating whether the node is published (visible to non-administrators).',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 1,
- ),
- 'created' => array(
- 'description' => 'The Unix timestamp when the node was created.',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'changed' => array(
- 'description' => 'The Unix timestamp when the node was most recently saved.',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'comment' => array(
- 'description' => 'Whether comments are allowed on this node: 0 = no, 1 = closed (read only), 2 = open (read/write).',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'promote' => array(
- 'description' => 'Boolean indicating whether the node should be displayed on the front page.',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'sticky' => array(
- 'description' => 'Boolean indicating whether the node should be displayed at the top of lists in which it appears.',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'tnid' => array(
- 'description' => 'The translation set id for this node, which equals the node id of the source post in each set.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'translate' => array(
- 'description' => 'A boolean indicating whether this translation page needs to be updated.',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- ),
- 'indexes' => array(
- 'node_changed' => array('changed'),
- 'node_created' => array('created'),
- 'node_frontpage' => array('promote', 'status', 'sticky', 'created'),
- 'node_status_type' => array('status', 'type', 'nid'),
- 'node_title_type' => array('title', array('type', 4)),
- 'node_type' => array(array('type', 4)),
- 'uid' => array('uid'),
- 'tnid' => array('tnid'),
- 'translate' => array('translate'),
- 'language' => array('language'),
- ),
- 'unique keys' => array(
- 'vid' => array('vid'),
- ),
- 'foreign keys' => array(
- 'node_revision' => array(
- 'table' => 'node_revision',
- 'columns' => array('vid' => 'vid'),
- ),
- 'node_author' => array(
- 'table' => 'users',
- 'columns' => array('uid' => 'uid'),
- ),
- ),
- 'primary key' => array('nid'),
- );
- $schema['node_access'] = array(
- 'description' => 'Identifies which realm/grant pairs a user must possess in order to view, update, or delete specific nodes.',
- 'fields' => array(
- 'nid' => array(
- 'description' => 'The {node}.nid this record affects.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'gid' => array(
- 'description' => "The grant ID a user must possess in the specified realm to gain this row's privileges on the node.",
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'realm' => array(
- 'description' => 'The realm in which the user must possess the grant ID. Each node access node can define one or more realms.',
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
- 'default' => '',
- ),
- 'grant_view' => array(
- 'description' => 'Boolean indicating whether a user with the realm/grant pair can view this node.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- 'size' => 'tiny',
- ),
- 'grant_update' => array(
- 'description' => 'Boolean indicating whether a user with the realm/grant pair can edit this node.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- 'size' => 'tiny',
- ),
- 'grant_delete' => array(
- 'description' => 'Boolean indicating whether a user with the realm/grant pair can delete this node.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- 'size' => 'tiny',
- ),
- ),
- 'primary key' => array('nid', 'gid', 'realm'),
- 'foreign keys' => array(
- 'affected_node' => array(
- 'table' => 'node',
- 'columns' => array('nid' => 'nid'),
- ),
- ),
- );
- $schema['node_revision'] = array(
- 'description' => 'Stores information about each saved version of a {node}.',
- 'fields' => array(
- 'nid' => array(
- 'description' => 'The {node} this version belongs to.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'vid' => array(
- 'description' => 'The primary identifier for this version.',
- 'type' => 'serial',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ),
- 'uid' => array(
- 'description' => 'The {users}.uid that created this version.',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'title' => array(
- 'description' => 'The title of this version.',
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
- 'default' => '',
- ),
- 'log' => array(
- 'description' => 'The log entry explaining the changes in this version.',
- 'type' => 'text',
- 'not null' => TRUE,
- 'size' => 'big',
- ),
- 'timestamp' => array(
- 'description' => 'A Unix timestamp indicating when this version was created.',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'status' => array(
- 'description' => 'Boolean indicating whether the node (at the time of this revision) is published (visible to non-administrators).',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 1,
- ),
- 'comment' => array(
- 'description' => 'Whether comments are allowed on this node (at the time of this revision): 0 = no, 1 = closed (read only), 2 = open (read/write).',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'promote' => array(
- 'description' => 'Boolean indicating whether the node (at the time of this revision) should be displayed on the front page.',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'sticky' => array(
- 'description' => 'Boolean indicating whether the node (at the time of this revision) should be displayed at the top of lists in which it appears.',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- ),
- 'indexes' => array(
- 'nid' => array('nid'),
- 'uid' => array('uid'),
- ),
- 'primary key' => array('vid'),
- 'foreign keys' => array(
- 'versioned_node' => array(
- 'table' => 'node',
- 'columns' => array('nid' => 'nid'),
- ),
- 'version_author' => array(
- 'table' => 'users',
- 'columns' => array('uid' => 'uid'),
- ),
- ),
- );
- $schema['node_type'] = array(
- 'description' => 'Stores information about all defined {node} types.',
- 'fields' => array(
- 'type' => array(
- 'description' => 'The machine-readable name of this type.',
- 'type' => 'varchar',
- 'length' => 32,
- 'not null' => TRUE,
- ),
- 'name' => array(
- 'description' => 'The human-readable name of this type.',
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
- 'default' => '',
- 'translatable' => TRUE,
- ),
- 'base' => array(
- 'description' => 'The base string used to construct callbacks corresponding to this node type.',
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
- ),
- 'module' => array(
- 'description' => 'The module defining this node type.',
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
- ),
- 'description' => array(
- 'description' => 'A brief description of this type.',
- 'type' => 'text',
- 'not null' => TRUE,
- 'size' => 'medium',
- 'translatable' => TRUE,
- ),
- 'help' => array(
- 'description' => 'Help information shown to the user when creating a {node} of this type.',
- 'type' => 'text',
- 'not null' => TRUE,
- 'size' => 'medium',
- 'translatable' => TRUE,
- ),
- 'has_title' => array(
- 'description' => 'Boolean indicating whether this type uses the {node}.title field.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'size' => 'tiny',
- ),
- 'title_label' => array(
- 'description' => 'The label displayed for the title field on the edit form.',
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
- 'default' => '',
- 'translatable' => TRUE,
- ),
- 'custom' => array(
- 'description' => 'A boolean indicating whether this type is defined by a module (FALSE) or by a user via Add content type (TRUE).',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- 'size' => 'tiny',
- ),
- 'modified' => array(
- 'description' => 'A boolean indicating whether this type has been modified by an administrator; currently not used in any way.',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- 'size' => 'tiny',
- ),
- 'locked' => array(
- 'description' => 'A boolean indicating whether the administrator can change the machine name of this type.',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- 'size' => 'tiny',
- ),
- 'disabled' => array(
- 'description' => 'A boolean indicating whether the node type is disabled.',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- 'size' => 'tiny'
- ),
- 'orig_type' => array(
- 'description' => 'The original machine-readable name of this node type. This may be different from the current type name if the locked field is 0.',
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
- 'default' => '',
- ),
- ),
- 'primary key' => array('type'),
- );
- $schema['block_node_type'] = array(
- 'description' => 'Sets up display criteria for blocks based on content types',
- 'fields' => array(
- 'module' => array(
- 'type' => 'varchar',
- 'length' => 64,
- 'not null' => TRUE,
- 'description' => "The block's origin module, from {block}.module.",
- ),
- 'delta' => array(
- 'type' => 'varchar',
- 'length' => 32,
- 'not null' => TRUE,
- 'description' => "The block's unique delta within module, from {block}.delta.",
- ),
- 'type' => array(
- 'type' => 'varchar',
- 'length' => 32,
- 'not null' => TRUE,
- 'description' => "The machine-readable name of this type from {node_type}.type.",
- ),
- ),
- 'primary key' => array('module', 'delta', 'type'),
- 'indexes' => array(
- 'type' => array('type'),
- ),
- );
- $schema['history'] = array(
- 'description' => 'A record of which {users} have read which {node}s.',
- 'fields' => array(
- 'uid' => array(
- 'description' => 'The {users}.uid that read the {node} nid.',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'nid' => array(
- 'description' => 'The {node}.nid that was read.',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'timestamp' => array(
- 'description' => 'The Unix timestamp at which the read occurred.',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- ),
- 'primary key' => array('uid', 'nid'),
- 'indexes' => array(
- 'nid' => array('nid'),
- ),
- );
- return $schema;
- }
- function node_install() {
-
- db_insert('node_access')
- ->fields(array(
- 'nid' => 0,
- 'gid' => 0,
- 'realm' => 'all',
- 'grant_view' => 1,
- 'grant_update' => 0,
- 'grant_delete' => 0,
- ))
- ->execute();
- }
- function node_update_dependencies() {
-
-
-
-
-
- $dependencies['node'][7006] = array(
- 'system' => 7027,
- 'filter' => 7000,
- );
-
-
-
- $dependencies['node'][7008] = array(
- 'user' => 7007,
- );
- return $dependencies;
- }
- function _update_7000_node_get_types() {
- $node_types = db_query('SELECT * FROM {node_type}')->fetchAllAssoc('type', PDO::FETCH_OBJ);
-
- $all_types = db_query('SELECT DISTINCT type FROM {node}')->fetchCol();
- $extra_types = array_diff($all_types, array_keys($node_types));
- foreach ($extra_types as $type) {
- $type_object = new stdClass();
- $type_object->type = $type;
-
-
-
-
-
- $type_object->has_body = 1;
- $type_object->body_label = 'Body';
- $node_types[$type_object->type] = $type_object;
- }
- return $node_types;
- }
- function node_update_7000() {
-
- db_change_field('node_type', 'module', 'base', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE));
- db_add_field('node_type', 'module', array(
- 'description' => 'The module defining this node type.',
- 'type' => 'varchar',
- 'default' => '',
- 'length' => 255,
- 'not null' => TRUE,
- ));
- db_add_field('node_type', 'disabled', array(
- 'description' => 'A boolean indicating whether the node type is disabled.',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- 'size' => 'tiny'
- ));
- $modules = db_select('system', 's')
- ->fields('s', array('name'))
- ->condition('type', 'module');
- db_update('node_type')
- ->expression('module', 'base')
- ->condition('base', $modules, 'IN')
- ->execute();
- db_update('node_type')
- ->fields(array('base' => 'node_content'))
- ->condition('base', 'node')
- ->execute();
- }
- function node_update_7001() {
- db_rename_table('node_revisions', 'node_revision');
- }
- function node_update_7002() {
- db_drop_index('node', 'node_promote_status');
- db_add_index('node', 'node_frontpage', array('promote', 'status', 'sticky', 'created'));
- }
- function node_update_7003() {
- if (drupal_get_installed_schema_version('statistics') == SCHEMA_UNINSTALLED) {
- db_drop_table('node_counter');
- }
- }
- function node_update_7004() {
-
- $original_length = variable_get('teaser_length', 600);
- $original_preview = variable_get('node_preview', 0);
-
- $original_preview ? $original_preview = 2 : $original_preview = 1;
- node_type_cache_reset();
-
- foreach (_update_7000_node_get_types() as $type => $type_object) {
- variable_set('teaser_length_' . $type, $original_length);
- variable_set('node_preview_' . $type, $original_preview);
- }
-
- variable_del('node_preview');
- }
- function node_update_7005() {
- foreach (array('status', 'comment', 'promote', 'sticky') as $column) {
- db_add_field('node_revision', $column, array(
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- ));
- }
- }
- function node_update_7006(&$sandbox) {
- $sandbox['#finished'] = 0;
-
- node_type_cache_reset();
- if (!isset($sandbox['total'])) {
-
-
- $body_field = array(
- 'field_name' => 'body',
- 'type' => 'text_with_summary',
- 'module' => 'text',
- 'cardinality' => 1,
- 'entity_types' => array('node'),
- 'translatable' => TRUE,
- );
- _update_7000_field_create_field($body_field);
- $default_trim_length = variable_get('teaser_length', 600);
-
- $node_types = _update_7000_node_get_types();
-
- foreach ($node_types as $node_type) {
- if ($node_type->has_body) {
- $trim_length = variable_get('teaser_length_' . $node_type->type, $default_trim_length);
- $instance = array(
- 'entity_type' => 'node',
- 'bundle' => $node_type->type,
- 'label' => $node_type->body_label,
- 'description' => isset($node_type->description) ? $node_type->description : '',
- 'required' => (isset($node_type->min_word_count) && $node_type->min_word_count > 0) ? 1 : 0,
- 'widget' => array(
- 'type' => 'text_textarea_with_summary',
- 'settings' => array(
- 'rows' => 20,
- 'summary_rows' => 5,
- ),
- 'weight' => -4,
- 'module' => 'text',
- ),
- 'settings' => array('display_summary' => TRUE),
- 'display' => array(
- 'default' => array(
- 'label' => 'hidden',
- 'type' => 'text_default',
- ),
- 'teaser' => array(
- 'label' => 'hidden',
- 'type' => 'text_summary_or_trimmed',
- 'trim_length' => $trim_length,
- ),
- ),
- );
- _update_7000_field_create_instance($body_field, $instance);
- variable_del('teaser_length_' . $node_type->type);
- }
-
- $sandbox['node_types_info'][$node_type->type] = array(
- 'has_body' => $node_type->has_body,
- );
- }
-
- $sandbox['existing_text_formats'] = db_query("SELECT format FROM {filter_format}")->fetchCol();
-
- $sandbox['last'] = 0;
- $sandbox['count'] = 0;
- $query = db_select('node', 'n');
- $query->join('node_revision', 'nr', 'n.nid = nr.nid');
- $sandbox['total'] = $query->countQuery()->execute()->fetchField();
- $sandbox['body_field_id'] = $body_field['id'];
- }
- else {
-
- $found = FALSE;
- if ($sandbox['total']) {
-
- $batch_size = 200;
- $query = db_select('node_revision', 'nr');
- $query->innerJoin('node', 'n', 'n.nid = nr.nid');
- $query
- ->fields('nr', array('nid', 'vid', 'body', 'teaser', 'format'))
- ->fields('n', array('type', 'status', 'comment', 'promote', 'sticky', 'language'))
- ->condition('nr.vid', $sandbox['last'], '>')
- ->orderBy('nr.vid', 'ASC')
- ->range(0, $batch_size);
- $revisions = $query->execute();
-
-
-
-
-
-
-
- foreach ($revisions as $revision) {
- $found = TRUE;
- if ($sandbox['node_types_info'][$revision->type]['has_body']) {
- $node = (object) array(
- 'nid' => $revision->nid,
- 'vid' => $revision->vid,
- 'type' => $revision->type,
- );
-
-
-
- $langcode = empty($revision->language) ? LANGUAGE_NONE : $revision->language;
- if (!empty($revision->teaser) && $revision->teaser != text_summary($revision->body)) {
- $node->body[$langcode][0]['summary'] = $revision->teaser;
- }
-
- $break = '<!--break-->';
- if (substr($revision->body, 0, strlen($break)) == $break) {
- $revision->body = substr($revision->body, strlen($break));
- }
- $node->body[$langcode][0]['value'] = $revision->body;
-
-
-
-
-
- if (empty($revision->body) && empty($revision->format)) {
- $node->body[$langcode][0]['format'] = NULL;
- }
- elseif (!in_array($revision->format, $sandbox['existing_text_formats'])) {
- $node->body[$langcode][0]['format'] = variable_get('filter_default_format', 1);
- }
- else {
- $node->body[$langcode][0]['format'] = $revision->format;
- }
-
-
- _update_7000_field_sql_storage_write('node', $node->type, $node->nid, $node->vid, 'body', $node->body);
- }
-
- db_update('node_revision')
- ->fields(array(
- 'status' => $revision->status,
- 'comment' => $revision->comment,
- 'promote' => $revision->promote,
- 'sticky' => $revision->sticky,
- ))
- ->condition('vid', $revision->vid)
- ->execute();
- $sandbox['last'] = $revision->vid;
- $sandbox['count'] += 1;
- }
- $sandbox['#finished'] = min(0.99, $sandbox['count'] / $sandbox['total']);
- }
- if (!$found) {
-
-
- db_drop_field('node_revision', 'body');
- db_drop_field('node_revision', 'teaser');
- db_drop_field('node_revision', 'format');
-
- db_drop_field('node_type', 'has_body');
- db_drop_field('node_type', 'body_label');
-
- $sandbox['#finished'] = 1;
- }
- }
- }
- function node_update_7007() {
- db_drop_field('node_type', 'min_word_count');
- }
- function node_update_7008() {
- $roles = user_roles(FALSE, 'administer nodes');
- foreach ($roles as $rid => $role) {
- _update_7000_user_role_grant_permissions($rid, array('access content overview'), 'node');
- }
- }
- function node_update_7009() {
- db_update('node')
- ->fields(array('language' => LANGUAGE_NONE))
- ->condition('language', '')
- ->execute();
- }
- function node_update_7010() {
- $schema['block_node_type'] = array(
- 'description' => 'Sets up display criteria for blocks based on content types',
- 'fields' => array(
- 'module' => array(
- 'type' => 'varchar',
- 'length' => 64,
- 'not null' => TRUE,
- 'description' => "The block's origin module, from {block}.module.",
- ),
- 'delta' => array(
- 'type' => 'varchar',
- 'length' => 32,
- 'not null' => TRUE,
- 'description' => "The block's unique delta within module, from {block}.delta.",
- ),
- 'type' => array(
- 'type' => 'varchar',
- 'length' => 32,
- 'not null' => TRUE,
- 'description' => "The machine-readable name of this type from {node_type}.type.",
- ),
- ),
- 'primary key' => array('module', 'delta', 'type'),
- 'indexes' => array(
- 'type' => array('type'),
- ),
- );
- db_create_table('block_node_type', $schema['block_node_type']);
- }
- function node_update_7011() {
-
- db_drop_field('node', 'moderate');
- db_drop_index('node', 'node_moderate');
-
- db_change_field('node_revision', 'status', 'status', array(
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 1,
- ));
-
- db_change_field('node_type', 'module', 'module', array(
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
- ));
- }
- function node_update_7012() {
-
-
-
-
- if (variable_get('update_d6', FALSE)) {
-
-
-
-
-
-
- db_update('field_config')
- ->fields(array('translatable' => 0))
- ->condition('field_name', 'body')
- ->execute();
-
-
- foreach (array('field_data_body', 'field_revision_body') as $table) {
- db_update($table)
- ->fields(array('language' => LANGUAGE_NONE))
- ->execute();
- }
- node_type_cache_reset();
- }
- }
- function node_update_7013() {
- db_drop_unique_key('node', 'vid');
- db_change_field('node', 'vid', 'vid', array(
- 'description' => 'The current {node_revision}.vid version identifier.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => FALSE,
- 'default' => NULL,
- ));
- db_add_unique_key('node', 'vid', array('vid'));
- }
- function node_update_7014() {
- db_add_index('node', 'language', array('language'));
- }
|