Skip to content

Commit

Permalink
Change files.size type to bigint
Browse files Browse the repository at this point in the history
This allow to store files bigger than 4GiB
  • Loading branch information
jajm committed Mar 31, 2017
1 parent 9d04a91 commit c56ec56
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
19 changes: 19 additions & 0 deletions application/migrations/20170331084000_changeFileSizeBigInt.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
* Omeka
*
* @copyright Copyright 2007-2016 Roy Rosenzweig Center for History and New Media
* @license http://www.gnu.org/licenses/gpl-3.0.txt GNU GPLv3
*/

/**
* @package Omeka\Db\Migration
*/
class changeFileSizeBigInt extends Omeka_Db_Migration_AbstractMigration
{
public function up()
{
$db = $this->db;
$db->query("ALTER TABLE `{$db->prefix}files` MODIFY `size` bigint unsigned NOT NULL");
}
}
2 changes: 1 addition & 1 deletion application/schema/files.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%files` (
`id` int unsigned NOT NULL auto_increment,
`item_id` int unsigned NOT NULL,
`order` int(10) unsigned DEFAULT NULL,
`size` int unsigned NOT NULL,
`size` bigint unsigned NOT NULL,
`has_derivative_image` tinyint(1) NOT NULL,
`authentication` char(32) collate utf8_unicode_ci default NULL,
`mime_type` varchar(255) collate utf8_unicode_ci default NULL,
Expand Down
2 changes: 1 addition & 1 deletion bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

// Define the current version of Omeka.
define('OMEKA_VERSION', '2.5');
define('OMEKA_VERSION', '2.5.1');

// Define the application environment.
if (!defined('APPLICATION_ENV')) {
Expand Down

0 comments on commit c56ec56

Please sign in to comment.