Bug 33547: DBRev 23.06.00.046

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Tomás Cohen Arazi 2023-10-23 11:28:02 -03:00
parent cc69c69614
commit 8a099dc488
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 14 additions and 9 deletions

View file

@ -29,7 +29,7 @@ use vars qw{ $VERSION };
# - #4 : the developer version. The 4th number is the database subversion.
# used by developers when the database changes. updatedatabase take care of the changes itself
# and is automatically called by Auth.pm when needed.
$VERSION = "23.06.00.045";
$VERSION = "23.06.00.046";
sub version {
return $VERSION;

View file

@ -1,17 +1,19 @@
use Modern::Perl;
return {
bug_number => "33547",
bug_number => "33547",
description => "Add a new notice template 'PRES_TRAIN_ITEM'",
up => sub {
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
my ( $dbh, $out ) = @$args{qw(dbh out)};
unless ( column_exists('preservation_processings', 'letter_code') ) {
$dbh->do(q{
unless ( column_exists( 'preservation_processings', 'letter_code' ) ) {
$dbh->do(
q{
ALTER TABLE preservation_processings
ADD COLUMN `letter_code` varchar(20) DEFAULT NULL COMMENT 'Foreign key to the letters table' AFTER `name`
});
}
);
}
my $notice_template = q{[%~ USE AuthorisedValues ~%]
@ -32,11 +34,14 @@ Item number #[% train_item.user_train_item_id %]
[% item_attribute.processing_attribute.name %]: [% value %]
[% END %]};
$dbh->do(q{
$dbh->do(
q{
INSERT IGNORE INTO letter
(module,code,branchcode,name,is_html,title,content,message_transport_type,lang)
VALUES
('preservation','PRES_TRAIN_ITEM','','Train item slip',0,'Train item slip',?, 'print','default')}, undef, $notice_template);
('preservation','PRES_TRAIN_ITEM','','Train item slip',0,'Train item slip',?, 'print','default')}, undef,
$notice_template
);
say $out "Added new letter 'PRES_TRAIN_ITEM' (print)";
},
};