Bug 6874: DBRev 3.21.00.017
authorTomás Cohen Arazi <tomascohen@theke.io>
Fri, 7 Aug 2015 19:04:46 +0000 (16:04 -0300)
committerTomas Cohen Arazi <tomascohen@unc.edu.ar>
Tue, 11 Aug 2015 14:57:21 +0000 (11:57 -0300)
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Koha.pm
installer/data/mysql/atomicupdate/06874_lastrevision.sql [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index df2140e..413074d 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 = "3.21.00.016";
+$VERSION = "3.21.00.017";
 
 sub version {
     return $VERSION;
diff --git a/installer/data/mysql/atomicupdate/06874_lastrevision.sql b/installer/data/mysql/atomicupdate/06874_lastrevision.sql
deleted file mode 100644 (file)
index 81b37fe..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
--- table adjustments for uploaded_files
-ALTER TABLE uploaded_files
-    CHANGE COLUMN id hashvalue char(40) NOT NULL,
-    DROP PRIMARY KEY;
-ALTER TABLE uploaded_files
-    ADD COLUMN id int NOT NULL AUTO_INCREMENT FIRST,
-    ADD CONSTRAINT PRIMARY KEY (id),
-    ADD COLUMN filesize int,
-    ADD COLUMN dtcreated timestamp,
-    ADD COLUMN categorycode tinytext,
-    ADD COLUMN owner int;
index a167066..e1d547a 100755 (executable)
@@ -10726,14 +10726,20 @@ if ( CheckVersion($DBversion) ) {
     SetVersion($DBversion);
 }
 
-$DBversion = "XXX";
+$DBversion = "3.21.00.017";
 if ( CheckVersion($DBversion) ) {
     $dbh->do("
         CREATE TABLE uploaded_files (
-            id CHAR(40) NOT NULL PRIMARY KEY,
+            id int(11) NOT NULL AUTO_INCREMENT,
+            hashvalue CHAR(40) NOT NULL,
             filename TEXT NOT NULL,
-            dir TEXT NOT NULL
-        ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+            dir TEXT NOT NULL,
+            filesize int(11),
+            dtcreated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+            categorycode tinytext,
+            owner int(11),
+            PRIMARY KEY (id)
+        ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
     ");
 
     print "Upgrade to $DBversion done (Bug 6874: New cataloging plugin upload.pl)\n";