You are here

function textimage_schema in Textimage 7.2

Same name and namespace in other branches
  1. 6.2 textimage.install \textimage_schema()
  2. 7.3 textimage.install \textimage_schema()

Implements hook_schema().

File

./textimage.install, line 50
Installation callback for Textimage.

Code

function textimage_schema() {
  $schema['textimage_preset'] = array(
    'export' => array(
      'key' => 'name',
      'identifier' => 'preset',
      'default hook' => 'textimage_preset',
      'api' => array(
        'owner' => 'textimage',
        'api' => 'textimage',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
      'list callback' => 'textimage_ctools_export_list',
      'load callback' => 'textimage_ctools_export_load',
    ),
    'fields' => array(
      'pid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'no export' => TRUE,
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'description' => array(
        'type' => 'text',
        'size' => 'medium',
        'not null' => TRUE,
      ),
      'settings' => array(
        'type' => 'text',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'pid',
    ),
  );
  $schema['textimage_image'] = array(
    'fields' => array(
      'pid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'file' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'data' => array(
        'type' => 'text',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'file',
    ),
  );
  return $schema;
}