The date column in the antispam_counter table was changed in drupal 7.

'date' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),

Previously it was of datetime type. The module update hook is missing that take care of this. Without this update, you cannot post new comments, as it errors out.

Attached is a patch that provides the upgrade hook.

Comments

ttkaminski’s picture

StatusFileSize
new1.04 KB

Here's an improved patch that checks to see if the date column is already an int, if so, then it ignores the change to the table. Needed if you already have the proper schema installed.

jody lynn’s picture

Version: 7.x-1.5 » 7.x-1.x-dev
Priority: Critical » Major
Status: Active » Needs work

Patch needs work.

I don't like that there's a state in the middle of the function where data has been deleted from the database. What if the code stops in the middle of the function? You should add a new column, insert the changed values, then delete the old field and rename the new one.

ttkaminski’s picture

Status: Needs work » Needs review
StatusFileSize
new1.08 KB

You should add a new column, insert the changed values, then delete the old field and rename the new one.

Here's an UNTESTED patch that does that. Unfortunately I didn't have a database I could quickly test this against. But the changes were straight forward, so it should work.

Status: Needs review » Needs work

The last submitted patch, antispam_counter_date-3.patch, failed testing.