You are here

function properties_field_schema in Dynamic properties 7

Implements hook_field_schema().

File

./properties.module, line 220
This module provides a dynamic property field that can contain an unlimited number of attribute value pairs.

Code

function properties_field_schema($field) {
  $columns = array(
    'attribute' => array(
      'type' => 'varchar',
      'length' => 255,
      'not null' => TRUE,
    ),
    'value' => array(
      'type' => 'varchar',
      'length' => 255,
      'not null' => TRUE,
    ),
    'category' => array(
      'type' => 'varchar',
      'length' => 255,
      'not null' => TRUE,
    ),
  );
  return array(
    'columns' => $columns,
    'indexes' => array(
      'attribute' => array(
        'attribute',
      ),
      'category' => array(
        'category',
      ),
    ),
  );
}