You are here

function edit_limit_schema in Edit Limit 6

Same name and namespace in other branches
  1. 7 edit_limit.install \edit_limit_schema()

Implementation of hook_schema().

File

./edit_limit.install, line 10
edit_limit.install Set up the database tables for Edit Limit.

Code

function edit_limit_schema() {
  $schema['edit_limit_node_count'] = array(
    'fields' => array(
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => t('node id for the rating'),
      ),
      'count' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => t('number of times this node has been edited'),
      ),
    ),
    'primary key' => array(
      'nid',
    ),
  );
  $schema['edit_limit_comment_count'] = array(
    'fields' => array(
      'cid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => t('comment id for the rating'),
      ),
      'count' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => t('number of times this comment has been edited'),
      ),
    ),
    'primary key' => array(
      'cid',
    ),
  );
  $schema['edit_limit_node_time'] = array(
    'fields' => array(
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => t('node id to be edit-limited'),
      ),
      'time' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => t('number of seconds since initial publication this node can be edited'),
      ),
      'published' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => t('time of initial publication of this node'),
      ),
    ),
    'primary key' => array(
      'nid',
    ),
  );
  $schema['edit_limit_comment_time'] = array(
    'fields' => array(
      'cid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => t('comment id to be edit-limited'),
      ),
      'time' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => t('number of seconds since initial publication this node can be edited'),
      ),
      'published' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => t('time of initial publication of this node'),
      ),
    ),
    'primary key' => array(
      'cid',
    ),
  );
  return $schema;
}