Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
update system
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
6 Jun 2007 at 00:00 UTC
Updated:
21 Jun 2007 at 03:48 UTC
instead of making a few small adjustments to the columns it's addressing, this update instead wipes out the columns completely, and throws in a few failed queries to boot... ;)
attached patch corrects.
| Comment | File | Size | Author |
|---|---|---|---|
| sequence_update.patch | 677 bytes | hunmonk |
Comments
Comment #1
hunmonk commentedbtw, i tested this update on postgres, and it works.
Comment #2
chx commentedSorry. I need to learn db_change_field -- hoped it does autoup -- but not yet -- thanks for the fix.
Comment #3
ChrisKennedy commentedI think you meant to do db_update_field() - http://api.drupal.org/api/HEAD/function/db_update_field
Comment #4
dries commentedChris: are you suggesting this is the wrong patch?
Comment #5
yched commentedNo, hummonk's patch is the right one - you cannot simply tell 'update this column to its current schema definition' in an update function, for by the time the update function is run, the general schema can be different from what it was when the update was written. Bjaspan explains this better than I do.
In short : in update functions, you have to explicitly state the settings for new / updated columns; That is : use db_change_field rather than db_update_field.
Comment #6
dries commentedCommitted to CVS HEAD. Thanks.
Comment #7
(not verified) commented