You are here

function fieldgroup_schema in Content Construction Kit (CCK) 6.2

Same name and namespace in other branches
  1. 6.3 modules/fieldgroup/fieldgroup.install \fieldgroup_schema()
  2. 6 modules/fieldgroup/fieldgroup.install \fieldgroup_schema()

Implementation of hook_schema.

File

modules/fieldgroup/fieldgroup.install, line 48
Implementation of hook_install().

Code

function fieldgroup_schema() {
  $schema['content_group'] = array(
    'fields' => array(
      'group_type' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => 'standard',
      ),
      'type_name' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'group_name' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'label' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'settings' => array(
        'type' => 'text',
        'size' => 'medium',
        'not null' => TRUE,
      ),
      'weight' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'type_name',
      'group_name',
    ),
  );
  $schema['content_group_fields'] = array(
    'fields' => array(
      'type_name' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'group_name' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'field_name' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'type_name',
      'group_name',
      'field_name',
    ),
  );
  return $schema;
}