You are here

function gc_schema in GatherContent 8

Implements schema for our custom entity.

@inheritdoc

File

./gathercontent.install, line 66
Install and uninstall script for GatherContent module.

Code

function gc_schema() {
  $schema = array();
  $schema['gc_mapping'] = array(
    'description' => 'The base table for the Mapping entity',
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'gc_project_id' => array(
        'type' => 'int',
        'length' => 11,
        'not null' => TRUE,
      ),
      'gc_project' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'gc_template_id' => array(
        'type' => 'int',
        'length' => 11,
        'not null' => TRUE,
      ),
      'gc_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['gc_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['gc_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' => '',
      ),
      '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' => '',
      ),
      'gc_id' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );
  return $schema;
}