You are here

function gathercontent_schema in GatherContent 7.3

Same name and namespace in other branches
  1. 8.5 gathercontent.install \gathercontent_schema()
  2. 7.2 gathercontent.install \gathercontent_schema()

Implements schema for our custom entity.

@inheritdoc

File

./gathercontent.install, line 106

Code

function gathercontent_schema() {
  $schema = array();
  $schema['gathercontent_mapping'] = array(
    'description' => 'The base table for the Mapping entity',
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'gathercontent_project_id' => array(
        'type' => 'int',
        'length' => 11,
        'not null' => TRUE,
      ),
      'gathercontent_project' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'gathercontent_template_id' => array(
        'type' => 'int',
        'length' => 11,
        'not null' => TRUE,
      ),
      'gathercontent_template' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'content_type' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'default' => '',
      ),
      'data' => array(
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
        'serialize' => TRUE,
      ),
      'created' => array(
        'type' => 'int',
        'not null' => TRUE,
      ),
      'updated_drupal' => array(
        'type' => 'int',
        'not null' => FALSE,
      ),
      'template' => array(
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );
  $schema['gathercontent_operation'] = array(
    'description' => 'The base table for the GC Operation entity',
    'fields' => array(
      'uuid' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'type' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'uuid',
    ),
  );
  $schema['gathercontent_operation_item'] = array(
    'description' => 'The base table for the GC Operation Item entity',
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'operation_uuid' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'created' => array(
        'description' => 'The Unix timestamp when the GatherContent operation item was created.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'changed' => array(
        'description' => 'The Unix timestamp when the GatherContent operation item was most recently saved.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'item_status' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'item_status_color' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'item_name' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'template_name' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'status' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'gathercontent_id' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'indexes' => array(
      'gc_id_created' => array(
        'gathercontent_id',
        'created',
      ),
    ),
  );
  return $schema;
}