You are here

function yoast_seo_schema in Real-time SEO for Drupal 7

Implements hook_schema().

File

./yoast_seo.install, line 11
Install, update, and uninstall functions for the Yoast SEO for Drupal module.

Code

function yoast_seo_schema() {
  $schema['yoast_seo'] = array(
    'fields' => array(
      'entity_type' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The entity type this data is attached to.',
      ),
      'entity_id' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The entity id this data is attached to.',
      ),
      'revision_id' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The revision_id for the entity object this data is attached to.',
      ),
      'language' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The language of the entity.',
      ),
      'focus_keyword' => array(
        'description' => 'The focus keyword for this entity.',
        'type' => 'varchar',
        'length' => 512,
        'not null' => FALSE,
      ),
      'seo_status' => array(
        'description' => 'The SEO status in points.',
        'type' => 'float',
        'unsigned' => FALSE,
      ),
    ),
    'indexes' => array(
      'type_revision' => array(
        'entity_type',
        'revision_id',
      ),
    ),
    'primary key' => array(
      'entity_type',
      'entity_id',
      'revision_id',
      'language',
    ),
  );
  return $schema;
}