Problem/Motivation
When I updated Feeds on one of my sites, I got this error when I tried to update the database:
drush updb
-------- ----------- --------------- -----------------------------------------
Module Update ID Type Description
-------- ----------- --------------- -----------------------------------------
feeds 8009 hook_update_n 8009 - Adds the 'periodic_import' field
to feeds_feed entities.
-------- ----------- --------------- -----------------------------------------
Do you wish to run the specified pending updates? (yes/no) [yes]:
>
> [notice] Update started: feeds_update_8009
> [error] Unable to parse the column type TINYINT
> [error] Update failed: feeds_update_8009
[error] Update aborted by: feeds_update_8009
[error] Finished performing updates.
My first guess is that this is caused by using SQLite which doesn't have a TINYINT data type. I've run into this a bit before in the past.
If anyone wants me to test any potential fixes, let me know.
TIA.
Comments
Comment #2
megachrizAs far as I can see, Feeds doesn't explicitly set a field as TINYINT. Even the new installed field "periodic_import" is not TINYINT. The field that does result into a tinyint on MySQL is the field "status". This is defined as 'boolean' in Feed.php:
So to me this looks like to be an issue in Drupal Core, not in Feeds.
#3410600: TINYINT clogs updb for path_alias looks like to be related. I see you that you opened that issue.
Comment #3
bogdog400 commentedYes. It seems like I've been having these issues since I've been using SQLite pretty extensively lately.
But if you think it's CORE, why did it appear when trying to run an update for Feeds?
Comment #4
megachriz@bogdog400
Feeds doesn't set any column to TINYINT explicitly. It uses API's in Drupal Core to define fields for the feeds_feed entity type. Drupal Core then creates the SQL tables and fields. It looks like a field of type 'boolean' results into a database column becoming a TINYINT. The code that specifically does that is defined in Drupal Core.
Comment #5
bogdog400 commentedOkay. The problem lies with CORE, but this update with Feeds exposes it. So can Feeds check what CORE has done before running the update?
Comment #6
joelpittet@bogdog400 you will need to file or find an issue in core to address your problem your experiencing.
We can only address issues we have tests for and I can’t think of reasonable test for this. Feel free to write one if you have an idea that relates in scope to feeds. Though I implore you to contribute to fixing the problem at the source. Feel free to relate the core issue to this for context.
It seems you agree the problem is not here so I will close this as works as designed.
Comment #8
bogdog400 commentedFor any readers looking for a solution, I wanted to summarize what I ended up doing. After discussing this with an AI, the AI suggested that I could just temporarily edit the core code and insert the right value of TINYINT. So I did that and the update went through without a hassle.
Here's the code I added to web/core/modules/sqlite/src/Driver/Database/sqlite/Schema.php: