Bug 14187 - DBRev 16.12.00.002
authorKyle M Hall <kyle@bywatersolutions.com>
Fri, 13 Jan 2017 12:24:39 +0000 (12:24 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 13 Jan 2017 12:24:39 +0000 (12:24 +0000)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha.pm
Koha/Schema/Result/Branchtransfer.pm
installer/data/mysql/atomicupdate/14187.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 3d03cba..0682bd3 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 = "16.12.00.001";
+$VERSION = "16.12.00.002";
 
 sub version {
     return $VERSION;
index 1976ffd..9c5b76b 100644 (file)
@@ -23,6 +23,12 @@ __PACKAGE__->table("branchtransfers");
 
 =head1 ACCESSORS
 
+=head2 branchtransfer_id
+
+  data_type: 'integer'
+  is_auto_increment: 1
+  is_nullable: 0
+
 =head2 itemnumber
 
   data_type: 'integer'
@@ -66,6 +72,8 @@ __PACKAGE__->table("branchtransfers");
 =cut
 
 __PACKAGE__->add_columns(
+  "branchtransfer_id",
+  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
   "itemnumber",
   {
     data_type      => "integer",
@@ -105,6 +113,18 @@ __PACKAGE__->add_columns(
   { data_type => "mediumtext", is_nullable => 1 },
 );
 
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</branchtransfer_id>
+
+=back
+
+=cut
+
+__PACKAGE__->set_primary_key("branchtransfer_id");
+
 =head1 RELATIONS
 
 =head2 frombranch
@@ -153,8 +173,8 @@ __PACKAGE__->belongs_to(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:NPbH+5o2BVPj8yeoUqEavw
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-01-13 12:22:24
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8cnatLrGkNwyTo35PCOm2A
 
 
 # You can replace this text with custom content, and it will be preserved on regeneration
diff --git a/installer/data/mysql/atomicupdate/14187.perl b/installer/data/mysql/atomicupdate/14187.perl
deleted file mode 100644 (file)
index 5a7fa67..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-$DBversion = '16.12.00.XXX';
-if ( CheckVersion($DBversion) ) {
-    unless (column_exists( 'branchtransfers', 'branchtransfer_id' )
-        and index_exists( 'branchtransfers', 'PRIMARY' ) )
-    {
-        $dbh->do(
-            "ALTER TABLE branchtransfers
-                 ADD COLUMN branchtransfer_id int(12) NOT NULL auto_increment FIRST, ADD CONSTRAINT PRIMARY KEY (branchtransfer_id);"
-        );
-    }
-
-    # Always end with this (adjust the bug info)
-    SetVersion($DBversion);
-    print "Upgrade to $DBversion done (Bug 14187: branchtransfer needs a primary key (id) for DBIx and common sense.)\n";
-}
index 9f29a39..87d71e3 100755 (executable)
@@ -13766,6 +13766,21 @@ if ( CheckVersion($DBversion) ) {
     SetVersion($DBversion);
 }
 
+$DBversion = '16.12.00.002';
+if ( CheckVersion($DBversion) ) {
+    unless (column_exists( 'branchtransfers', 'branchtransfer_id' )
+        and index_exists( 'branchtransfers', 'PRIMARY' ) )
+    {
+        $dbh->do(
+            "ALTER TABLE branchtransfers
+                 ADD COLUMN branchtransfer_id int(12) NOT NULL auto_increment FIRST, ADD CONSTRAINT PRIMARY KEY (branchtransfer_id);"
+        );
+    }
+
+    SetVersion($DBversion);
+    print "Upgrade to $DBversion done (Bug 14187 - branchtransfer needs a primary key (id) for DBIx and common sense.)\n";
+}
+
 # DEVELOPER PROCESS, search for anything to execute in the db_update directory
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.