You are here

function amp_schema in Accelerated Mobile Pages (AMP) 7

Implements hook_install.

Add new table for unpublished AMP nodes.

File

./amp.install, line 57
Contains amp.install.

Code

function amp_schema() {
  $schema['amp_node'] = array(
    'description' => 'Stores preferences for amp nodes.',
    'primary key' => array(
      'aid',
    ),
    'fields' => array(
      'aid' => array(
        'description' => 'The {amp}.id of the amp node.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'status' => array(
        'description' => 'Boolean indicating whether the node is AMP enabled by default.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 1,
        'size' => 'tiny',
      ),
    ),
    'indexes' => array(
      'aid' => array(
        'aid',
      ),
      'status' => array(
        'status',
      ),
    ),
  );
  return $schema;
}