You are here

content_lock.install in Content locking (anti-concurrent editing) 6

File

content_lock.install
View source
<?php

/**
 * Implementation of hook_install().
 */
function content_lock_install() {
  drupal_install_schema('content_lock');
}

/**
 * Implementation of hook_uninstall().
 */
function content_lock_uninstall() {
  drupal_uninstall_schema('content_lock');
  variable_del('content_lock_clear');
}

/*
 * Implementaion of hook_schema().
 */
function content_lock_schema() {
  $schema['content_lock'] = array(
    'description' => 'content lock module table.',
    'fields' => array(
      'nid' => array(
        'description' => 'The primary identifier for a node.',
        'type' => 'int',
        'size' => 'normal',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'uid' => array(
        'description' => 'User that holds the lock.',
        'type' => 'int',
        'size' => 'normal',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'timestamp' => array(
        'description' => 'Time the lock occured.',
        'size' => 'normal',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(
      'user' => array(
        'uid',
      ),
    ),
    'primary key' => array(
      'nid',
    ),
  );
  return $schema;
}

Functions

Namesort descending Description
content_lock_install Implementation of hook_install().
content_lock_schema
content_lock_uninstall Implementation of hook_uninstall().