Bug 18591: DBRev 18.06.00.046
authorNick Clemens <nick@bywatersolutions.com>
Sat, 27 Oct 2018 13:21:09 +0000 (13:21 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Sat, 27 Oct 2018 13:21:09 +0000 (13:21 +0000)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Koha.pm
Koha/Schema/Result/Borrower.pm
Koha/Schema/Result/Illrequest.pm
installer/data/mysql/atomicupdate/bug18591-ill-comments.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 5e19833..b582f2b 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.045";
+$VERSION = "18.06.00.046";
 
 sub version {
     return $VERSION;
index 236c917..8e4580f 100644 (file)
@@ -1025,6 +1025,21 @@ __PACKAGE__->has_many(
   { cascade_copy => 0, cascade_delete => 0 },
 );
 
+=head2 illcomments
+
+Type: has_many
+
+Related object: L<Koha::Schema::Result::Illcomment>
+
+=cut
+
+__PACKAGE__->has_many(
+  "illcomments",
+  "Koha::Schema::Result::Illcomment",
+  { "foreign.borrowernumber" => "self.borrowernumber" },
+  { cascade_copy => 0, cascade_delete => 0 },
+);
+
 =head2 illrequests
 
 Type: has_many
@@ -1416,8 +1431,8 @@ Composing rels: L</aqorder_users> -> ordernumber
 __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
 
 
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-09-20 13:00:20
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QT6EPIG26F/kNK6prauRgw
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-10-27 13:16:48
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:c3Tb59Kku0Hh+tsVV5eCDg
 
 __PACKAGE__->belongs_to(
     "guarantor",
index 3e8462c..cc56ee1 100644 (file)
@@ -223,6 +223,21 @@ __PACKAGE__->belongs_to(
   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
 );
 
+=head2 illcomments
+
+Type: has_many
+
+Related object: L<Koha::Schema::Result::Illcomment>
+
+=cut
+
+__PACKAGE__->has_many(
+  "illcomments",
+  "Koha::Schema::Result::Illcomment",
+  { "foreign.illrequest_id" => "self.illrequest_id" },
+  { cascade_copy => 0, cascade_delete => 0 },
+);
+
 =head2 illrequestattributes
 
 Type: has_many
@@ -239,8 +254,8 @@ __PACKAGE__->has_many(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-10-01 02:46:41
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MMKr4JAAAsNnFcQn9SPTcw
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-10-27 13:16:48
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rv6QyhxEah2r/rDcz3aOOw
 
 
 # You can replace this text with custom code or comments, and it will be preserved on regeneration
diff --git a/installer/data/mysql/atomicupdate/bug18591-ill-comments.perl b/installer/data/mysql/atomicupdate/bug18591-ill-comments.perl
deleted file mode 100644 (file)
index 5742118..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-$DBversion = 'XXX';
-if( CheckVersion( $DBversion ) ) {
-    unless (TableExists('illcomments')) {
-        $dbh->do(q{
-            CREATE TABLE illcomments (
-                illcomment_id int(11) NOT NULL AUTO_INCREMENT, -- Unique ID of the comment
-                illrequest_id bigint(20) unsigned NOT NULL,    -- ILL request number
-                borrowernumber integer DEFAULT NULL,           -- Link to the user who made the comment (could be librarian, patron or ILL partner library)
-                comment text DEFAULT NULL,                     -- The text of the comment
-                timestamp timestamp DEFAULT CURRENT_TIMESTAMP, -- Date and time when the comment was made
-                PRIMARY KEY  ( illcomment_id ),
-                CONSTRAINT illcomments_bnfk
-                  FOREIGN KEY ( borrowernumber )
-                  REFERENCES  borrowers  ( borrowernumber )
-                  ON UPDATE CASCADE ON DELETE CASCADE,
-                CONSTRAINT illcomments_ifk
-                  FOREIGN KEY (illrequest_id)
-                  REFERENCES illrequests ( illrequest_id )
-                  ON UPDATE CASCADE ON DELETE CASCADE
-            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-        });
-    }
-
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 18591 - Add comments to ILL requests)\n";
-}
index d3245a1..f7af2a1 100755 (executable)
@@ -16714,6 +16714,33 @@ if( CheckVersion( $DBversion ) ) {
     print "Upgrade to $DBversion done (Bug 21639 - Add phone transports by default)\n";
 }
 
+$DBversion = '18.06.00.046';
+if( CheckVersion( $DBversion ) ) {
+    unless (TableExists('illcomments')) {
+        $dbh->do(q{
+            CREATE TABLE illcomments (
+                illcomment_id int(11) NOT NULL AUTO_INCREMENT, -- Unique ID of the comment
+                illrequest_id bigint(20) unsigned NOT NULL,    -- ILL request number
+                borrowernumber integer DEFAULT NULL,           -- Link to the user who made the comment (could be librarian, patron or ILL partner library)
+                comment text DEFAULT NULL,                     -- The text of the comment
+                timestamp timestamp DEFAULT CURRENT_TIMESTAMP, -- Date and time when the comment was made
+                PRIMARY KEY  ( illcomment_id ),
+                CONSTRAINT illcomments_bnfk
+                  FOREIGN KEY ( borrowernumber )
+                  REFERENCES  borrowers  ( borrowernumber )
+                  ON UPDATE CASCADE ON DELETE CASCADE,
+                CONSTRAINT illcomments_ifk
+                  FOREIGN KEY (illrequest_id)
+                  REFERENCES illrequests ( illrequest_id )
+                  ON UPDATE CASCADE ON DELETE CASCADE
+            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+        });
+    }
+
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 18591 - Add comments to ILL requests)\n";
+}
+
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.