You are here

entity_delete_log.install in Entity Delete Log 7

File

entity_delete_log.install
View source
<?php

/**
 * Implements hook_schema().
 */
function entity_delete_log_schema() {
  $schema['entity_delete_log'] = array(
    'description' => 'The base table for the entity_delete_log module.',
    'fields' => array(
      'entity_delete_log_id' => array(
        'description' => 'The primary identifier for an entity delete log entry.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'entity_id' => array(
        'description' => 'The entity id.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'entity_type' => array(
        'description' => 'The entity type.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
      ),
      'entity_bundle' => array(
        'description' => 'The entity bundle.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
        'default' => NULL,
      ),
      'entity_title' => array(
        'description' => 'The entity title.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'author' => array(
        'description' => 'The entity author user id.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 1,
      ),
      'revisions' => array(
        'description' => 'The entity revision count, if available.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
        'default' => NULL,
      ),
      'created' => array(
        'description' => 'The unix timestamp when the entity was created, if available.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
      'deleted' => array(
        'description' => 'The unix timestamp when the entity was deleted.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'uid' => array(
        'description' => 'The acting user id.',
        'type' => 'int',
        'not null' => TRUE,
      ),
      'entity' => array(
        'serialize' => TRUE,
        'type' => 'text',
        'description' => 'The serialized entity.',
        'size' => 'medium',
      ),
    ),
    'primary key' => array(
      'entity_delete_log_id',
    ),
  );
  return $schema;
}

/**
 * Implements hook_uninstall().
 */
function entity_delete_log_uninstall() {
  variable_del('entity_delete_log_entity_types');
}

/**
 * Clear the cache.
 */
function entity_delete_log_update_7000() {

  // This just has to be empty.
}

/**
 * Add a serialized entity field for deleted entities.
 */
function entity_delete_log_update_7001() {
  db_add_field('entity_delete_log', 'entity', array(
    'serialize' => TRUE,
    'type' => 'text',
    'description' => 'The serialized entity.',
    'size' => 'medium',
  ));
  return t('Added serialized entity field for deleted entities.');
}

Functions

Namesort descending Description
entity_delete_log_schema Implements hook_schema().
entity_delete_log_uninstall Implements hook_uninstall().
entity_delete_log_update_7000 Clear the cache.
entity_delete_log_update_7001 Add a serialized entity field for deleted entities.