-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgenerated_content.install
57 lines (51 loc) · 1.22 KB
/
generated_content.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* @file
* Install file for Generated Content.
*/
declare(strict_types=1);
use Drupal\generated_content\GeneratedContentRepository;
/**
* Implements hook_schema().
*
* @phpstan-ignore-next-line
*/
function generated_content_schema(): array {
$schema['generated_content'] = [
'description' => 'Stores entries of generated content.',
'fields' => [
'entity_type' => [
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'description' => 'Entity type.',
],
'bundle' => [
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'description' => 'Entity bundle.',
],
'entity_id' => [
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'description' => 'Entity ID.',
],
],
'primary key' => ['entity_type', 'bundle', 'entity_id'],
'indexes' => [
'entity_type' => ['entity_type'],
'bundle' => ['bundle'],
'entity_id' => ['entity_id'],
],
];
return $schema;
}
/**
* Implements hook_uninstall().
*/
function generated_content_uninstall(): void {
$repository = GeneratedContentRepository::getInstance();
$repository->removeBatch();
}