You are here

function profanity_schema in Profanity 7

Implements hook_schema().

File

./profanity.install, line 10
Install file for profanity.

Code

function profanity_schema() {
  $schema['profanity_list'] = array(
    'description' => 'Word lists for the Profanity module.',
    'export' => array(
      'key' => 'name',
      'key name' => 'Name',
      'primary key' => 'name',
      'admin_title' => 'title',
      'identifier' => 'list',
      // Function hook name.
      'default hook' => 'default_profanity_list',
      'api' => array(
        'owner' => 'profanity',
        'api' => 'default_profanity_lists',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'name' => array(
        'type' => 'varchar',
        'length' => '128',
        'not null' => TRUE,
        'description' => 'Machine name.',
      ),
      'title' => array(
        'description' => 'The human-readable title for this list.',
        'type' => 'varchar',
        'length' => '255',
        'not null' => FALSE,
        'default' => '',
      ),
      'words' => array(
        'type' => 'text',
        'size' => 'big',
        'not null' => TRUE,
      ),
      'replacement_mode' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'A number which indicates the replacement mode, characters repeated or replace with phrase.',
      ),
      'replacement_character' => array(
        'type' => 'varchar',
        'length' => '128',
        'not null' => TRUE,
        'description' => 'Repeating character to replace bad words with.',
      ),
      'replacement_phrase' => array(
        'type' => 'varchar',
        'length' => '128',
        'not null' => TRUE,
        'description' => 'Replacement phrase for found bad words.',
      ),
      'case_sensitive' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'A boolean to indicate if this list should replace in a case sensitive manner.',
      ),
      'match_partial' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 1,
        'description' => 'A boolean to indicate if the word filtering should only be done if the word is not part of another word.',
      ),
    ),
    'primary key' => array(
      'name',
    ),
  );
  return $schema;
}