View source
<?php
function track_field_changes_uninstall() {
\Drupal::config('track_field_changes.settings')
->delete();
}
function track_field_changes_schema() {
$schema['track_field_changes_audit'] = [
'description' => 'Mark wich field need to be audited',
'fields' => [
'entity_type' => [
'description' => 'The entity_type this record tracks.',
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
],
'entity_id' => [
'description' => 'The entity_id this record tracks.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
],
'timestamp' => [
'description' => 'The Unix timestamp when the change has been created',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
],
'uid' => [
'description' => '',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
],
'field_name' => [
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'description' => 'The name of this field.',
],
'before_value_text' => [
'description' => '',
'type' => 'text',
'not null' => TRUE,
'size' => 'big',
],
'after_value_text' => [
'description' => '',
'type' => 'text',
'not null' => TRUE,
'size' => 'big',
],
'type' => [
'description' => '',
'type' => 'varchar',
'length' => 8,
'not null' => TRUE,
'default' => '',
],
'log' => [
'description' => '',
'type' => 'varchar',
'length' => 256,
'not null' => TRUE,
'default' => '',
],
],
'indexes' => [
'track_field_changes' => [
'entity_type',
'entity_id',
'field_name',
],
],
];
return $schema;
}