Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit ba59603

Browse files
committed
Created beskedfordeler table
1 parent 2470570 commit ba59603

File tree

2 files changed

+56
-1
lines changed

2 files changed

+56
-1
lines changed

os2forms_digital_post.install

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,12 @@ function os2forms_digital_post_schema() {
2222
* Enable Beskedfordeler module.
2323
*/
2424
function os2forms_digital_post_update_9001() {
25-
\Drupal::service('module_installer')->install(['beskedfordeler']);
25+
Drupal::service('module_installer')->install(['beskedfordeler']);
26+
}
27+
28+
/**
29+
* Create beskedfordeler table.
30+
*/
31+
function os2forms_digital_post_update_9002() {
32+
Drupal::service(BeskedfordelerHelper::class)->update9002();
2633
}

src/Helper/BeskedfordelerHelper.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,52 @@ public function schema(): array {
161161
];
162162
}
163163

164+
/**
165+
* Implements hook_update_N().
166+
*
167+
* Creates beskedfordeler table.
168+
*/
169+
public function update9002() {
170+
$spec = [
171+
'description' => 'OSForms digital post beskedfordeler',
172+
'fields' => [
173+
'submission_id' => [
174+
'description' => 'The submission id.',
175+
'type' => 'int',
176+
'not null' => TRUE,
177+
],
178+
'message_uuid' => [
179+
'description' => 'The message UUID (formatted with dashes).',
180+
'type' => 'varchar',
181+
'length' => 36,
182+
'not null' => TRUE,
183+
],
184+
'message' => [
185+
'description' => 'The MeMo message (XML).',
186+
'type' => 'text',
187+
'size' => 'medium',
188+
'not null' => TRUE,
189+
],
190+
'receipt' => [
191+
'description' => 'The MeMo message receipt (XML).',
192+
'type' => 'text',
193+
'size' => 'medium',
194+
'not null' => TRUE,
195+
],
196+
'beskedfordeler_message' => [
197+
'description' => 'The Beskedfordeler message (XML).',
198+
'type' => 'text',
199+
'size' => 'medium',
200+
'not null' => FALSE,
201+
],
202+
],
203+
'indexes' => [
204+
'submission_id' => ['submission_id'],
205+
],
206+
'primary key' => ['message_uuid'],
207+
];
208+
209+
$this->database->schema()->createTable(self::TABLE_NAME, $spec);
210+
}
211+
164212
}

0 commit comments

Comments
 (0)