View Issue Details

IDProjectCategoryView StatusLast Update
190Composrcore_database_driverspublic2010-07-15 18:46
ReporterGuest Assigned ToChris Graham  
PrioritynormalSeveritymajor 
Status resolvedResolutionfixed 
Summary190: Install fails on postgresql
DescriptionDuring 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]
Additional InformationIn 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...
TagsNo tags attached.
Attach Tags
Time estimation (hours)
Sponsorship open

Sponsor

Date Added Member Amount Sponsored

Activities

Chris Graham

2010-07-15 18:46

administrator   ~60

I think it must be that some DB's use blob's for the LONG_TEXT implementation and in those DB's the blob values don't allow default's.
I've put in an '||' clause for postgresql in the file. A bit of an architectural issue, so we'll have to review the DB driver structure if we do end up doing a full compatibility review in the future.

Issue History

Date Modified Username Field Change