Bug 15839 - DBRev 16.06.00.019
authorKyle M Hall <kyle@bywatersolutions.com>
Fri, 9 Sep 2016 10:38:43 +0000 (10:38 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 9 Sep 2016 10:38:43 +0000 (10:38 +0000)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha.pm
Koha/Schema/Result/Review.pm
installer/data/mysql/atomicupdate/bug_review.sql [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 641d8c4..94ffc82 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.06.00.018";
+$VERSION = "16.06.00.019";
 
 sub version {
     return $VERSION;
index 64ee4ad..a066f2a 100644 (file)
@@ -49,6 +49,7 @@ __PACKAGE__->table("reviews");
 =head2 approved
 
   data_type: 'tinyint'
+  default_value: 0
   is_nullable: 1
 
 =head2 datereviewed
@@ -69,7 +70,7 @@ __PACKAGE__->add_columns(
   "review",
   { data_type => "text", is_nullable => 1 },
   "approved",
-  { data_type => "tinyint", is_nullable => 1 },
+  { data_type => "tinyint", default_value => 0, is_nullable => 1 },
   "datereviewed",
   {
     data_type => "datetime",
@@ -133,8 +134,8 @@ __PACKAGE__->belongs_to(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:u+R08bCdVQA697aPo9zEUA
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-09-09 10:38:09
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZjW8uHIL0m7+pwOTE0pcxQ
 
 
 # You can replace this text with custom content, and it will be preserved on regeneration
diff --git a/installer/data/mysql/atomicupdate/bug_review.sql b/installer/data/mysql/atomicupdate/bug_review.sql
deleted file mode 100644 (file)
index ee882dd..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE reviews CHANGE COLUMN approved approved tinyint(4) DEFAULT 0;
-UPDATE reviews SET approved=0 WHERE approved IS NULL;
index ffe2bec..4362498 100755 (executable)
@@ -12871,6 +12871,19 @@ if ( CheckVersion($DBversion) ) {
     SetVersion($DBversion);
 }
 
+$DBversion = "16.06.00.019";
+if ( CheckVersion($DBversion) ) {
+    $dbh->do(q{
+        ALTER TABLE reviews CHANGE COLUMN approved approved tinyint(4) DEFAULT 0;
+    });
+    $dbh->do(q{
+        UPDATE reviews SET approved=0 WHERE approved IS NULL;
+    });
+
+    print "Upgrade to $DBversion done (Bug 15839 - Move the reviews related code to Koha::Reviews)\n";
+    SetVersion($DBversion);
+}
+
 # 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.