You are here

function entity_update_schema in Entity Update 8

Same name and namespace in other branches
  1. 2.0.x entity_update.install \entity_update_schema()

Implements hook_schema().

File

./entity_update.install, line 13
Entity update module (entity_update).

Code

function entity_update_schema() {
  $schema['entity_update'] = [
    'description' => 'Entity data backup table',
    'fields' => [
      'id' => [
        'type' => 'serial',
        'not null' => TRUE,
      ],
      'entity_type' => [
        'type' => 'varchar',
        'length' => '64',
        'not null' => TRUE,
      ],
      'entity_id' => [
        'type' => 'varchar',
        'length' => '64',
        'not null' => TRUE,
      ],
      'entity_class' => [
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
      ],
      'status' => [
        'type' => 'int',
        'size' => 'small',
        'default' => 0,
      ],
      'data' => [
        'type' => 'blob',
        'size' => 'big',
      ],
    ],
    'primary key' => [
      'id',
    ],
    'unique keys' => [
      'entity' => [
        'entity_type',
        'entity_id',
      ],
    ],
  ];
  return $schema;
}