diff options
author | Florian Pritz <bluewind@xinu.at> | 2014-10-19 23:04:20 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2014-10-19 23:04:41 +0200 |
commit | c8d9d70f60ccc8d77180627852810453375c91fd (patch) | |
tree | 72cdbe776fce9dccefb13610913ff24dcd3d92e4 /application/migrations/005_drop_file_password.php | |
parent | 111c356f7833d1619f0da75d019c390a424d6445 (diff) | |
parent | 1abe7372404a9d65f3b59eda2d83e628267b366d (diff) |
Merge postgresql support
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/migrations/005_drop_file_password.php')
-rw-r--r-- | application/migrations/005_drop_file_password.php | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/application/migrations/005_drop_file_password.php b/application/migrations/005_drop_file_password.php index bf03490a8..e8b7f8952 100644 --- a/application/migrations/005_drop_file_password.php +++ b/application/migrations/005_drop_file_password.php @@ -5,17 +5,25 @@ 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; + "); + } } } |