Installing File Entity 7.x-2.0-alpha1 on a sqlite3-backed site results in a critical error message. Some more details:
- Error occurs with both the 2.0-alpha1 and 2.0-dev version of File Entity.
- Error occurs whether enabling via the UI or via Drush (5.8).
- Using 7.23 core with standard installation profile. Enabling File Entity obviously requires ctools; this downloads and installs correctly beforehand
- No error when using MySQL DB.
- No error when using sqlite and upgrading from a previous version of File Entity, in my case 2.0-unstable7.
- SQlite DB is version 3
- OS is Ubuntu 12.04.2 LTS
Text of error message:
WD php: PDOException: SQLSTATE[HY000]: General error: 1 table "file_metadata" has more than one primary key: CREATE TABLE {file_metadata} ( [error]
fid INTEGER PRIMARY KEY AUTOINCREMENT CHECK (fid>= 0),
name VARCHAR(255) NOT NULL,
value BLOB NULL DEFAULT NULL,
PRIMARY KEY (name)
);
; Array
(
)
in db_create_table() (line 2717 of /var/www/cst-sandbox/d723-fileentity/includes/database/database.inc).
PDOException: SQLSTATE[HY000]: General error: 1 table "file_metadata" has more than one primary key: CREATE TABLE {file_metadata} (
fid INTEGER PRIMARY KEY AUTOINCREMENT CHECK (fid>= 0),
name VARCHAR(255) NOT NULL,
value BLOB NULL DEFAULT NULL,
PRIMARY KEY (name)
);
; Array
(
)
in db_create_table() (line 2717 of /var/www/cst-sandbox/d723-fileentity/includes/database/database.inc).
Drush command terminated abnormally due to an unrecoverable error.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | file_entity-fix_file_metadata_primary_key_schema-2064305-11.patch | 1.03 KB | hswong3i |
| #4 | 2064305-fix-file-metadata-primary-key-schema.patch | 1.68 KB | dave reid |
Comments
Comment #1
dave reidStrange, why doesn't the SQLite driver support multiple primary keys... This is something the Schema API (hook_schema()) supports...
Comment #2
markgifford commentedMore details in case it's relevant:
Comment #3
dave reidAh, I think I know what's going wrong now. Let me upload a patch for you to test.
Comment #4
dave reidPlease test the following patch.
Comment #5
markgifford commentedPatch applied to 7.x-2.0-alpha1, and I can confirm that fixed the issue on my system. File Entity installed cleanly using 7.23 standard profile and Drush 5.8. Thanks Dave!
Comment #6
markgifford commentedWhoops, probably should have applied patch to 7-2.x-dev in the first place rather than 7-2.x-alpha1. Anyway, also tested patch on -dev and can confirm it's successful.
Comment #7
aaron commentedComment #8
dave reidOk, committed #4 to http://drupalcode.org/project/file_entity.git/commit/7c902cb
Comment #9
hswong3i commentedIn MySQL when update it face following error message:
Comment #10
hswong3i commentedI face similar issue when update message module schema which is originally serial primary key, and now that patch works, as your reference:
Comment #11
hswong3i commentedDouble check with 7.x-2.x + MySQL + following procedures:
Comment #12
killua99 commentedThis patch help me continue working .... idk if it correct or not, but this fix this bug.
Comment #13
dave reidThis is already fixed with #2065213: DB update 7215 fails on upgrade to dev version from alpha