summaryrefslogtreecommitdiffstats
path: root/application/migrations/016_allow_ipv6_storage.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-09-20 16:03:22 +0200
committerFlorian Pritz <bluewind@xinu.at>2015-09-20 16:03:22 +0200
commit7da9de48d2b3bbb0309d6311e4dc7d275d3bf26d (patch)
treebc90956bccaad107255e350ed29cad242eede5cc /application/migrations/016_allow_ipv6_storage.php
parentf149a0d1abb4a79b1d5de9ddb5963b2eab4b126d (diff)
parente79c1c45dcd23dde1f4b072993829cc008f4858b (diff)
Merge branch 'postgres' into dev
Diffstat (limited to 'application/migrations/016_allow_ipv6_storage.php')
-rw-r--r--application/migrations/016_allow_ipv6_storage.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/application/migrations/016_allow_ipv6_storage.php b/application/migrations/016_allow_ipv6_storage.php
new file mode 100644
index 000000000..726a18601
--- /dev/null
+++ b/application/migrations/016_allow_ipv6_storage.php
@@ -0,0 +1,27 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_allow_ipv6_storage extends CI_Migration {
+
+ public function up()
+ {
+ $prefix = $this->db->dbprefix;
+
+ if ($this->db->dbdriver == 'postgre') {
+ $this->db->query('
+ ALTER TABLE "'.$prefix.'ci_sessions"
+ ALTER COLUMN "ip_address" type varchar(39);
+ ');
+ } else {
+ $this->db->query('
+ ALTER TABLE `'.$prefix.'ci_sessions`
+ CHANGE `ip_address` `ip_address` varchar(39);
+ ');
+ }
+ }
+
+ public function down()
+ {
+ throw new \exceptions\ApiException("migration/downgrade-not-supported", "downgrade not supported");
+ }
+}