CodeIgniter Forums
dbforge add_column bug for postgres - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: dbforge add_column bug for postgres (/showthread.php?tid=48043)



dbforge add_column bug for postgres - El Forum - 01-02-2012

[eluser]Frank Wong[/eluser]
Found this error while trying to implement migration on a postgres database.

Issue: When trying to alter a table by adding a column, I would call the dbforge->add_column method and it then calls the _alter_table method in the database/drivers/postgre/postgre_forge.php file.

The call from dbforge->add_column
Code:
$sql = $this->_alter_table('ADD', $this->db->dbprefix.$table, $this->fields, $after_field);

The method definition
Code:
function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '')

Problem: The definition is incorrectly overloaded. The logic might be incorrect also, but have not been verified.