From 1ea7d9790d31ecf52dcf6d9070650b4cab77b17b Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 23 Jul 2018 15:18:01 +0000 Subject: [PATCH] Bug 17698: DBRev 18.06.00.011 Signed-off-by: Nick Clemens --- Koha.pm | 2 +- Koha/Schema/Result/Issue.pm | 11 +++++++++-- Koha/Schema/Result/OldIssue.pm | 11 +++++++++-- .../bug-17698_add-noteseen-column-to-issues.perl | 13 ------------- ...698_add-permission-to-manage-checkout-notes.sql | 1 - installer/data/mysql/updatedatabase.pl | 14 ++++++++++++++ 6 files changed, 33 insertions(+), 19 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug-17698_add-noteseen-column-to-issues.perl delete mode 100644 installer/data/mysql/atomicupdate/bug-17698_add-permission-to-manage-checkout-notes.sql diff --git a/Koha.pm b/Koha.pm index f64b70e231..cb89396e2c 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 = "18.06.00.010"; +$VERSION = "18.06.00.011"; sub version { return $VERSION; diff --git a/Koha/Schema/Result/Issue.pm b/Koha/Schema/Result/Issue.pm index 7fb084c06d..e82886aae5 100644 --- a/Koha/Schema/Result/Issue.pm +++ b/Koha/Schema/Result/Issue.pm @@ -112,6 +112,11 @@ __PACKAGE__->table("issues"); datetime_undef_if_invalid: 1 is_nullable: 1 +=head2 noteseen + + data_type: 'integer' + is_nullable: 1 + =cut __PACKAGE__->add_columns( @@ -170,6 +175,8 @@ __PACKAGE__->add_columns( datetime_undef_if_invalid => 1, is_nullable => 1, }, + "noteseen", + { data_type => "integer", is_nullable => 1 }, ); =head1 PRIMARY KEY @@ -241,8 +248,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:skFfce3y1eEx3rSdFaLmPg +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-07-23 13:51:40 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+mlcId4odhAFp3HHgV/+tg __PACKAGE__->belongs_to( "borrower", diff --git a/Koha/Schema/Result/OldIssue.pm b/Koha/Schema/Result/OldIssue.pm index 32a90ab6d3..df84a07e32 100644 --- a/Koha/Schema/Result/OldIssue.pm +++ b/Koha/Schema/Result/OldIssue.pm @@ -111,6 +111,11 @@ __PACKAGE__->table("old_issues"); datetime_undef_if_invalid: 1 is_nullable: 1 +=head2 noteseen + + data_type: 'integer' + is_nullable: 1 + =cut __PACKAGE__->add_columns( @@ -169,6 +174,8 @@ __PACKAGE__->add_columns( datetime_undef_if_invalid => 1, is_nullable => 1, }, + "noteseen", + { data_type => "integer", is_nullable => 1 }, ); =head1 PRIMARY KEY @@ -226,8 +233,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:54 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RKLeDDEz22G5BU/ZAl7QLA +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-07-23 13:51:40 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1f688Osvh/sxg2P/qffZ2g __PACKAGE__->belongs_to( "borrower", diff --git a/installer/data/mysql/atomicupdate/bug-17698_add-noteseen-column-to-issues.perl b/installer/data/mysql/atomicupdate/bug-17698_add-noteseen-column-to-issues.perl deleted file mode 100644 index 1e8c604340..0000000000 --- a/installer/data/mysql/atomicupdate/bug-17698_add-noteseen-column-to-issues.perl +++ /dev/null @@ -1,13 +0,0 @@ -$DBversion = 'XXX'; -if( CheckVersion( $DBversion ) ) { - unless( column_exists( 'issues', 'noteseen' ) ) { - $dbh->do(q|ALTER TABLE issues ADD COLUMN noteseen int(1) default NULL AFTER notedate|); - } - - unless( column_exists( 'old_issues', 'noteseen' ) ) { - $dbh->do(q|ALTER TABLE old_issues ADD COLUMN noteseen int(1) default NULL AFTER notedate|); - } - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 17698: Add column issues.noteseen and old_issues.noteseen)\n"; -} diff --git a/installer/data/mysql/atomicupdate/bug-17698_add-permission-to-manage-checkout-notes.sql b/installer/data/mysql/atomicupdate/bug-17698_add-permission-to-manage-checkout-notes.sql deleted file mode 100644 index ce3bd8f373..0000000000 --- a/installer/data/mysql/atomicupdate/bug-17698_add-permission-to-manage-checkout-notes.sql +++ /dev/null @@ -1 +0,0 @@ -INSERT IGNORE INTO permissions (module_bit, code, description) VALUES ( 1, 'manage_checkout_notes', 'Mark checkout notes as seen/not seen'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index c4df140792..41a58a376b 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -16200,6 +16200,20 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 19191 - Add ability to email receipts for account payments and write-offs)\n"; } +$DBversion = '18.06.00.011'; +if( CheckVersion( $DBversion ) ) { + unless( column_exists( 'issues', 'noteseen' ) ) { + $dbh->do(q|ALTER TABLE issues ADD COLUMN noteseen int(1) default NULL AFTER notedate|); + } + + unless( column_exists( 'old_issues', 'noteseen' ) ) { + $dbh->do(q|ALTER TABLE old_issues ADD COLUMN noteseen int(1) default NULL AFTER notedate|); + } + $dbh->do(q|INSERT IGNORE INTO permissions (module_bit, code, description) VALUES ( 1, 'manage_checkout_notes', 'Mark checkout notes as seen/not seen');|); + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 17698: Add column issues.noteseen and old_issues.noteseen)\n"; +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.20.1