The hook_install() function doesn't create the event field.
The function is supposed to be called when Drupal does not find any previous version of the module; in this case, if a user installs the 5.x-3.5 version, he will keep to get an error about an undefined field.

Comments

avpaderno’s picture

The field is not even added by any hook_update_N() functions.
I had to manually add the field using phpAdmin.

kbahey’s picture

Status: Active » Closed (works as designed)

Actually, 'event' is now called 'operation'. update # 7 should have changed that for you.

If you have a contributed module that uses 'event', it should be ported to use the new field.

avpaderno’s picture

Status: Closed (works as designed) » Active

hook_update_N() implementations get called when the module is already registered in the Drupal {system} table, and drupal finds a new version of the module. hook_update_N() does not get called the first time the module is installed.

In the specific case, the new field will not installed in a Drupal installation without any previous version of the module installed, if hook_install() does not provide to create it.

kbahey’s picture

I don't understand what you are talking about.

Do you have a patch that fixes whatever problem you are seeing?

avpaderno’s picture

I spitted the issue in two (#265095: Table field get inconsistently named, #265097: hook_update_N() doesn't update any PostgreSQL tables).
On the intranet we use at work we have a web server using a PostgreSQL database, and I had a problem after installing the version 5.x-3.5 of the module (which was not installed before).
I just noticed today that the database was not MySQL as I was wrongly supposing.

jredding’s picture

I just checked and tested it and hook_install does create both the mysql and postgres SQL tables correctly.

and you're correct almost none of the hook_update_* functions have postgres support. Most of the Queries should work just fine on mysql and postgres but for those that won't I updated to the postgres area.

As per a previous conversation the event field has been renamed to operation thus the original topic of the issue is incorrect.

jredding’s picture

Status: Active » Fixed
kbahey’s picture

One final note: the use of PostgreSQL in all of Drupal is far less than MySQL, so do not expect that just reporting a PostgreSQL issue will get it fixed as quickly as MySQL.

If you want good support for PostgreSQL for a module, you have to put in the effort by creating and/or testing patches for it specifically.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.