diff options
Diffstat (limited to 'application/migrations/005_drop_file_password.php')
-rw-r--r-- | application/migrations/005_drop_file_password.php | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/application/migrations/005_drop_file_password.php b/application/migrations/005_drop_file_password.php index bf03490a8..2be20e550 100644 --- a/application/migrations/005_drop_file_password.php +++ b/application/migrations/005_drop_file_password.php @@ -5,17 +5,31 @@ class Migration_Drop_file_password extends CI_Migration { public function up() { - $this->db->query(" - ALTER TABLE `files` - DROP `password`; - "); + if ($this->db->dbdriver == 'postgre') + { + $this->db->query('ALTER TABLE "files" DROP "password"'); + } + else + { + $this->db->query("ALTER TABLE `files` DROP `password`;"); + } } public function down() { - $this->db->query(" - ALTER TABLE `files` - ADD `password` varchar(40) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL; - "); + if ($this->db->dbdriver == 'postgre') + { + $this->db->query(' + ALTER TABLE "files" + ADD "password" character varying(40) DEFAULT NULL + '); + } + else + { + $this->db->query(" + ALTER TABLE `files` + ADD `password` varchar(40) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL; + "); + } } } |