You are here

structured_data.install in Structured Data (JSON+LD Rich Snippets) 8

Same filename and directory in other branches
  1. 7 structured_data.install

Contains install and update functions for Structured Data.

File

structured_data.install
View source
<?php

/**
 * @file
 * Contains install and update functions for Structured Data.
 */

/**
 * Implements hook_schema().
 */
function structured_data_schema() {
  $schema['structured_data_json'] = [
    'primary key' => [
      'id',
    ],
    'fields' => [
      'id' => [
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ],
      'route_name' => [
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
      ],
      'url' => [
        'type' => 'varchar',
        'length' => 1000,
      ],
      'bundle' => [
        'type' => 'varchar',
        'length' => 128,
      ],
      'entity_id' => [
        'type' => 'int',
        'length' => 10,
      ],
      'json' => [
        'type' => 'text',
      ],
      'updated_by' => [
        'type' => 'int',
        'not null' => TRUE,
      ],
      'updated_time' => [
        'type' => 'int',
        'size' => 'big',
        'not null' => TRUE,
      ],
      'ignore_query_string' => [
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ],
    ],
    'indexes' => [
      'structured_data_json_route_name' => [
        'route_name',
      ],
      'structured_data_json_url' => [
        'url',
      ],
    ],
  ];
  return $schema;
}

Functions

Namesort descending Description
structured_data_schema Implements hook_schema().