diff options
-rw-r--r-- | system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php | 2 | ||||
-rw-r--r-- | system/database/drivers/postgre/postgre_forge.php | 2 | ||||
-rw-r--r-- | user_guide_src/source/changelog.rst | 1 |
3 files changed, 3 insertions, 2 deletions
diff --git a/system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php b/system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php index e5bfee6ad..d62143989 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php +++ b/system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php @@ -136,7 +136,7 @@ class CI_DB_pdo_pgsql_forge extends CI_DB_pdo_forge { if (isset($field[$i]['null'])) { $sqls[] = $sql.' ALTER COLUMN '.$this->db->escape_identifiers($field[$i]['name']) - .($field[$i]['null'] === TRUE ? ' DROP NOT NULL' : ' SET NOT NULL'); + .(trim($field[$i]['null']) === $this->_null ? ' DROP NOT NULL' : ' SET NOT NULL'); } if ( ! empty($field[$i]['new_name'])) diff --git a/system/database/drivers/postgre/postgre_forge.php b/system/database/drivers/postgre/postgre_forge.php index cf90325e1..79d52218d 100644 --- a/system/database/drivers/postgre/postgre_forge.php +++ b/system/database/drivers/postgre/postgre_forge.php @@ -131,7 +131,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { if (isset($field[$i]['null'])) { $sqls[] = $sql.' ALTER COLUMN '.$this->db->escape_identifiers($field[$i]['name']) - .($field[$i]['null'] === TRUE ? ' DROP NOT NULL' : ' SET NOT NULL'); + .(trim($field[$i]['null']) === $this->_null ? ' DROP NOT NULL' : ' SET NOT NULL'); } if ( ! empty($field[$i]['new_name'])) diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index c983f1b5c..966b4cb73 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -9,6 +9,7 @@ Bug fixes for 3.1.10 -------------------- - Fixed a bug (#5526) - :doc:`Session Library <libraries/sessions>` had a syntax error in its 'memcached' driver. +- Fixed a bug (#5542) - :doc:`Database Forge <database/forge>` method ``modify_column()`` always made fields ``NOT NULL`` when attempting to modify their nullable property under PostgreSQL. Version 3.1.9 ============= |