You are here

function media_acquiadam_schema in Media: Acquia DAM 8

Same name and namespace in other branches
  1. 7 media_acquiadam.install \media_acquiadam_schema()

Implements hook_schema().

1 call to media_acquiadam_schema()
media_acquiadam_update_8101 in ./media_acquiadam.install
Installs the new asset data schema if necessary.

File

./media_acquiadam.install, line 16
Installation related hooks and functions.

Code

function media_acquiadam_schema() {
  $schema = [];
  $schema['acquiadam_assets_data'] = [
    'description' => 'Acquia DAM asset information.',
    'fields' => [
      'asset_id' => [
        'description' => 'The asset ID.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ],
      'name' => [
        'description' => 'The identifier of the data.',
        'type' => 'varchar_ascii',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
      ],
      'value' => [
        'description' => 'The value.',
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
      ],
      'serialized' => [
        'description' => 'Whether value is serialized.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'default' => 0,
      ],
    ],
    'primary key' => [
      'asset_id',
      'name',
    ],
    'indexes' => [
      'asset_id' => [
        'asset_id',
      ],
      'name' => [
        'name',
      ],
    ],
  ];
  return $schema;
}