Both queries use invalid SQL syntax.

The first query is

ALTER TABLE {userpoints_txn} CHANGE event VARCHAR(32)

MySQL requires a new column name even if the column name does not change.

ALTER TABLE {userpoints_txn} CHANGE event event VARCHAR(32)

The second query is

ALTER TABLE {userpoints_txn} CHANGE status BEFORE event

BEFORE does not exist. Positions can only be specified with AFTER. This change also requires the name and type to be declared, even if it remains unchanged. In this case, the desired result would be achieved with this:

ALTER TABLE {userpoints_txn} CHANGE status status INTEGER NOT NULL default '0' AFTER event

This is not yet a patch because I don't know the standard procedure: Should a fix be made to hook_update_3 or should that one be abandoned and the correct update put in hook_update_4?

CommentFileSizeAuthor
#3 userpoints_update_4.patch414 bytescburschka

Comments

cburschka’s picture

Second query should of course read:

ALTER TABLE {userpoints_txn} CHANGE status  status INTEGER NOT NULL default '0' AFTER time_stamp
kbahey’s picture

Status: Active » Postponed (maintainer needs more info)

Please submit a patch. See http://drupal.org/patch for details.

cburschka’s picture

Title: hook_update_3 is broken » hook_update_4 is broken
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new414 bytes

Apologies, it appears to be update #4, not #3.

Lacking instructions, I have made my patch in hook_update_4, keeping the schema number unchanged.

kbahey’s picture

Status: Needs review » Fixed

The patch was not in unidiff format. Please make future patches in unidiff format.

Anyway, thanks for that.

Committed to HEAD and 5.x.

Anonymous’s picture

Status: Fixed » Closed (fixed)