This repository has been archived by the owner on Jan 27, 2021. It is now read-only.
/
NewChatDataTable.pm
70 lines (52 loc) · 2.2 KB
/
NewChatDataTable.pm
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
58
59
60
61
62
63
64
65
66
67
68
69
70
# --
# Copyright (C) 2001-2020 OTRS AG, https://otrs.com/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
# did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.
# --
package scripts::DBUpdateTo6::UpgradeDatabaseStructure::NewChatDataTable; ## no critic
use strict;
use warnings;
use parent qw(scripts::DBUpdateTo6::Base);
our @ObjectDependencies = (
'Kernel::System::DB',
'Kernel::System::Log',
);
=head1 NAME
scripts::DBUpdateTo6::UpgradeDatabaseStructure::NewChatDataTable - Adds new table for chat data.
=cut
sub Run {
my ( $Self, %Param ) = @_;
my $Verbose = $Param{CommandlineOptions}->{Verbose} || 0;
my @XMLStrings = (
# article data for Chat based backend
'<Table Name="article_data_otrs_chat">
<Column Name="id" Required="true" PrimaryKey="true" AutoIncrement="true" Type="BIGINT"/>
<Column Name="article_id" Required="true" Type="BIGINT"/>
<Column Name="chat_participant_id" Required="true" Size="255" Type="VARCHAR" />
<Column Name="chat_participant_name" Required="true" Size="255" Type="VARCHAR"/>
<Column Name="chat_participant_type" Required="true" Size="255" Type="VARCHAR"/>
<Column Name="message_text" Required="false" Size="3800" Type="VARCHAR" />
<Column Name="system_generated" Required="true" Type="SMALLINT" />
<Column Name="create_time" Required="true" Type="DATE"/>
<Index Name="article_data_otrs_chat_article_id">
<IndexColumn Name="article_id"/>
</Index>
<ForeignKey ForeignTable="article">
<Reference Local="article_id" Foreign="id"/>
</ForeignKey>
</Table>',
);
return if !$Self->ExecuteXMLDBArray(
XMLArray => \@XMLStrings,
);
return 1;
}
1;
=head1 TERMS AND CONDITIONS
This software is part of the OTRS project (L<https://otrs.org/>).
This software comes with ABSOLUTELY NO WARRANTY. For details, see
the enclosed file COPYING for license information (GPL). If you
did not receive this file, see L<https://www.gnu.org/licenses/gpl-3.0.txt>.
=cut