Bug 17698: DBRev 18.06.00.011
authorNick Clemens <nick@bywatersolutions.com>
Mon, 23 Jul 2018 15:18:01 +0000 (15:18 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Mon, 23 Jul 2018 15:34:12 +0000 (15:34 +0000)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Koha.pm
Koha/Schema/Result/Issue.pm
Koha/Schema/Result/OldIssue.pm
installer/data/mysql/atomicupdate/bug-17698_add-noteseen-column-to-issues.perl [deleted file]
installer/data/mysql/atomicupdate/bug-17698_add-permission-to-manage-checkout-notes.sql [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index f64b70e..cb89396 100644 (file)
--- 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;
index 7fb084c..e82886a 100644 (file)
@@ -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",
index 32a90ab..df84a07 100644 (file)
@@ -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 (file)
index 1e8c604..0000000
+++ /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 (file)
index ce3bd8f..0000000
+++ /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');
index c4df140..41a58a3 100755 (executable)
@@ -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.