The schema module says:
nodewords_bypath_rules.type is type int but its default 1 is PHP type string

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna’s picture

Status: Active » Needs review
FileSize
466 bytes

Patch attached.

DamienMcKenna’s picture

Title: Minor schema error - nodewords_bypath_rules.type is incorrect type » Minor schema errors reported by schema.module

There are actually several additional issues as reported by schema.module:

nodewords_bypath_rules

column type:
declared: array('type' => 'int', 'length' => 1, 'not null' => TRUE, 'default' => 1)
actual: array('type' => 'int', 'not null' => TRUE, 'default' => 1, 'disp-width' => '1')

column path_expr:
declared: array('type' => 'text', 'length' => 256, 'not null' => TRUE)
actual: array('type' => 'text', 'not null' => TRUE)

column weight:
declared: array('type' => 'int', 'length' => 1, 'not null' => TRUE)
actual: array('type' => 'int', 'not null' => TRUE, 'disp-width' => '1')

nodewords_bypath_tags

column rule_id:
declared: array('type' => 'int', 'length' => 10, 'not null' => TRUE)
actual: array('type' => 'int', 'not null' => TRUE, 'disp-width' => '10')

column meta_value:
declared: array('type' => 'text', 'length' => 255, 'not null' => TRUE)
actual: array('type' => 'text', 'not null' => TRUE)

Going through them:
* Should all columns marked "text" with a fixed length, e.g. nodewords_bypath_rules .path_expr, be changed to varchar or should the length be removed?
* MySQL interprets the 'length' attribute as the 'disp-width', i.e. the display width rather than a hard data storage length. Accordingly, the correct 'size' attribute should be used instead, e.g. 'int:1' should be changed to 'int:tiny' ('type' => 'int', 'size' => 'tiny'). Honestly, the 'int:10' should be just left as 'int'. Please see http://matthom.com/archive/2006/11/28/mysql-integer-columns-and-display-... for an easy-to-follow explanation of this.

DamienMcKenna’s picture

Status: Needs review » Needs work

The patch needs to also resolve the other issues from comment #2.

univate’s picture

Status: Needs work » Fixed

I have gone through and checked against the schema module and this should be fixed.

Status: Fixed » Closed (fixed)

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