Problem/Motivation
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1171 All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead: CREATE TABLE {flexicolor_preset_selector} ( `machine` VARCHAR(32) DEFAULT NULL COMMENT 'Unique ID for environments.', `fpmachine` VARCHAR(32) DEFAULT NULL COMMENT 'Flexicolor Preset', `fsmachine` VARCHAR(32) DEFAULT NULL COMMENT 'Flexicolor Selector', `color` VARCHAR(7) NOT NULL COMMENT 'Preset Selector Color', PRIMARY KEY (`fpmachine`, `fsmachine`), UNIQUE KEY `name` (`machine`) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Create a preset based on the selectors'; Array ( ) in db_create_table() (line 2803 of …/includes/database/database.inc).
Steps to reproduce
Install 2.x fresh, not through update.
Proposed resolution
Update schema.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#6 | clean.png | 19.64 KB | guilhermevp |
#5 | schema-update-3207539-5.patch | 1.46 KB | TommyK |
#4 | error_flexible_colors.png | 72.62 KB | guilhermevp |
#4 | installation ok.png | 17.71 KB | guilhermevp |
#3 | schema-update-3207539-3.patch | 1.46 KB | TommyK |
Comments
Comment #2
TommyK CreditAttribution: TommyK commentedpatch attached
Comment #3
TommyK CreditAttribution: TommyK commentedupdated patch
Comment #4
guilhermevp CreditAttribution: guilhermevp at CI&T commentedI was able to reproduce the error and the patch do solves it. Also recommend that the fix is commited asap since it can generate a really nasty site break. But the patch has a minor issue that should be solved before commiting it, patch has a whitespace, where it should be clean. That being fixed, the patch is RTBC.
Comment #5
TommyK CreditAttribution: TommyK commentedthanks for the whitespace note; I hadn't noticed when patching late at night
update attached
Comment #6
guilhermevp CreditAttribution: guilhermevp at CI&T commentedWhitespaces are no more!
RTBC.
Comment #8
TommyK CreditAttribution: TommyK commentedthanks for the reviews! fix committed