You are here

edit_limit.install in Edit Limit 7

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

Set up the database tables for Edit Limit.

File

edit_limit.install
View source
<?php

/**
 * @file
 * Set up the database tables for Edit Limit.
 */

/**
 * Implements hook_schema().
 */
function edit_limit_schema() {
  $schema['edit_limit_node_count'] = array(
    'fields' => array(
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'node id for the rating',
      ),
      'count' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => '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' => 'comment id for the rating',
      ),
      'count' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => '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' => 'node id to be edit-limited',
      ),
      'time' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'number of seconds since initial publication this node can be edited',
      ),
      'published' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => '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' => 'comment id to be edit-limited',
      ),
      'time' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'number of seconds since initial publication this node can be edited',
      ),
      'published' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'time of initial publication of this node',
      ),
    ),
    'primary key' => array(
      'cid',
    ),
  );
  return $schema;
}

/**
 * Implements hook_uninstall().
 */
function edit_limit_uninstall() {
  db_delete('variable')
    ->condition('name', 'edit_limit_%', 'LIKE')
    ->execute();
}

Functions

Namesort descending Description
edit_limit_schema Implements hook_schema().
edit_limit_uninstall Implements hook_uninstall().