Problem/Motivation
Updated from 7x-2.10 to 7x-2.11 on php 5.3. When running drush updb, I get the following message:
Date 7006 Add date value indexes to existed field tables.
Date 7007 Update datestamp field schema to use 'big' integers.
Date 7200 The date_migrate_example module was renamed.
Do you wish to run all pending updates? (y/n):
I say yes, and it outputs:
SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'field_time_value' doesn't exist in table [error]
Performed update: date_update_7006
Finished performing updates.
When I run drush updb again, it gives me the list of three pending updates again, as if they had never been run.
Any thoughts?
Comments
Comment #2
damienmckennaDue to the amount of changes needed for the all-day fix, 7.x-2.12 has been changed to 7.x-3.0.
Comment #3
damienmckennaCan you please test the current 7.x-2.x dev snapshot, let us know if it solves the problems or if they still exist. Thank you.
Comment #4
damienmckennaI'm starting to understand what happened. Can you please provide a list of columns in that table, and details of the field, that will help us track down the problem. Thank you.
Comment #5
micnap commentedI am running into this on a D7 site trying to update from 2.9 to 2.12. It's being caused by a field being only partially deleted. The field is listed in field_config (though not field_config_instance). It has a corresponding field_deleted_data_XXX and field_deleted_revision_XXX. But no amount of field_delete_field, field_purge_batch([ridiculously_high_number]) and cron runs is cleaning things up. There are also half a dozen other partially deleted fields on this site. Haven't worked out why yet. But that's the cause of this issue with running update 7006 for me.
Comment #6
ed2908 commentedHi Damien,
I'm sorry I somehow missed your last reply. I'll test with the snapshot and see what happens next week. I'll also check for partially deleted fields just in case it's that.
-Evan
Comment #7
ed2908 commentedSorry for the slow reply. I only just got the chance to take another look at this.
The columns of field_config look like this:
id
field_name
type
module
active
storage_type
storage_module
storage_active
locked
data
cardinality
translatable
deleted
field_time_value isn't among the listed fields.
I don't see it in field_config_instance either.
Doing a search across all tables in the database, using exact phrase for "field_time_value" returns 0 results.
Doing a search across all code in the website, I don't see any reference to this field.
As a test, I created a new field called field_time_value using the date type. When I search SQL now, I find my new field in both tables. The error preventing the update persists though. Same message of how it can't find that key column.
I reset my database, then tried investigating deleted data tables.
I ran:
drush eval "field_purge_batch(500)"
and got some relevant errors:
Similar result from drush ev "field_purge_batch(1000)"
Unsure how to proceed if Drush hits this error and cleans nothing. No idea why the date module is even looking at this missing field as it's not in the table that's being targeted for update.
Comment #8
ed2908 commentedI tried the latest dev snapshot, no luck. The issue persists.
Comment #9
ed2908 commentedAs it happens, my SQL-fu was bad.
Searching for %field_time_value% did return a listing in field_config as described in #5. Deleted this as a test, and the updates processed properly.
Going to do some testing now to make sure none of my nodes or fields are broken or missing, but after deleting that instance, drush ev field purge batch works again.
Comment #10
ed2908 commentedComment #11
damienmckennaThanks for letting us know you were able to fix it.