diff options
-rw-r--r-- | application/config/migration.php | 2 | ||||
-rw-r--r-- | application/migrations/019_change_filesize_type.php | 27 |
2 files changed, 28 insertions, 1 deletions
diff --git a/application/config/migration.php b/application/config/migration.php index 659907cb8..45ce7711b 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -21,7 +21,7 @@ $config['migration_enabled'] = true; | be upgraded / downgraded to. | */ -$config['migration_version'] = 18; +$config['migration_version'] = 19; /* diff --git a/application/migrations/019_change_filesize_type.php b/application/migrations/019_change_filesize_type.php new file mode 100644 index 000000000..327d8dcae --- /dev/null +++ b/application/migrations/019_change_filesize_type.php @@ -0,0 +1,27 @@ +<?php +defined('BASEPATH') OR exit('No direct script access allowed'); + +class Migration_change_filesize_type extends CI_Migration { + + public function up() + { + $prefix = $this->db->dbprefix; + + if ($this->db->dbdriver == 'postgre') { + $this->db->query(' + ALTER TABLE "'.$prefix.'file_storage" + ALTER "filesize" TYPE bigint; + '); + } else { + $this->db->query(' + ALTER TABLE `'.$prefix.'file_storage` + MODIFY `filesize` bigint; + '); + } + } + + public function down() + { + throw new \exceptions\ApiException("migration/downgrade-not-supported", "downgrade not supported"); + } +} |