diff options
Diffstat (limited to 'application/migrations/005_drop_file_password.php')
-rw-r--r-- | application/migrations/005_drop_file_password.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/application/migrations/005_drop_file_password.php b/application/migrations/005_drop_file_password.php new file mode 100644 index 000000000..1b3b5fc12 --- /dev/null +++ b/application/migrations/005_drop_file_password.php @@ -0,0 +1,33 @@ +<?php +defined('BASEPATH') OR exit('No direct script access allowed'); + +class Migration_Drop_file_password extends CI_Migration { + + public function up() + { + $prefix = $this->db->dbprefix; + + if ($this->db->dbdriver == 'postgre') { + $this->db->query('ALTER TABLE "'.$prefix.'files" DROP "password"'); + } else { + $this->db->query('ALTER TABLE `'.$prefix.'files` DROP `password`;'); + } + } + + public function down() + { + $prefix = $this->db->dbprefix; + + if ($this->db->dbdriver == 'postgre') { + $this->db->query(' + ALTER TABLE "'.$prefix.'files" + ADD "password" character varying(40) DEFAULT NULL + '); + } else { + $this->db->query(" + ALTER TABLE `'.$prefix.'files` + ADD `password` varchar(40) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL; + "); + } + } +} |