You are here

comment_alter.install in Comment Alter 8

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

Install and uninstall functions for the Comment Alter module.

File

comment_alter.install
View source
<?php

/**
 * @file
 * Install and uninstall functions for the Comment Alter module.
 */
use Drupal\Core\Entity\EntityTypeInterface;

/**
 * Implements hook_schema().
 */
function comment_alter_schema() {
  $schema['comment_alter'] = [
    'description' => 'Stores the old and new entity revision ID as altered by comment.',
    'fields' => [
      'cid' => [
        'description' => 'The {comment}.cid this change refers to.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ],
      'parent_entity_type' => [
        'description' => 'Entity type of the parent entity.',
        'type' => 'varchar_ascii',
        'length' => EntityTypeInterface::ID_MAX_LENGTH,
        'not null' => TRUE,
        'default' => 'node',
      ],
      'old_vid' => [
        'description' => 'The old entity revision ID this change refers to.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ],
      'new_vid' => [
        'description' => 'The new entity revision ID this change refers to.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ],
    ],
    'indexes' => [
      'parent_entity_type' => [
        'parent_entity_type',
      ],
      'new_vid' => [
        'new_vid',
      ],
      'old_vid' => [
        'old_vid',
      ],
    ],
    'primary key' => [
      'cid',
    ],
  ];
  return $schema;
}

Functions

Namesort descending Description
comment_alter_schema Implements hook_schema().