Skip to content

Commit

Permalink
Increased size of text columns for standard templates and notificatio…
Browse files Browse the repository at this point in the history
…n event messages.
  • Loading branch information
jepf committed Nov 22, 2023
1 parent 49480e7 commit 901f10f
Show file tree
Hide file tree
Showing 8 changed files with 111 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 6.5.5 2023-??-??
- 2023-11-17 Increased size of text columns for standard templates and notification event messages. Thanks for reporting to @BurtGummer. [#504](https://github.com/znuny/Znuny/issues/504)
- 2023-11-17 Pending dashboards now show all pending tickets.
- 2023-11-06 Sector Nord AG: Fixed encoding of shown changes on subaction ViewDiff of AdminPackageManager. Thanks to Ziggy Trotter (@ZTrotter), Sector Nord AG. [PR#486](https://github.com/znuny/Znuny/pull/486)
- 2023-11-06 Sector Nord AG: Fixed CTRL+left click in ticket overviews. Thanks to Ziggy Trotter (@ZTrotter), Sector Nord AG. [PR#487](https://github.com/znuny/Znuny/pull/487)
Expand Down
8 changes: 8 additions & 0 deletions scripts/Migration/Znuny/UpgradeDatabaseStructure.pm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ sub Run {
Message => 'Increase size of columns of database table generic_agent_jobs',
Module => 'GenericAgentJobs',
},
{
Message => 'Increase size of columns of database table standard_template',
Module => 'StandardTemplate',
},
{
Message => 'Increase size of columns of database table notification_event_message',
Module => 'NotificationEventMessage',
},
);

return 1 if !@Tasks;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# --
# Copyright (C) 2021 Znuny GmbH, https://znuny.org/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

package scripts::Migration::Znuny::UpgradeDatabaseStructure::NotificationEventMessage; ## no critic

use strict;
use warnings;

use parent qw(scripts::Migration::Base);

our @ObjectDependencies;

=head1 SYNOPSIS
Increases size of columns of database table notification_event_message.
=cut

sub Run {
my ( $Self, %Param ) = @_;

return if !$Self->_IncreaseColumnsSize(%Param);

return 1;
}

sub _IncreaseColumnsSize {
my ( $Self, %Param ) = @_;

my @XMLStrings = (
'<TableAlter Name="notification_event_message">
<ColumnChange NameNew="text" NameOld="text" Required="true" Size="16777216" Type="VARCHAR"/>
</TableAlter>',
);

return if !$Self->ExecuteXMLDBArray(
XMLArray => \@XMLStrings,
);

return 1;
}

1;
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# --
# Copyright (C) 2021 Znuny GmbH, https://znuny.org/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

package scripts::Migration::Znuny::UpgradeDatabaseStructure::StandardTemplate; ## no critic

use strict;
use warnings;

use parent qw(scripts::Migration::Base);

our @ObjectDependencies;

=head1 SYNOPSIS
Increases size of columns of database table standard_template.
=cut

sub Run {
my ( $Self, %Param ) = @_;

return if !$Self->_IncreaseColumnsSize(%Param);

return 1;
}

sub _IncreaseColumnsSize {
my ( $Self, %Param ) = @_;

my @XMLStrings = (
'<TableAlter Name="standard_template">
<ColumnChange NameNew="text" NameOld="text" Required="true" Size="16777216" Type="VARCHAR"/>
</TableAlter>',
);

return if !$Self->ExecuteXMLDBArray(
XMLArray => \@XMLStrings,
);

return 1;
}

1;
4 changes: 2 additions & 2 deletions scripts/database/schema.mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ CREATE TABLE time_accounting (
CREATE TABLE standard_template (
id INTEGER NOT NULL AUTO_INCREMENT,
name VARCHAR (200) NOT NULL,
text TEXT NULL,
text LONGTEXT NULL,
content_type VARCHAR (250) NULL,
template_type VARCHAR (100) NOT NULL DEFAULT 'Answer',
comments VARCHAR (250) NULL,
Expand Down Expand Up @@ -1106,7 +1106,7 @@ CREATE TABLE notification_event_message (
id INTEGER NOT NULL AUTO_INCREMENT,
notification_id INTEGER NOT NULL,
subject VARCHAR (200) NOT NULL,
text TEXT NOT NULL,
text LONGTEXT NOT NULL,
content_type VARCHAR (250) NOT NULL,
language VARCHAR (60) NOT NULL,
PRIMARY KEY(id),
Expand Down
2 changes: 1 addition & 1 deletion scripts/database/schema.oracle.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3264,7 +3264,7 @@ CREATE TABLE notification_event_message (
id NUMBER (12, 0) NOT NULL,
notification_id NUMBER (12, 0) NOT NULL,
subject VARCHAR2 (200) NOT NULL,
text VARCHAR2 (4000) NOT NULL,
text CLOB NOT NULL,
content_type VARCHAR2 (250) NOT NULL,
language VARCHAR2 (60) NOT NULL,
CONSTRAINT notification_event_message_nb4 UNIQUE (notification_id, language)
Expand Down
2 changes: 1 addition & 1 deletion scripts/database/schema.postgresql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1967,7 +1967,7 @@ CREATE TABLE notification_event_message (
id serial NOT NULL,
notification_id INTEGER NOT NULL,
subject VARCHAR (200) NOT NULL,
text VARCHAR (4000) NOT NULL,
text VARCHAR NOT NULL,
content_type VARCHAR (250) NOT NULL,
language VARCHAR (60) NOT NULL,
PRIMARY KEY(id),
Expand Down
6 changes: 2 additions & 4 deletions scripts/database/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@
<Table Name="standard_template">
<Column Name="id" Required="true" PrimaryKey="true" AutoIncrement="true" Type="INTEGER"/>
<Column Name="name" Required="true" Size="200" Type="VARCHAR"/>
<Column Name="text" Required="false" Size="10000" Type="VARCHAR"/>
<Column Name="text" Required="false" Size="16777216" Type="VARCHAR"/>
<Column Name="content_type" Required="false" Size="250" Type="VARCHAR"/>
<Column Name="template_type" Required="true" Size="100" Type="VARCHAR" Default="Answer"/>
<Column Name="comments" Required="false" Size="250" Type="VARCHAR"/>
Expand Down Expand Up @@ -1713,7 +1713,7 @@
<Column Name="id" Required="true" PrimaryKey="true" AutoIncrement="true" Type="INTEGER"/>
<Column Name="notification_id" Required="true" Type="INTEGER"/>
<Column Name="subject" Required="true" Size="200" Type="VARCHAR"/>
<Column Name="text" Required="true" Size="4000" Type="VARCHAR"/>
<Column Name="text" Required="true" Size="16777216" Type="VARCHAR"/>
<Column Name="content_type" Required="true" Size="250" Type="VARCHAR"/>
<Column Name="language" Required="true" Size="60" Type="VARCHAR"/>
<ForeignKey ForeignTable="notification_event">
Expand Down Expand Up @@ -2319,8 +2319,6 @@
</ForeignKey>
</Table>

<!-- TODO: Remove un-needed comments -->

<Table Name="sysconfig_default">
<Column Name="id" Required="true" PrimaryKey="true" AutoIncrement="true" Type="INTEGER"/>
<Column Name="name" Required="true" Size="250" Type="VARCHAR"/>
Expand Down

0 comments on commit 901f10f

Please sign in to comment.