From 4afbd08968e1dc804483e337c0b558ded7306c1f Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 20 Feb 2020 14:51:02 +0000 Subject: [PATCH] Bug 17702: DBRev 19.12.00.029 Signed-off-by: Martin Renvoize --- Koha.pm | 2 +- Koha/Schema/Result/AccountCreditType.pm | 12 ++++++++++-- installer/data/mysql/atomicupdate/bug-17702.perl | 9 --------- installer/data/mysql/updatedatabase.pl | 10 ++++++++++ 4 files changed, 21 insertions(+), 12 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug-17702.perl diff --git a/Koha.pm b/Koha.pm index 077e045762..3515c62594 100644 --- a/Koha.pm +++ b/Koha.pm @@ -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 = "19.12.00.028"; +$VERSION = "19.12.00.029"; sub version { return $VERSION; diff --git a/Koha/Schema/Result/AccountCreditType.pm b/Koha/Schema/Result/AccountCreditType.pm index c81d27f6ec..4ee8e86b3c 100644 --- a/Koha/Schema/Result/AccountCreditType.pm +++ b/Koha/Schema/Result/AccountCreditType.pm @@ -47,6 +47,12 @@ __PACKAGE__->table("account_credit_types"); default_value: 0 is_nullable: 0 +=head2 archived + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + =cut __PACKAGE__->add_columns( @@ -58,6 +64,8 @@ __PACKAGE__->add_columns( { data_type => "tinyint", default_value => 1, is_nullable => 0 }, "is_system", { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "archived", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, ); =head1 PRIMARY KEY @@ -105,8 +113,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-14 09:59:52 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Uycu/23b681kWHNX+/gNiw +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-02-20 14:48:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hdxcXxCqIDxwfSHjSr0VUg __PACKAGE__->add_columns( '+is_system' => { is_boolean => 1 } diff --git a/installer/data/mysql/atomicupdate/bug-17702.perl b/installer/data/mysql/atomicupdate/bug-17702.perl deleted file mode 100644 index ab51cf08ec..0000000000 --- a/installer/data/mysql/atomicupdate/bug-17702.perl +++ /dev/null @@ -1,9 +0,0 @@ -$DBversion = 'XXX'; -if( CheckVersion( $DBversion ) ) { - if (!column_exists('account_credit_types', 'archived')) { - $dbh->do('ALTER TABLE account_credit_types ADD COLUMN archived tinyint(1) NOT NULL DEFAULT 0 AFTER is_system'); - } - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 17702 - Add column account_credit_types.archived)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 51441605ed..439eae583c 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -20915,6 +20915,16 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 14567: Add OpacBrowseSearch syspref)\n"; } +$DBversion = '19.12.00.029'; +if( CheckVersion( $DBversion ) ) { + if (!column_exists('account_credit_types', 'archived')) { + $dbh->do('ALTER TABLE account_credit_types ADD COLUMN archived tinyint(1) NOT NULL DEFAULT 0 AFTER is_system'); + } + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 17702 - Add column account_credit_types.archived)\n"; +} + # 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/'; -- 2.39.5