You are here

views_revisions.install in Views Revisions 7

Same filename and directory in other branches
  1. 6 views_revisions.install

File

views_revisions.install
View source
<?php

/**
 * Implements hook_schema().
 */
function views_revisions_schema() {
  $schema['views_revisions'] = array(
    'description' => 'The base table for the views_revisions module.',
    'fields' => array(
      'vrvid' => array(
        'description' => 'The primary identifier for a views revisions entry.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'vid' => array(
        'description' => 'The views id.',
        'type' => 'int',
        'not null' => TRUE,
      ),
      'uid' => array(
        'description' => 'The acting user id.',
        'type' => 'int',
        'not null' => TRUE,
      ),
      'created' => array(
        'description' => 'The unix timestamp of when the revision was created.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'log' => array(
        'description' => 'The views revision log message.',
        'type' => 'text',
        'size' => 'medium',
      ),
      'data' => array(
        'description' => 'The export data of the view when the revision was created.',
        'type' => 'text',
        'size' => 'medium',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'vrvid',
    ),
  );
  return $schema;
}

/**
 * Change the data column's size from normal to medium.
 */
function views_revisions_update_7100(&$sandbox) {
  db_change_field('views_revisions', 'data', 'data', array(
    'type' => 'text',
    'size' => 'medium',
    'not null' => TRUE,
  ));
  return t('Updated the "Views Revisions" module.');
}

Functions

Namesort descending Description
views_revisions_schema Implements hook_schema().
views_revisions_update_7100 Change the data column's size from normal to medium.