acquia_perz-4.0.0-rc1/modules/acquia_perz_push/acquia_perz_push.install
modules/acquia_perz_push/acquia_perz_push.install
<?php
/**
* @file
* Acquia Perz - module install file.
*/
use Drupal\Core\Database\Database;
/**
* Implements hook_schema().
*/
function acquia_perz_push_schema() {
$schema = [];
$schema['acquia_perz_push_export_tracking'] = [
'description' => 'Table for tracking which entities have been exported to CIS.',
'fields' => [
'id' => [
'type' => 'serial',
'not null' => TRUE,
],
'entity_type' => [
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => '',
],
'entity_id' => [
'type' => 'varchar_ascii',
'length' => 255,
'not null' => TRUE,
'default' => '',
],
'entity_uuid' => [
'type' => 'char',
'length' => 36,
'not null' => TRUE,
'default' => '',
],
'langcode' => [
'description' => 'The {language}.langcode of the exported entity.',
'type' => 'varchar_ascii',
'length' => 12,
'not null' => TRUE,
'default' => '',
],
'status' => [
'description' => 'The status of an exported entity.',
'type' => 'varchar',
'default' => '',
'not null' => TRUE,
'length' => 36,
],
'modified' => [
'description' => "The entity's modified value.",
'type' => 'varchar',
'default' => '',
'not null' => TRUE,
'length' => 36,
],
],
'primary key' => ['id'],
'unique keys' => [
'entity' => ['entity_type', 'entity_id', 'langcode'],
'entity_uuid' => ['entity_uuid', 'langcode'],
],
];
return $schema;
}
/**
* Implements hook_update_N().
*
* Add auto-increment column.
*/
function acquia_perz_push_update_9401(): void {
$schema = Database::getConnection()->schema();
$schema->addField(
'acquia_perz_push_export_tracking',
'id',
['type' => 'serial', 'not null' => TRUE],
['primary key' => ['id']]
);
}
