You are here

function safeword_field_schema in Safeword 8

Same name and namespace in other branches
  1. 7 safeword.install \safeword_field_schema()

Implements hook_field_schema().

This defines the actual database schema of the field, using the format used by the Schema API.

The actual data we store here consists of two columns, one for the user visible string and another for the machine string.

Schema API

See also

hook_field_schema()

File

./safeword.install, line 20
Install/Update/Uninstall functions for safeword module

Code

function safeword_field_schema($field) {
  $columns = array(
    'human' => array(
      'type' => 'varchar',
      'length' => 255,
      'not null' => FALSE,
    ),
    'machine' => array(
      'type' => 'varchar',
      'length' => 255,
      'not null' => FALSE,
    ),
  );
  $indexes = array(
    'machine' => array(
      'machine',
    ),
  );
  return array(
    'columns' => $columns,
    'indexes' => $indexes,
  );
}