#190 - Install fails on postgresql

  • By
  • Added
  • 20 views
Identifier #190
Issue type Major issue (breaks an entire feature)
Title Install fails on postgresql
Status Completed
Handling member Chris Graham
Addon core_database_drivers
Description During install
Unfortunately a query has failed [ALTER TABLE cms4_f_member_custom_fields ADD field_14 text NOT NULL] [ERROR: column "field_14" contains null values]
Steps to reproduce

Additional information In sources/database_helper.php line 310 you have

if ($_type!='LONG_TEXT') $extra=is_null($default)?'DEFAULT NULL':(' DEFAULT '.(is_string($default)?('\''.db_escape_string($default).'\''):strval($default)));

The SQL postgresql needs is

"ALTER TABLE cms4_f_member_custom_fields ADD field_14 text NOT NULL default ''"

And if it were not for the if then the code would produce this. But it must be there for a reason... But removing the if and having the code run everytime is the fix for postgresql...
Funded? No
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".

Rating

Unrated