Bug 20772: DBRev 18.06.00.041
authorTomas Cohen Arazi <tomascohen@theke.io>
Sat, 13 Oct 2018 10:47:12 +0000 (07:47 -0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Sat, 13 Oct 2018 11:34:33 +0000 (08:34 -0300)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Koha.pm
Koha/Schema/Result/Illrequest.pm
Koha/Schema/Result/Illrequestattribute.pm
installer/data/mysql/atomicupdate/bug_20772-add-price_paid_column_to_illrequests.perl [deleted file]
installer/data/mysql/atomicupdate/bug_20772-add-readonly-flag-to-illrequestattributes.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 7f76989..955dbf3 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.040";
+$VERSION = "18.06.00.041";
 
 sub version {
     return $VERSION;
index 1b207ff..3e8462c 100644 (file)
@@ -97,6 +97,12 @@ __PACKAGE__->table("illrequests");
   is_nullable: 1
   size: 20
 
+=head2 price_paid
+
+  data_type: 'varchar'
+  is_nullable: 1
+  size: 20
+
 =head2 notesopac
 
   data_type: 'mediumtext'
@@ -156,6 +162,8 @@ __PACKAGE__->add_columns(
   { data_type => "varchar", is_nullable => 1, size => 500 },
   "cost",
   { data_type => "varchar", is_nullable => 1, size => 20 },
+  "price_paid",
+  { data_type => "varchar", is_nullable => 1, size => 20 },
   "notesopac",
   { data_type => "mediumtext", is_nullable => 1 },
   "notesstaff",
@@ -231,8 +239,8 @@ __PACKAGE__->has_many(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Rh8DSs3xj3KRmyd7WNGDAg
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-10-01 02:46:41
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MMKr4JAAAsNnFcQn9SPTcw
 
 
 # You can replace this text with custom code or comments, and it will be preserved on regeneration
index cb9cb18..b89de5b 100644 (file)
@@ -41,6 +41,12 @@ __PACKAGE__->table("illrequestattributes");
   data_type: 'mediumtext'
   is_nullable: 0
 
+=head2 readonly
+
+  data_type: 'tinyint'
+  default_value: 1
+  is_nullable: 0
+
 =cut
 
 __PACKAGE__->add_columns(
@@ -55,6 +61,8 @@ __PACKAGE__->add_columns(
   { data_type => "varchar", is_nullable => 0, size => 200 },
   "value",
   { data_type => "mediumtext", is_nullable => 0 },
+  "readonly",
+  { data_type => "tinyint", default_value => 1, is_nullable => 0 },
 );
 
 =head1 PRIMARY KEY
@@ -89,8 +97,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:X9SxZP1PGXTwDJ6lUkx8Fg
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2018-05-17 09:17:53
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sFY1giVMz5AkXCPidhyGjw
 
 
 # You can replace this text with custom code or comments, and it will be preserved on regeneration
diff --git a/installer/data/mysql/atomicupdate/bug_20772-add-price_paid_column_to_illrequests.perl b/installer/data/mysql/atomicupdate/bug_20772-add-price_paid_column_to_illrequests.perl
deleted file mode 100644 (file)
index f720792..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-$DBversion = 'XXX';  # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
-
-     if( !column_exists( 'illrequests', 'price_paid' ) ) {
-        $dbh->do( "ALTER TABLE illrequests ADD COLUMN price_paid varchar(20) DEFAULT NULL AFTER 'cost'" );
-     }
-
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 20772 - Add illrequest.price_paid column)\n";
-}
diff --git a/installer/data/mysql/atomicupdate/bug_20772-add-readonly-flag-to-illrequestattributes.perl b/installer/data/mysql/atomicupdate/bug_20772-add-readonly-flag-to-illrequestattributes.perl
deleted file mode 100644 (file)
index 7707bc5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-$DBversion = 'XXX';  # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
-
-     if( !column_exists( 'illrequestattributes', 'readonly' ) ) {
-        $dbh->do( "ALTER TABLE illrequestattributes ADD COLUMN readonly tinyint(1) NOT NULL DEFAULT 1 AFTER 'value'" );
-        $dbh->do( "UPDATE illrequestattributes SET readonly = 1" );
-     }
-
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 20772 - Add illrequestattributes.readonly column)\n";
-}
index 6469f51..2f48eff 100755 (executable)
@@ -16644,6 +16644,32 @@ if( CheckVersion( $DBversion ) ) {
     SetVersion( $DBversion );
 }
 
+$DBversion = '18.06.00.041';
+if( CheckVersion( $DBversion ) ) {
+
+     if( !column_exists( 'illrequests', 'price_paid' ) ) {
+        $dbh->do(q{
+            ALTER TABLE illrequests
+                ADD COLUMN price_paid varchar(20) DEFAULT NULL
+                AFTER cost
+        });
+     }
+
+     if( !column_exists( 'illrequestattributes', 'readonly' ) ) {
+        $dbh->do(q{
+            ALTER TABLE illrequestattributes
+                ADD COLUMN readonly tinyint(1) NOT NULL DEFAULT 1
+                AFTER value
+        });
+        $dbh->do(q{
+            UPDATE illrequestattributes SET readonly = 1
+        });
+     }
+
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 20772 - Add illrequestattributes.readonly and illrequest.price_paid columns)\n";
+}
+
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.