https://bugzilla.wikimedia.org/show_bug.cgi?id=31152

       Web browser: ---
             Bug #: 31152
           Summary: Database upgrades fail when adding NOT NULL fields
           Product: MediaWiki extensions
           Version: any
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: Unprioritized
         Component: Semantic MediaWiki
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


While upgrading a postgresql backed instance of SMW 1.5.something, to 1.6.1 I
got this error:

    ... creating field smw_subobject ... Warning: pg_query(): Query failed:
ERROR:  column "smw_subobject" contains null values in
/home/cffc/webapps/htdocs/w/includes/db/DatabasePostgres.php on line 237
A database query syntax error has occurred.
The last attempted database query was:
"ALTER TABLE smw_ids ADD "smw_subobject" TEXT NOT NULL"
from within function "SMWSQLHelpers::updatePostgresField".
Database returned error "1: ERROR:  column "smw_subobject" contains
null values"

Obviously we can't just go around adding NOT NULL fields without setting a
default value.

This might be a postgresql code specific issue, or even a field specific issue
— if php gave me a traceback, maybe I'd go looking — but it might be worth
checking over all the database upgrade code to catch the general case.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to