- πΊπΈUnited States smustgrave
Wonder if this is still needed for D10?
The SQLite driver doesn't respond well to compound primary keys, if one of the columns is a serial. Example from a module:
'fields' => array(
'id' => array(
'type' => 'serial',
'not null' => TRUE,
'description' => 'Entity id',
),
'path' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'description' => 'The path of the page to apply meta tags to',
),
'lang' => array(
'type' => 'varchar',
'length' => 8,
'not null' => TRUE,
'description' => 'Language code',
),
),
'primary key' => array('id', 'path', 'lang'),
While the usefulness of the above primary key is up for discussion, it is valid, and will work fine in MySOL. However, when SQLite generates the CREATE TABLE, it adds PRIMARY KEY to the field definition in createFieldSql, and removes it from the set. After that, if the primary key set is not empty, it adds a PRIMARY KEY definition to the CREATE TABLE, using the left over columns, causing SQLite to complain 'PDOException: SQLSTATE[HY000]: General error: 1 table "metatags_quick_path_based" has more than one primary key'.
While it's possible to work around, it does break the consistency of the Database API.
I discovered this problem with metatags_quick 2.4, but a quick search tells me that other modules have run into the same bug.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Wonder if this is still needed for D10?