Bug 14233: DBRev 20.12.00.028

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2021-04-09 14:04:23 +00:00
parent 5e5f65863d
commit aad8699b01
3 changed files with 24 additions and 21 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 = "20.12.00.027";
$VERSION = "20.12.00.028";
sub version {
return $VERSION;

View File

@ -1,20 +0,0 @@
$DBversion = 'XXX'; # will be replaced by the RM
if ( CheckVersion($DBversion) ) {
if ( !column_exists( 'letter', 'id' ) ) {
$dbh->do(q{ALTER TABLE letter DROP PRIMARY KEY});
$dbh->do(
q{ALTER TABLE letter ADD COLUMN `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST}
);
$dbh->do(
q{ALTER TABLE letter ADD UNIQUE KEY letter_uniq_1 (`module`,`code`,`branchcode`,`message_transport_type`,`lang`)}
);
}
$dbh->do(q{
INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type)
VALUES ('NoticesLog','',NULL,'If enabled, log changes to notice templates','YesNo')
});
NewVersion( $DBversion, 14233, "Add id field to letter table" );
}

View File

@ -23767,6 +23767,29 @@ if( CheckVersion( $DBversion ) ) {
NewVersion( $DBversion, 27069, "Change holdallowed values from numbers to strings");
}
$DBversion = '20.12.00.028';
if ( CheckVersion($DBversion) ) {
if ( !column_exists( 'letter', 'id' ) ) {
$dbh->do(q{
ALTER TABLE letter DROP PRIMARY KEY
});
$dbh->do(q{
ALTER TABLE letter ADD COLUMN `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST
});
$dbh->do(q{
ALTER TABLE letter ADD UNIQUE KEY letter_uniq_1 (`module`,`code`,`branchcode`,`message_transport_type`,`lang`)
});
}
$dbh->do(q{
INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type)
VALUES ('NoticesLog','',NULL,'If enabled, log changes to notice templates','YesNo')
});
NewVersion( $DBversion, 14233, "Add id field to letter table" );
}
# SEE bug 13068
# if there is anything in the atomicupdate, read and execute it.
my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/';