You are here

function node_limit_type_schema in Node Limit 6

Same name and namespace in other branches
  1. 8 old/node_limit_type/node_limit_type.install \node_limit_type_schema()
  2. 7 node_limit_type/node_limit_type.install \node_limit_type_schema()

Implementation of hook_schema().

File

node_limit_type/node_limit_type.install, line 18
Installation functions for module node_limit_type.

Code

function node_limit_type_schema() {
  $schema['node_limit_type'] = array(
    'description' => t('The table for applying node limits to a content type'),
    'fields' => array(
      'lid' => array(
        'description' => t('The {node_limit}.lid'),
        'type' => 'int',
        'not null' => TRUE,
      ),
      'type' => array(
        'description' => t('The {node}.type to which this limit applies'),
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    //the limit-type combination is unique

    /**
     * this means that in the future, we may allow a limit to be applied to more
     * than one type.  right now, though, its one-type-per-limit
     */
    'primary key' => array(
      'lid',
      'type',
    ),
  );
  return $schema;
}