edit_limit.install in Edit Limit 7
Same filename and directory in other branches
Set up the database tables for Edit Limit.
File
edit_limit.installView 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
Name | Description |
---|---|
edit_limit_schema | Implements hook_schema(). |
edit_limit_uninstall | Implements hook_uninstall(). |